1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-09-16 09:26:30 +02:00

fix tests for Pg16 and EE16

This commit is contained in:
Viktoriia Shepard
2023-10-27 19:12:16 +02:00
parent 4868daae34
commit 915d066554

View File

@@ -3075,9 +3075,18 @@ class BackupTest(ProbackupTest, unittest.TestCase):
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
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",
"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))
@@ -3228,9 +3237,17 @@ class BackupTest(ProbackupTest, unittest.TestCase):
# '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'
if self.pg_config_version < 160000:
self.assertRegex(
output,
r'WARNING: could not connect to database backupdb:[\s\S]*?FATAL: must be superuser or replication role to start walsender')
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):