Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3b9d6c4

Browse files
committed
tests: added remote.RemoteTest.test_remote_sanity
1 parent 2fd3457 commit 3b9d6c4

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

tests/remote.py

+17-19
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class RemoteTest(ProbackupTest, unittest.TestCase):
1212

1313
# @unittest.skip("skip")
1414
# @unittest.expectedFailure
15-
def test_remote_1(self):
15+
def test_remote_sanity(self):
1616
fname = self.id().split('.')[3]
1717
node = self.make_simple_node(
1818
base_dir=os.path.join(module_name, fname, 'node'),
@@ -21,26 +21,24 @@ def test_remote_1(self):
2121
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
2222
self.init_pb(backup_dir)
2323
self.add_instance(backup_dir, 'node', node)
24-
# self.set_archiving(backup_dir, 'node', node, remote=True)
2524
node.slow_start()
2625

27-
self.backup_node(
28-
backup_dir, 'node', node,
29-
options=['--remote-proto=ssh', '--remote-host=localhost', '--stream'])
30-
31-
pgdata = self.pgdata_content(node.data_dir)
32-
33-
node.cleanup()
34-
35-
self.restore_node(
36-
backup_dir, 'node', node,
37-
options=[
38-
'--remote-proto=ssh',
39-
'--remote-host=localhost'])
40-
41-
# Physical comparison
42-
pgdata_restored = self.pgdata_content(node.data_dir)
43-
self.compare_pgdata(pgdata, pgdata_restored)
26+
try:
27+
self.backup_node(
28+
backup_dir, 'node',
29+
node, options=['--remote-proto=ssh', '--stream'])
30+
# we should die here because exception is what we expect to happen
31+
self.assertEqual(
32+
1, 0,
33+
"Expecting Error because remote-host option is missing."
34+
"\n Output: {0} \n CMD: {1}".format(
35+
repr(self.output), self.cmd))
36+
except ProbackupException as e:
37+
self.assertIn(
38+
"Insert correct error",
39+
e.message,
40+
"\n Unexpected Error Message: {0}\n CMD: {1}".format(
41+
repr(e.message), self.cmd))
4442

4543
# Clean after yourself
4644
self.del_test_dir(module_name, fname)

0 commit comments

Comments
 (0)