From 47ab5d2e2ec762c9a07b4e07f0207b8230a489c1 Mon Sep 17 00:00:00 2001 From: Alexander Korotkov Date: Mon, 16 Oct 2023 03:57:43 +0300 Subject: [PATCH] Fix role names in src/test/authentication/t/005_login_trigger.pl Per buildfarm member longfin. --- .../authentication/t/005_login_trigger.pl | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/test/authentication/t/005_login_trigger.pl b/src/test/authentication/t/005_login_trigger.pl index f317012a19d..2c5d4bf33fe 100644 --- a/src/test/authentication/t/005_login_trigger.pl +++ b/src/test/authentication/t/005_login_trigger.pl @@ -94,8 +94,8 @@ $node->start; # Create temporary roles and log table psql_command( - $node, 'CREATE ROLE alice WITH LOGIN; -CREATE ROLE mallory WITH LOGIN; + $node, 'CREATE ROLE regress_alice WITH LOGIN; +CREATE ROLE regress_mallory WITH LOGIN; CREATE TABLE user_logins(id serial, who text); GRANT SELECT ON user_logins TO public; ', 0, 'create tmp objects', @@ -109,7 +109,7 @@ psql_command( 'CREATE FUNCTION on_login_proc() RETURNS event_trigger AS $$ BEGIN INSERT INTO user_logins (who) VALUES (SESSION_USER); - IF SESSION_USER = \'mallory\' THEN + IF SESSION_USER = \'regress_mallory\' THEN RAISE EXCEPTION \'Hello %! You are NOT welcome here!\', SESSION_USER; END IF; RAISE NOTICE \'Hello %! You are welcome!\', SESSION_USER; @@ -140,20 +140,20 @@ psql_command( # Try to log as allowed Alice and disallowed Mallory (two times) psql_command( - $node, 'SELECT 1;', 0, 'try alice', - connstr => 'user=alice', + $node, 'SELECT 1;', 0, 'try regress_alice', + connstr => 'user=regress_alice', log_exact => '1', err_like => [qr/You are welcome/], err_unlike => [qr/You are NOT welcome/]); psql_command( - $node, 'SELECT 1;', 2, 'try mallory', - connstr => 'user=mallory', + $node, 'SELECT 1;', 2, 'try regress_mallory', + connstr => 'user=regress_mallory', log_exact => '', err_like => [qr/You are NOT welcome/], err_unlike => [qr/You are welcome/]); psql_command( - $node, 'SELECT 1;', 2, 'try mallory', - connstr => 'user=mallory', + $node, 'SELECT 1;', 2, 'try regress_mallory', + connstr => 'user=regress_mallory', log_exact => '', err_like => [qr/You are NOT welcome/], err_unlike => [qr/You are welcome/]); @@ -161,8 +161,8 @@ psql_command( # Check that Alice's login record is here, while the Mallory's one is not psql_command( $node, 'SELECT * FROM user_logins;', 0, 'select *', - log_like => [qr/3\|alice/], - log_unlike => [qr/mallory/], + log_like => [qr/3\|regress_alice/], + log_unlike => [qr/regress_mallory/], err_like => [qr/You are welcome/]); # Check total number of successful logins so far @@ -180,8 +180,8 @@ psql_command( psql_command( $node, 'DROP TABLE user_logins; DROP FUNCTION on_login_proc; -DROP ROLE mallory; -DROP ROLE alice; +DROP ROLE regress_mallory; +DROP ROLE regress_alice; ', 0, 'cleanup', log_exact => '', err_exact => '');