Skip to content

Commit

Permalink
Revert "Fix regression test failures"
Browse files Browse the repository at this point in the history
This reverts commit c7e0dac.
  • Loading branch information
irafia committed Oct 23, 2023
1 parent c7e0dac commit 3817eee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
21 changes: 9 additions & 12 deletions expected/pg_auth_mon.out
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ select rolname, successful_attempts, total_hba_conflicts, other_auth_failures fr

--2.Login attempt by invalid username
\! PGPASSWORD=postgres psql -X -U auth_blah -d testdb -c "select 1" 2>&1 | sed 's/^.* FATAL: */FATAL: /'
FATAL: role "auth_blah" does not exist
FATAL: password authentication failed for user "auth_blah"
select rolname, uid, successful_attempts, total_hba_conflicts, other_auth_failures from pg_auth_mon where uid = 0;
rolname | uid | successful_attempts | total_hba_conflicts | other_auth_failures
---------+-----+---------------------+---------------------+---------------------
Expand All @@ -33,23 +33,19 @@ FATAL: role "auth_nologin" is not permitted to log in
select rolname, successful_attempts, total_hba_conflicts, other_auth_failures from pg_auth_mon where rolname like 'auth_%';
rolname | successful_attempts | total_hba_conflicts | other_auth_failures
--------------+---------------------+---------------------+---------------------
auth_super | 1 | 0 | 0
auth_nologin | 1 | 0 | 0
auth_super | 1 | 0 | 0
(2 rows)

--4.Login attempt by a valid user with a wrong password, only reports unsuccessful if auth_method is not set as trust
--4.Login attempt by a valid user with a wrong password
\! PGPASSWORD=postgres psql -X -U auth_test -d testdb -c "select 1" 2>&1 | sed 's/^.* FATAL: */FATAL: /'
?column?
----------
1
(1 row)

FATAL: password authentication failed for user "auth_test"
select rolname, successful_attempts, total_hba_conflicts, other_auth_failures from pg_auth_mon where rolname like 'auth_%' order by rolname;
rolname | successful_attempts | total_hba_conflicts | other_auth_failures
--------------+---------------------+---------------------+---------------------
auth_nologin | 1 | 0 | 0
auth_super | 1 | 0 | 0
auth_test | 1 | 0 | 0
auth_test | 0 | 0 | 1
(3 rows)

--5. Test upgrade to version '1.1'
Expand All @@ -66,7 +62,7 @@ select rolname, successful_attempts, total_hba_conflicts, other_auth_failures fr
--------------+---------------------+---------------------+---------------------
auth_nologin | 1 | 0 | 0
auth_super | 1 | 0 | 0
auth_test | 1 | 0 | 0
auth_test | 0 | 0 | 1
(3 rows)

--6. Rolname is not empty for deleted users
Expand All @@ -82,7 +78,7 @@ select rolname, successful_attempts, total_hba_conflicts, other_auth_failures fr
--------------------+---------------------+---------------------+---------------------
auth_nologin | 1 | 0 | 0
auth_super | 1 | 0 | 0
auth_test | 1 | 0 | 0
auth_test | 0 | 0 | 1
auth_to_be_deleted | 1 | 0 | 0
(4 rows)

Expand All @@ -94,6 +90,7 @@ select rolname, successful_attempts, total_hba_conflicts, other_auth_failures fr
(1 row)

alter role auth_to_be_renamed rename to auth_renamed;
NOTICE: MD5 password cleared because of role rename
alter role auth_renamed with password 'postgres';
\! PGPASSWORD=postgres psql -X -U auth_renamed -d testdb -c "select 1"
?column?
Expand All @@ -108,7 +105,7 @@ select rolname, successful_attempts, total_hba_conflicts, other_auth_failures fr
auth_nologin | 1 | 0 | 0
auth_renamed | 2 | 0 | 0
auth_super | 1 | 0 | 0
auth_test | 1 | 0 | 0
auth_test | 0 | 0 | 1
auth_to_be_deleted | 1 | 0 | 0
(5 rows)

Expand Down
2 changes: 1 addition & 1 deletion sql/pg_auth_mon.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ select rolname, uid, successful_attempts, total_hba_conflicts, other_auth_failur
\! PGPASSWORD=postgres psql -X -U auth_nologin -d testdb -c "select 1" 2>&1 | sed 's/^.* FATAL: */FATAL: /'
select rolname, successful_attempts, total_hba_conflicts, other_auth_failures from pg_auth_mon where rolname like 'auth_%';

--4.Login attempt by a valid user with a wrong password, only reports unsuccessful if auth_method is not set as trust
--4.Login attempt by a valid user with a wrong password
\! PGPASSWORD=postgres psql -X -U auth_test -d testdb -c "select 1" 2>&1 | sed 's/^.* FATAL: */FATAL: /'
select rolname, successful_attempts, total_hba_conflicts, other_auth_failures from pg_auth_mon where rolname like 'auth_%' order by rolname;

Expand Down

0 comments on commit 3817eee

Please sign in to comment.