Skip to content

Commit b3ac746

Browse files
committed
[Issue #146] Test update for backup note
1 parent 544f49a commit b3ac746

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

tests/backup.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2404,3 +2404,43 @@ def test_streaming_timeout(self):
24042404

24052405
# Clean after yourself
24062406
self.del_test_dir(module_name, fname)
2407+
2408+
2409+
def test_note(self):
2410+
2411+
fname = self.id().split('.')[3]
2412+
2413+
node = self.make_simple_node(
2414+
base_dir=os.path.join(module_name, fname, 'node'),
2415+
initdb_params=['--data-checksums'])
2416+
2417+
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
2418+
self.init_pb(backup_dir)
2419+
self.add_instance(backup_dir, 'node', node)
2420+
self.set_archiving(backup_dir, 'node', node)
2421+
node.slow_start()
2422+
2423+
# FULL backup
2424+
self.backup_node(backup_dir, 'node', node, options=['--stream', '--log-level-file=LOG', '--note=test_note'])
2425+
2426+
show_backups = self.show_pb(backup_dir, 'node')
2427+
# self.assertEqual(len(show_backups), 1)
2428+
# print(self.show_pb(backup_dir, as_text=True, as_json=True))
2429+
2430+
self.assertEqual(show_backups[0]['note'], "test_note")
2431+
2432+
2433+
# Clean after yourself
2434+
self.del_test_dir(module_name, fname)
2435+
2436+
2437+
2438+
2439+
2440+
2441+
2442+
2443+
2444+
2445+
2446+

0 commit comments

Comments
 (0)