mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2024-11-24 08:52:38 +02:00
Add check parent backup.
This commit is contained in:
parent
42a4d72175
commit
9d17c122fb
@ -31,6 +31,7 @@ class BackupTest(ProbackupTest, unittest.TestCase):
|
||||
backup_log.write(self.backup_pb(node, options=["--verbose"]))
|
||||
|
||||
show_backup = self.show_pb(node)[0]
|
||||
full_backup_id = show_backup.id
|
||||
self.assertEqual(show_backup.status, six.b("OK"))
|
||||
self.assertEqual(show_backup.mode, six.b("FULL"))
|
||||
|
||||
@ -42,6 +43,12 @@ class BackupTest(ProbackupTest, unittest.TestCase):
|
||||
self.assertEqual(show_backup.status, six.b("OK"))
|
||||
self.assertEqual(show_backup.mode, six.b("PAGE"))
|
||||
|
||||
# Check parent backup
|
||||
self.assertEqual(
|
||||
full_backup_id,
|
||||
self.show_pb(node, show_backup.id)[six.b("PARENT_BACKUP")].strip(six.b(" '"))
|
||||
)
|
||||
|
||||
# ptrack backup mode
|
||||
if len(is_ptrack):
|
||||
with open(path.join(node.logs_dir, "backup_ptrack.log"), "wb") as backup_log:
|
||||
|
@ -151,8 +151,14 @@ class ProbackupTest(object):
|
||||
# print(cmd_list)
|
||||
if as_text:
|
||||
return self.run_pb(options + cmd_list)
|
||||
else:
|
||||
elif id is None:
|
||||
return [ShowBackup(line.split()) for line in self.run_pb(options + cmd_list).splitlines()[3:]]
|
||||
else:
|
||||
return dict([
|
||||
line.split(six.b("="))
|
||||
for line in self.run_pb(options + cmd_list).splitlines()
|
||||
if line[0] != six.b("#")[0]
|
||||
])
|
||||
|
||||
def validate_pb(self, node, id, options=[]):
|
||||
cmd_list = [
|
||||
|
Loading…
Reference in New Issue
Block a user