File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -840,7 +840,10 @@ def test_restore_with_tablespace_mapping_1(self):
840
840
repr (e .message ), self .cmd ))
841
841
842
842
# 2 - Try to restore to existing tablespace directory
843
- shutil .rmtree (node .data_dir , ignore_errors = True )
843
+ tblspc_path_tmp = os .path .join (node .base_dir , "tblspc_tmp" )
844
+ os .rename (tblspc_path , tblspc_path_tmp )
845
+ node .cleanup ()
846
+ os .rename (tblspc_path_tmp , tblspc_path )
844
847
try :
845
848
self .restore_node (backup_dir , 'node' , node )
846
849
# we should die here because exception is what we expect to happen
@@ -850,10 +853,9 @@ def test_restore_with_tablespace_mapping_1(self):
850
853
"not empty.\n Output: {0} \n CMD: {1}" .format (
851
854
repr (self .output ), self .cmd ))
852
855
except ProbackupException as e :
853
- self .assertEqual (
856
+ self .assertIn (
857
+ 'ERROR: restore tablespace destination is not empty:' ,
854
858
e .message ,
855
- 'ERROR: restore tablespace destination '
856
- 'is not empty: "{0}"\n ' .format (tblspc_path ),
857
859
'\n Unexpected Error Message: {0}\n CMD: {1}' .format (
858
860
repr (e .message ), self .cmd ))
859
861
You can’t perform that action at this time.
0 commit comments