1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-02-08 14:28:36 +02:00

tests: minor fixes

This commit is contained in:
Grigory Smolkin 2020-12-03 13:15:08 +03:00
parent 7ddf8ee18a
commit 186fb72e1c
4 changed files with 7 additions and 10 deletions

View File

@ -1212,7 +1212,7 @@ done:
}
/*
* Create recovery.conf (probackup_recovery.conf in case of PG12)
* Create recovery.conf (postgresql.auto.conf in case of PG12)
* with given recovery target parameters
*/
static void

View File

@ -1607,7 +1607,7 @@ class ArchiveTest(ProbackupTest, unittest.TestCase):
])
if self.get_version(node) >= self.version_to_num('12.0'):
recovery_conf = os.path.join(node.data_dir, 'probackup_recovery.conf')
recovery_conf = os.path.join(node.data_dir, 'postgresql.auto.conf')
else:
recovery_conf = os.path.join(node.data_dir, 'recovery.conf')
@ -1682,7 +1682,7 @@ class ArchiveTest(ProbackupTest, unittest.TestCase):
self.restore_node(backup_dir, 'node', node)
if self.get_version(node) >= self.version_to_num('12.0'):
recovery_conf = os.path.join(node.data_dir, 'probackup_recovery.conf')
recovery_conf = os.path.join(node.data_dir, 'postgresql.auto.conf')
else:
recovery_conf = os.path.join(node.data_dir, 'recovery.conf')
@ -2096,7 +2096,7 @@ class ArchiveTest(ProbackupTest, unittest.TestCase):
if node.major_version >= 12:
node.append_conf(
'probackup_recovery.conf', "restore_command = '{0}'".format(restore_command))
'postgresql.auto.conf', "restore_command = '{0}'".format(restore_command))
else:
node.append_conf(
'recovery.conf', "restore_command = '{0}'".format(restore_command))

View File

@ -675,7 +675,7 @@ class CompatibilityTest(ProbackupTest, unittest.TestCase):
# check that in-place is disabled
self.assertIn(
"WARNING: In-place merge is disabled "
"because of program versions mismatch", output)
"because of storage format incompatibility", output)
# restore merged backup
node_restored = self.make_simple_node(
@ -1077,7 +1077,7 @@ class CompatibilityTest(ProbackupTest, unittest.TestCase):
# check that in-place is disabled
self.assertNotIn(
"WARNING: In-place merge is disabled "
"because of program versions mismatch", output)
"because of storage format incompatibility", output)
# restore merged backup
node_restored = self.make_simple_node(

View File

@ -1326,10 +1326,6 @@ class ProbackupTest(object):
f.close()
config = 'postgresql.auto.conf'
probackup_recovery_path = os.path.join(replica.data_dir, 'probackup_recovery.conf')
if os.path.exists(probackup_recovery_path):
if os.stat(probackup_recovery_path).st_size > 0:
config = 'probackup_recovery.conf'
if not log_shipping:
self.set_auto_conf(
@ -1547,6 +1543,7 @@ class ProbackupTest(object):
directory_dict['files'][file_relpath] = {'is_datafile': False}
with open(file_fullpath, 'rb') as f:
directory_dict['files'][file_relpath]['md5'] = hashlib.md5(f.read()).hexdigest()
f.close()
# directory_dict['files'][file_relpath]['md5'] = hashlib.md5(
# f = open(file_fullpath, 'rb').read()).hexdigest()