Skip to content

Commit 8f9ca4a

Browse files
committed
tests: windows support for test_restore_with_tablespace_mapping_1
1 parent c7dee40 commit 8f9ca4a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/restore_test.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,10 @@ def test_restore_with_tablespace_mapping_1(self):
840840
repr(e.message), self.cmd))
841841

842842
# 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)
844847
try:
845848
self.restore_node(backup_dir, 'node', node)
846849
# we should die here because exception is what we expect to happen
@@ -850,10 +853,9 @@ def test_restore_with_tablespace_mapping_1(self):
850853
"not empty.\n Output: {0} \n CMD: {1}".format(
851854
repr(self.output), self.cmd))
852855
except ProbackupException as e:
853-
self.assertEqual(
856+
self.assertIn(
857+
'ERROR: restore tablespace destination is not empty:',
854858
e.message,
855-
'ERROR: restore tablespace destination '
856-
'is not empty: "{0}"\n'.format(tblspc_path),
857859
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(
858860
repr(e.message), self.cmd))
859861

0 commit comments

Comments
 (0)