Skip to content

Commit

Permalink
fix tests for Pg16 and EE16
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktoriia Shepard committed Oct 27, 2023
1 parent 4868daa commit 915d066
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions tests/backup_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3075,11 +3075,20 @@ def test_missing_replication_permission(self):
except ProbackupException as e:
# 9.5: ERROR: must be superuser or replication role to run a backup
# >=9.6: FATAL: must be superuser or replication role to start walsender
self.assertRegex(
e.message,
"ERROR: must be superuser or replication role to run a backup|FATAL: must be superuser or replication role to start walsender",
"\n Unexpected Error Message: {0}\n CMD: {1}".format(
repr(e.message), self.cmd))
if self.pg_config_version < 160000:
self.assertRegex(
e.message,
"ERROR: must be superuser or replication role to run a backup|"
"FATAL: must be superuser or replication role to start walsender",
"\n Unexpected Error Message: {0}\n CMD: {1}".format(
repr(e.message), self.cmd))
else:
self.assertRegex(
e.message,
"FATAL: permission denied to start WAL sender\n"
"DETAIL: Only roles with the REPLICATION",
"\n Unexpected Error Message: {0}\n CMD: {1}".format(
repr(e.message), self.cmd))

# @unittest.skip("skip")
def test_missing_replication_permission_1(self):
Expand Down Expand Up @@ -3228,9 +3237,17 @@ def test_missing_replication_permission_1(self):
# 'WARNING: could not connect to database backupdb: connection to server at "localhost" (127.0.0.1), port 29732 failed: FATAL: must be superuser or replication role to start walsender'
# OS-dependant messages:
# 'WARNING: could not connect to database backupdb: connection to server at "localhost" (::1), port 12101 failed: Connection refused\n\tIs the server running on that host and accepting TCP/IP connections?\nconnection to server at "localhost" (127.0.0.1), port 12101 failed: FATAL: must be superuser or replication role to start walsender'
self.assertRegex(
output,
r'WARNING: could not connect to database backupdb:[\s\S]*?FATAL: must be superuser or replication role to start walsender')

if self.pg_config_version < 160000:
self.assertRegex(
output,
r'WARNING: could not connect to database backupdb:[\s\S]*?'
r'FATAL: must be superuser or replication role to start walsender')
else:
self.assertRegex(
output,
r'WARNING: could not connect to database backupdb:[\s\S]*?'
r'FATAL: permission denied to start WAL sender')

# @unittest.skip("skip")
def test_basic_backup_default_transaction_read_only(self):
Expand Down

0 comments on commit 915d066

Please sign in to comment.