1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2024-11-28 09:33:54 +02:00

[Issue #289] tests: added tests.backup.BackupTest.test_issue_289

This commit is contained in:
Grigory Smolkin 2021-01-20 15:40:18 +03:00
parent e7ffc15417
commit 4edc9d94ad

View File

@ -2859,6 +2859,57 @@ class BackupTest(ProbackupTest, unittest.TestCase):
# Clean after yourself
self.del_test_dir(module_name, fname)
# @unittest.skip("skip")
def test_issue_289(self):
"""
https://github.com/postgrespro/pg_probackup/issues/289
"""
fname = self.id().split('.')[3]
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),
initdb_params=['--data-checksums'])
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
self.init_pb(backup_dir)
self.add_instance(backup_dir, 'node', node)
# self.set_archiving(backup_dir, 'node', node)
# os.rmdir(
# os.path.join(backup_dir, "wal", "node"))
node.slow_start()
try:
self.backup_node(
backup_dir, 'node', node,
backup_type='page', options=['--archive-timeout=10s'])
# we should die here because exception is what we expect to happen
self.assertEqual(
1, 0,
"Expecting Error because full backup is missing"
"\n Output: {0} \n CMD: {1}".format(
repr(self.output), self.cmd))
except ProbackupException as e:
self.assertNotIn(
"INFO: Wait for WAL segment",
e.message,
"\n Unexpected Error Message: {0}\n CMD: {1}".format(
repr(e.message), self.cmd))
self.assertIn(
"ERROR: Create new full backup before an incremental one",
e.message,
"\n Unexpected Error Message: {0}\n CMD: {1}".format(
repr(e.message), self.cmd))
self.assertEqual(
self.show_pb(backup_dir, 'node')[0]['status'], "ERROR")
exit(1)
# Clean after yourself
self.del_test_dir(module_name, fname)
@unittest.skip("skip")
def test_issue_203(self):
"""