@@ -32,15 +32,16 @@ def test_pgpro560_control_file_loss(self):
32
32
node .slow_start ()
33
33
34
34
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' ))
36
37
37
38
try :
38
39
self .backup_node (backup_dir , 'node' , node , options = ['--stream' ])
39
40
# we should die here because exception is what we expect to happen
40
41
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 ))
44
45
except ProbackupException as e :
45
46
self .assertTrue (
46
47
'ERROR: Could not open file' in e .message and
@@ -49,6 +50,8 @@ def test_pgpro560_control_file_loss(self):
49
50
repr (e .message ), self .cmd ))
50
51
51
52
# 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 )
52
55
self .del_test_dir (module_name , fname )
53
56
54
57
def test_pgpro560_systemid_mismatch (self ):
0 commit comments