Skip to content

Commit 93fcb4a

Browse files
committed
Clean up roles from roleattributes test
Having the roles remain after the test ends up causing repeated 'make installcheck' runs to fail and may be risky from a security perspective also, so remove them at the end of the test.
1 parent d6968e6 commit 93fcb4a

File tree

2 files changed

+32
-7
lines changed

2 files changed

+32
-7
lines changed

src/test/regress/expected/roleattributes.out

+16-3
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,20 @@ SELECT * FROM pg_authid WHERE rolname = 'test_bypassrls';
230230
test_bypassrls | f | t | f | f | f | f | t | -1 | |
231231
(1 row)
232232

233-
-- remove the one role with LOGIN rights
233+
-- clean up roles
234+
DROP ROLE test_def_superuser;
235+
DROP ROLE test_superuser;
236+
DROP ROLE test_def_inherit;
237+
DROP ROLE test_inherit;
238+
DROP ROLE test_def_createrole;
239+
DROP ROLE test_createrole;
240+
DROP ROLE test_def_createdb;
241+
DROP ROLE test_createdb;
242+
DROP ROLE test_def_role_canlogin;
234243
DROP ROLE test_role_canlogin;
235-
-- other roles not removed to test pg_dumpall role dump through
236-
-- pg_upgrade
244+
DROP USER test_def_user_canlogin;
245+
DROP USER test_user_canlogin;
246+
DROP ROLE test_def_replication;
247+
DROP ROLE test_replication;
248+
DROP ROLE test_def_bypassrls;
249+
DROP ROLE test_bypassrls;

src/test/regress/sql/roleattributes.sql

+16-4
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,20 @@ SELECT * FROM pg_authid WHERE rolname = 'test_bypassrls';
7878
ALTER ROLE test_bypassrls WITH BYPASSRLS;
7979
SELECT * FROM pg_authid WHERE rolname = 'test_bypassrls';
8080

81-
-- remove the one role with LOGIN rights
81+
-- clean up roles
82+
DROP ROLE test_def_superuser;
83+
DROP ROLE test_superuser;
84+
DROP ROLE test_def_inherit;
85+
DROP ROLE test_inherit;
86+
DROP ROLE test_def_createrole;
87+
DROP ROLE test_createrole;
88+
DROP ROLE test_def_createdb;
89+
DROP ROLE test_createdb;
90+
DROP ROLE test_def_role_canlogin;
8291
DROP ROLE test_role_canlogin;
83-
84-
-- other roles not removed to test pg_dumpall role dump through
85-
-- pg_upgrade
92+
DROP USER test_def_user_canlogin;
93+
DROP USER test_user_canlogin;
94+
DROP ROLE test_def_replication;
95+
DROP ROLE test_replication;
96+
DROP ROLE test_def_bypassrls;
97+
DROP ROLE test_bypassrls;

0 commit comments

Comments
 (0)