Skip to content

Commit 915d066

Browse files
author
Viktoriia Shepard
committed
fix tests for Pg16 and EE16
1 parent 4868daa commit 915d066

File tree

1 file changed

+25
-8
lines changed

1 file changed

+25
-8
lines changed

Diff for: tests/backup_test.py

+25-8
Original file line numberDiff line numberDiff line change
@@ -3075,11 +3075,20 @@ def test_missing_replication_permission(self):
30753075
except ProbackupException as e:
30763076
# 9.5: ERROR: must be superuser or replication role to run a backup
30773077
# >=9.6: FATAL: must be superuser or replication role to start walsender
3078-
self.assertRegex(
3079-
e.message,
3080-
"ERROR: must be superuser or replication role to run a backup|FATAL: must be superuser or replication role to start walsender",
3081-
"\n Unexpected Error Message: {0}\n CMD: {1}".format(
3082-
repr(e.message), self.cmd))
3078+
if self.pg_config_version < 160000:
3079+
self.assertRegex(
3080+
e.message,
3081+
"ERROR: must be superuser or replication role to run a backup|"
3082+
"FATAL: must be superuser or replication role to start walsender",
3083+
"\n Unexpected Error Message: {0}\n CMD: {1}".format(
3084+
repr(e.message), self.cmd))
3085+
else:
3086+
self.assertRegex(
3087+
e.message,
3088+
"FATAL: permission denied to start WAL sender\n"
3089+
"DETAIL: Only roles with the REPLICATION",
3090+
"\n Unexpected Error Message: {0}\n CMD: {1}".format(
3091+
repr(e.message), self.cmd))
30833092

30843093
# @unittest.skip("skip")
30853094
def test_missing_replication_permission_1(self):
@@ -3228,9 +3237,17 @@ def test_missing_replication_permission_1(self):
32283237
# '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'
32293238
# OS-dependant messages:
32303239
# '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'
3231-
self.assertRegex(
3232-
output,
3233-
r'WARNING: could not connect to database backupdb:[\s\S]*?FATAL: must be superuser or replication role to start walsender')
3240+
3241+
if self.pg_config_version < 160000:
3242+
self.assertRegex(
3243+
output,
3244+
r'WARNING: could not connect to database backupdb:[\s\S]*?'
3245+
r'FATAL: must be superuser or replication role to start walsender')
3246+
else:
3247+
self.assertRegex(
3248+
output,
3249+
r'WARNING: could not connect to database backupdb:[\s\S]*?'
3250+
r'FATAL: permission denied to start WAL sender')
32343251

32353252
# @unittest.skip("skip")
32363253
def test_basic_backup_default_transaction_read_only(self):

0 commit comments

Comments
 (0)