Skip to content

Commit 94fd54a

Browse files
committed
Fix test pgpro560.CheckSystemID.test_pgpro560_control_file_loss. File /global/pg_control doesn't removed permanently
1 parent e101bfd commit 94fd54a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/pgpro560.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,16 @@ def test_pgpro560_control_file_loss(self):
3232
node.slow_start()
3333

3434
file = os.path.join(node.base_dir, 'data', 'global', 'pg_control')
35-
os.remove(file)
35+
# Not delete this file permanently
36+
os.rename(file, os.path.join(node.base_dir, 'data', 'global', 'pg_control_copy'))
3637

3738
try:
3839
self.backup_node(backup_dir, 'node', node, options=['--stream'])
3940
# we should die here because exception is what we expect to happen
4041
self.assertEqual(
41-
1, 0,
42-
"Expecting Error because pg_control was deleted.\n "
43-
"Output: {0} \n CMD: {1}".format(repr(self.output), self.cmd))
42+
1, 0,
43+
"Expecting Error because pg_control was deleted.\n "
44+
"Output: {0} \n CMD: {1}".format(repr(self.output), self.cmd))
4445
except ProbackupException as e:
4546
self.assertTrue(
4647
'ERROR: Could not open file' in e.message and
@@ -49,6 +50,8 @@ def test_pgpro560_control_file_loss(self):
4950
repr(e.message), self.cmd))
5051

5152
# Clean after yourself
53+
# Return this file to avoid Postger fail
54+
os.rename(os.path.join(node.base_dir, 'data', 'global', 'pg_control_copy'), file)
5255
self.del_test_dir(module_name, fname)
5356

5457
def test_pgpro560_systemid_mismatch(self):

0 commit comments

Comments
 (0)