summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/test/suite/test_backup10.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/test/suite/test_backup10.py')
-rw-r--r--src/third_party/wiredtiger/test/suite/test_backup10.py32
1 files changed, 4 insertions, 28 deletions
diff --git a/src/third_party/wiredtiger/test/suite/test_backup10.py b/src/third_party/wiredtiger/test/suite/test_backup10.py
index 9a74e190b3f..68a14307407 100644
--- a/src/third_party/wiredtiger/test/suite/test_backup10.py
+++ b/src/third_party/wiredtiger/test/suite/test_backup10.py
@@ -73,37 +73,14 @@ class test_backup10(backup_base):
self.add_data(self.uri, 'key', 'value')
self.session.log_flush('sync=on')
- # Now copy the files returned by the backup cursor.
- orig_logs = []
- while True:
- ret = bkup_c.next()
- if ret != 0:
- break
- newfile = bkup_c.get_key()
- sz = os.path.getsize(newfile)
- self.pr('Copy from: ' + newfile + ' (' + str(sz) + ') to ' + self.dir)
- shutil.copy(newfile, self.dir)
- if "WiredTigerLog" in newfile:
- orig_logs.append(newfile)
- self.assertEqual(ret, wiredtiger.WT_NOTFOUND)
+ # Now make a full backup and track the log files.
+ all_files = self.take_full_backup(self.dir, bkup_c)
+ orig_logs = [file for file in all_files if "WiredTigerLog" in file]
# Now open a duplicate backup cursor.
config = 'target=("log:")'
dupc = self.session.open_cursor(None, bkup_c, config)
- dup_logs = []
- while True:
- ret = dupc.next()
- if ret != 0:
- break
- newfile = dupc.get_key()
- self.assertTrue("WiredTigerLog" in newfile)
- sz = os.path.getsize(newfile)
- if (newfile not in orig_logs):
- self.pr('DUP: Copy from: ' + newfile + ' (' + str(sz) + ') to ' + self.dir)
- shutil.copy(newfile, self.dir)
- # Record all log files returned for later verification.
- dup_logs.append(newfile)
- self.assertEqual(ret, wiredtiger.WT_NOTFOUND)
+ dup_logs = self.take_log_backup(bkup_c, self.dir, orig_logs, dupc)
# We expect that the duplicate logs are a superset of the
# original logs. And we expect the difference to be the
@@ -129,7 +106,6 @@ class test_backup10(backup_base):
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
lambda:self.assertEquals(self.session.open_cursor(None,
dupc, config), 0), msg)
-
dupc.close()
# Test we must use the log target.