summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Frost2015-04-22 16:43:57 +0000
committerStephen Frost2015-04-22 16:43:57 +0000
commit450fa1b5ba0e986a20d8c017500c0c0bbf1e0b4b (patch)
tree7b15a3b8c23bbbff8a77520f92e2606dc327bc84
parent0bf22e0c8b1114ae37939c500535307abefd38e1 (diff)
Fix installcheck for test_rls_hooks
As pointed out by the buildfarm, test_rls_hooks wasn't functioning properly with a clean installcheck. test_rls_hooks needs to explicitly load the library with the hooks in it, to allow installcheck to work; using the --temp-config doesn't help since that isn't used when running installcheck and it isn't exactly fair to the buildfarm to modify the installed config prior to calling installcheck. Also, have test_rls_hooks clean up after itself.
-rw-r--r--src/test/modules/test_rls_hooks/expected/test_rls_hooks.out7
-rw-r--r--src/test/modules/test_rls_hooks/sql/test_rls_hooks.sql11
2 files changed, 18 insertions, 0 deletions
diff --git a/src/test/modules/test_rls_hooks/expected/test_rls_hooks.out b/src/test/modules/test_rls_hooks/expected/test_rls_hooks.out
index d55aea726e7..54d3bb7a8cc 100644
--- a/src/test/modules/test_rls_hooks/expected/test_rls_hooks.out
+++ b/src/test/modules/test_rls_hooks/expected/test_rls_hooks.out
@@ -1,3 +1,4 @@
+LOAD 'test_rls_hooks';
CREATE TABLE rls_test_permissive (
username name,
supervisor name,
@@ -191,3 +192,9 @@ ERROR: new row violates WITH CHECK OPTION for "rls_test_both"
-- failure
INSERT INTO rls_test_both VALUES ('r4','s4',7);
ERROR: new row violates WITH CHECK OPTION for "rls_test_both"
+RESET ROLE;
+DROP TABLE rls_test_restrictive;
+DROP TABLE rls_test_permissive;
+DROP TABLE rls_test_both;
+DROP ROLE r1;
+DROP ROLE s1;
diff --git a/src/test/modules/test_rls_hooks/sql/test_rls_hooks.sql b/src/test/modules/test_rls_hooks/sql/test_rls_hooks.sql
index be13ab4c92d..ece4ab9dc94 100644
--- a/src/test/modules/test_rls_hooks/sql/test_rls_hooks.sql
+++ b/src/test/modules/test_rls_hooks/sql/test_rls_hooks.sql
@@ -1,3 +1,5 @@
+LOAD 'test_rls_hooks';
+
CREATE TABLE rls_test_permissive (
username name,
supervisor name,
@@ -155,3 +157,12 @@ INSERT INTO rls_test_both VALUES ('r1','s1',7);
-- failure
INSERT INTO rls_test_both VALUES ('r4','s4',7);
+
+RESET ROLE;
+
+DROP TABLE rls_test_restrictive;
+DROP TABLE rls_test_permissive;
+DROP TABLE rls_test_both;
+
+DROP ROLE r1;
+DROP ROLE s1;