Fix role names in src/test/authentication/t/005_login_trigger.pl
authorAlexander Korotkov <akorotkov@postgresql.org>
Mon, 16 Oct 2023 00:57:43 +0000 (03:57 +0300)
committerAlexander Korotkov <akorotkov@postgresql.org>
Mon, 16 Oct 2023 01:01:45 +0000 (04:01 +0300)
Per buildfarm member longfin.

src/test/authentication/t/005_login_trigger.pl

index f317012a19d63363f70c681044aa854892e0bc24..2c5d4bf33fe2a612ae2aca330a36c9c3b996275c 100644 (file)
@@ -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 => '');