@@ -77,7 +77,7 @@ def test_validate_wal_unreal_values(self):
7777self .assertEqual (1 ,0 ,"Expecting Error because of validation to unreal time.\n Output: {0}\n CMD: {1}" .format (
7878repr (self .output ),self .cmd ))
7979except ProbackupException ,e :
80- self .assertTrue (re . match ( 'WARNING: recovery can be done up to time [0-9-: ]+ and xid \d+ \n ERROR: not enough WAL records to time {0} \n \Z' . format ( unreal_time_2 ), e .message ) ,
80+ self .assertTrue ('ERROR: not enough WAL records to time' in e .message ,
8181'\n Unexpected Error Message: {0}\n CMD: {1}' .format (repr (e .message ),self .cmd ))
8282
8383# Validate to real xid
@@ -98,7 +98,7 @@ def test_validate_wal_unreal_values(self):
9898self .assertEqual (1 ,0 ,"Expecting Error because of validation to unreal xid.\n Output: {0}\n CMD: {1}" .format (
9999repr (self .output ),self .cmd ))
100100except ProbackupException ,e :
101- self .assertTrue (re . match ( 'WARNING: recovery can be done up to time [0-9-: ]+ and xid \d+ \n ERROR: not enough WAL records to xid \d+ \n \Z' , e .message ) ,
101+ self .assertTrue ('ERROR: not enough WAL records to xid' in e .message ,
102102'\n Unexpected Error Message: {0}\n CMD: {1}' .format (repr (e .message ),self .cmd ))
103103
104104# Validate with backup ID
@@ -135,8 +135,8 @@ def test_validate_corrupt_wal_1(self):
135135wals .sort ()
136136for wal in wals :
137137f = open (os .path .join (wals_dir ,wal ),"rb+" )
138- f .seek (256 )
139- f .write (six .b ("blablabla " ))
138+ f .seek (42 )
139+ f .write (six .b ("blablablaadssaaaaaaaaaaaaaaa " ))
140140f .close
141141
142142# Simple validate
@@ -145,9 +145,8 @@ def test_validate_corrupt_wal_1(self):
145145self .assertEqual (1 ,0 ,"Expecting Error because of wal segments corruption.\n Output: {0}\n CMD: {1}" .format (
146146repr (self .output ),self .cmd ))
147147except ProbackupException ,e :
148- #TODO assert correct error message
149- self .assertTrue (re .match ('Possible WAL CORRUPTION\Z' ,e .message ),
150- '\n Unexpected Error Message: {0}\n CMD: {1}' .format (repr (e .message ),self .cmd ))
148+ self .assertTrue ('Possible WAL CORRUPTION' in e .message ),
149+ '\n Unexpected Error Message: {0}\n CMD: {1}' .format (repr (e .message ),self .cmd )
151150
152151self .assertEqual ('CORRUPT' ,self .show_pb (node ,id = backup_id )['status' ],'Backup STATUS should be "CORRUPT"' )
153152node .stop ()
@@ -188,7 +187,7 @@ def test_validate_corrupt_wal_2(self):
188187wals .sort ()
189188for wal in wals :
190189f = open (os .path .join (wals_dir ,wal ),"rb+" )
191- f .seek (256 )
190+ f .seek (0 )
192191f .write (six .b ("blablabla" ))
193192f .close
194193
@@ -198,9 +197,8 @@ def test_validate_corrupt_wal_2(self):
198197self .assertEqual (1 ,0 ,"Expecting Error because of wal segments corruption.\n Output: {0}\n CMD: {1}" .format (
199198repr (self .output ),self .cmd ))
200199except ProbackupException ,e :
201- #TODO assert correct error message
202- self .assertTrue (re .match ('Possible WAL CORRUPTION\Z' ,e .message ),
203- '\n Unexpected Error Message: {0}\n CMD: {1}' .format (repr (e .message ),self .cmd ))
200+ self .assertTrue ('Possible WAL CORRUPTION' in e .message ),
201+ '\n Unexpected Error Message: {0}\n CMD: {1}' .format (repr (e .message ),self .cmd )
204202
205203self .assertEqual ('CORRUPT' ,self .show_pb (node ,id = backup_id )['status' ],'Backup STATUS should be "CORRUPT"' )
206204node .stop ()