Thread: Add more tests on event triggers

Add more tests on event triggers

From
Fabien COELHO
Date:
Here are some more tests for event triggers, especially about new features
introduced recently in 296f3a6053844089bc533630fffafaba8f016384.

Check that COMMENT, GRANT and REVOKE do trigger some events.

The patch also check some more error cases: SQL function, functions with 
declared arguments, arguments passed to the trigger, event trigger on 
global objects (ROLE, TABLESPACE, DATABASE).

I have left out "SECURITY LABEL" which would require a special security 
label provider. Note that they do not seem to be tested at all anyway:-( 
The "security_label.sql" really tests that all fails when no plugin is 
available. If some actual tests are added to security label some day, I 
think that event triggers about them should be tested there.

-- 
Fabien.

Re: Add more tests on event triggers

From
Alvaro Herrera
Date:
Fabien COELHO wrote:
> 
> Here are some more tests for event triggers, especially about new features
> introduced recently in 296f3a6053844089bc533630fffafaba8f016384.
> 
> Check that COMMENT, GRANT and REVOKE do trigger some events.
> 
> The patch also check some more error cases: SQL function, functions with
> declared arguments, arguments passed to the trigger, event trigger on global
> objects (ROLE, TABLESPACE, DATABASE).

Will have a look later, thanks.

> I have left out "SECURITY LABEL" which would require a special security
> label provider. Note that they do not seem to be tested at all anyway:-( The
> "security_label.sql" really tests that all fails when no plugin is
> available. If some actual tests are added to security label some day, I
> think that event triggers about them should be tested there.

You can add tests in src/test/modules/dummy_seclabel.


-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



Re: Add more tests on event triggers

From
Fabien COELHO
Date:
>> I have left out "SECURITY LABEL" which would require a special security
>> label provider. [...]
>
> You can add tests in src/test/modules/dummy_seclabel.

Thanks for the pointer, I have indeed missed these special tests. I'll 
have a look.

-- 
Fabien.



Re: Add more tests on event triggers

From
Fabien COELHO
Date:
> You can add tests in src/test/modules/dummy_seclabel.

Patch attached to test sec label there, in addition to the other more 
standard checks in event_trigger.

-- 
Fabien.

Re: Add more tests on event triggers

From
Robert Haas
Date:
On Wed, Feb 25, 2015 at 10:03 AM, Fabien COELHO <coelho@cri.ensmp.fr> wrote:
>> You can add tests in src/test/modules/dummy_seclabel.
>
> Patch attached to test sec label there, in addition to the other more
> standard checks in event_trigger.

These tests seem worthwhile to me.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



Re: Add more tests on event triggers

From
Alvaro Herrera
Date:
Robert Haas wrote:
> On Wed, Feb 25, 2015 at 10:03 AM, Fabien COELHO <coelho@cri.ensmp.fr> wrote:
> >> You can add tests in src/test/modules/dummy_seclabel.
> >
> > Patch attached to test sec label there, in addition to the other more
> > standard checks in event_trigger.
> 
> These tests seem worthwhile to me.

Pushed, thanks.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services