Skip to content

Commit 8ec995b

Browse files
committed
tests: fixes for #280
1 parent 4e44502 commit 8ec995b

File tree

3 files changed

+14
-17
lines changed

3 files changed

+14
-17
lines changed

tests/backup.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@ def test_basic_tablespace_handling(self):
973973
self.add_instance(backup_dir, 'node', node)
974974
node.slow_start()
975975

976-
self.backup_node(
976+
backup_id = self.backup_node(
977977
backup_dir, 'node', node, backup_type="full",
978978
options=["-j", "4", "--stream"])
979979

@@ -1028,9 +1028,10 @@ def test_basic_tablespace_handling(self):
10281028
"\n Output: {0} \n CMD: {1}".format(
10291029
repr(self.output), self.cmd))
10301030
except ProbackupException as e:
1031-
self.assertTrue(
1032-
'ERROR: --tablespace-mapping option' in e.message and
1033-
'have an entry in tablespace_map file' in e.message,
1031+
self.assertIn(
1032+
'ERROR: Backup {0} has no tablespaceses, '
1033+
'nothing to remap'.format(backup_id),
1034+
e.message,
10341035
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(
10351036
repr(e.message), self.cmd))
10361037

@@ -1144,7 +1145,7 @@ def test_tablespace_handling_2(self):
11441145
tblspace1_old_path = self.get_tblspace_path(node, 'tblspace1_old')
11451146
tblspace_new_path = self.get_tblspace_path(node, 'tblspace_new')
11461147

1147-
self.backup_node(
1148+
backup_id = self.backup_node(
11481149
backup_dir, 'node', node, backup_type="full",
11491150
options=["-j", "4", "--stream"])
11501151

@@ -1166,9 +1167,9 @@ def test_tablespace_handling_2(self):
11661167
"\n Output: {0} \n CMD: {1}".format(
11671168
repr(self.output), self.cmd))
11681169
except ProbackupException as e:
1169-
self.assertTrue(
1170-
'ERROR: --tablespace-mapping option' in e.message and
1171-
'have an entry in tablespace_map file' in e.message,
1170+
self.assertIn(
1171+
'ERROR: Backup {0} has no tablespaceses, '
1172+
'nothing to remap'.format(backup_id), e.message,
11721173
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(
11731174
repr(e.message), self.cmd))
11741175

tests/incr_restore.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ def test_incr_restore_with_tablespace_4(self):
460460
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(
461461
repr(e.message), self.cmd))
462462
self.assertIn(
463-
'ERROR: Incremental restore is impossible',
463+
'ERROR: Incremental restore is not allowed',
464464
e.message,
465465
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(
466466
repr(e.message), self.cmd))
@@ -692,7 +692,7 @@ def test_basic_incr_restore_sanity(self):
692692
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(
693693
repr(e.message), self.cmd))
694694
self.assertIn(
695-
'ERROR: Incremental restore is impossible',
695+
'ERROR: Incremental restore is not allowed',
696696
e.message,
697697
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(
698698
repr(e.message), self.cmd))
@@ -717,7 +717,7 @@ def test_basic_incr_restore_sanity(self):
717717
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(
718718
repr(e.message), self.cmd))
719719
self.assertIn(
720-
'ERROR: Incremental restore is impossible',
720+
'ERROR: Incremental restore is not allowed',
721721
e.message,
722722
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(
723723
repr(e.message), self.cmd))

tests/restore.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ def test_restore_with_tablespace_mapping_1(self):
868868
repr(self.output), self.cmd))
869869
except ProbackupException as e:
870870
self.assertIn(
871-
'ERROR: restore tablespace destination is not empty:',
871+
'ERROR: Restore tablespace destination is not empty:',
872872
e.message,
873873
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(
874874
repr(e.message), self.cmd))
@@ -891,7 +891,7 @@ def test_restore_with_tablespace_mapping_1(self):
891891
repr(self.output), self.cmd))
892892
except ProbackupException as e:
893893
self.assertIn(
894-
'ERROR: restore tablespace destination is not empty:',
894+
'ERROR: Restore tablespace destination is not empty:',
895895
e.message,
896896
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(
897897
repr(e.message), self.cmd))
@@ -1109,10 +1109,6 @@ def test_restore_with_missing_or_corrupted_tablespace_map(self):
11091109

11101110
with open(tablespace_map, "a") as f:
11111111
f.write("HELLO\n")
1112-
1113-
print(tablespace_map)
1114-
1115-
exit(1)
11161112

11171113
try:
11181114
self.restore_node(

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy