From fee21be49009a572269599b7a313451087e09844 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 25 Aug 2011 16:51:24 +0100 Subject: Add --verify option (does not yet work). --- seivot | 2 ++ 1 file changed, 2 insertions(+) diff --git a/seivot b/seivot index 75c151d..ce0ec8f 100755 --- a/seivot +++ b/seivot @@ -370,6 +370,8 @@ class Seivot(cliapp.Application): 'access backup repository over the ' 'network via sftp') + self.settings.boolean(['verify'], 'verifyt restored data') + def process_args(self, args): progname = self.settings['program'] logging.info('Benchmarking: %s' % progname) -- cgit v1.2.1 From b3a10a1fa23da3b79cc2c4199e19a8538483a492 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 25 Aug 2011 16:56:32 +0100 Subject: Run summain before each backup. --- seivot | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/seivot b/seivot index ce0ec8f..7cb28c5 100755 --- a/seivot +++ b/seivot @@ -408,11 +408,15 @@ class Seivot(cliapp.Application): else: amount = self.settings['initial-data'] self.generate_live_data(self.live_data, amount) + if self.settings['verify']: + self.summain(self.live_data, 'backup-0.summain') self.measure(prog.backup, 0, amount) for i in range(1, generations): self.generate_live_data(self.live_data, self.settings['incremental-data']) + if self.settings['verify']: + self.summain(self.live_data, 'backup-%d.summain' % i) self.measure(prog.backup, i, self.settings['incremental-data']) for i in range(generations): @@ -438,6 +442,17 @@ class Seivot(cliapp.Application): runcmd(['genbackupdata', where, '--create', str(size), '--file-size', str(self.settings['file-size'])]) + def summain(self, dirname, basename): + '''Remember state of dirname at this time. + + This runs the summain(1) utility against dirname and stores + the result in a file called basename in the temporary directory. + + ''' + + self.runcmd(['summain', '--relative', '--output', + os.path.join(self.tempdir, basename), dirname]) + def file_sizes(self, dirname): bytes = 0 for dirname, subdirs, basenames in os.walk(dirname): -- cgit v1.2.1 From bb4a003a0d2946d05d495e840e6e66d6be3eda10 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 25 Aug 2011 17:03:22 +0100 Subject: Verify restore results. --- seivot | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/seivot b/seivot index 7cb28c5..14a7ca8 100755 --- a/seivot +++ b/seivot @@ -426,6 +426,7 @@ class Seivot(cliapp.Application): target_dir = os.path.join(self.tempdir, 'restored') os.mkdir(target_dir) self.measure(prog.restore, i, 0, target_dir=target_dir) + self.verify(target_dir, i) shutil.rmtree(target_dir) for i in range(generations): @@ -450,9 +451,20 @@ class Seivot(cliapp.Application): ''' - self.runcmd(['summain', '--relative', '--output', + # We exclude mtime from summain output, because there are very + # small time differences that I choose to ignore at this time. + self.runcmd(['summain', '--relative', '--exclude=mtime', '--output', os.path.join(self.tempdir, basename), dirname]) + def verify(self, dirname, generation): + '''Verify that the generation was restored correctly.''' + + root = os.path.join(dirname, './' + self.live_data) + self.summain(root, 'restored-%d.summain' % generation) + orig = os.path.join(self.tempdir, 'backup-%d.summain' % generation) + rest = os.path.join(self.tempdir, 'restored-%d.summain' % generation) + self.runcmd(['diff', '-u', orig, rest]) + def file_sizes(self, dirname): bytes = 0 for dirname, subdirs, basenames in os.walk(dirname): -- cgit v1.2.1 From 82c99262acddfb8eae4ac54257d232262fe5d18a Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 25 Aug 2011 17:05:13 +0100 Subject: Update NEWS file with new feature. --- NEWS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS b/NEWS index a864ba1..673bd7b 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,10 @@ NEWS for seivot, a backup benchmarking program Version 1.13, released UNRELEASED --------------------------------- +* `seivot` can now optionally verify that data is restored correctly: + see the `--verify` option. This is slow-ish, so it's not enabled + by default. You need the `summain` program installed for this + feature. * `seivots-summary` now has a manual page. Version 1.12, released 2011-08-24 -- cgit v1.2.1 From 1db2f64f5b93ca0f5c31228fa28d6c3dece4070c Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 25 Aug 2011 17:06:23 +0100 Subject: Suggest summain package in Debian packaging. --- debian/changelog | 7 +++++++ debian/control | 1 + 2 files changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index 768bd16..fdf563c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +seivot (1.13-1) unstable; urgency=low + + * New upstream release. + * Suggest summain, for the --verify option. + + -- Lars Wirzenius Thu, 25 Aug 2011 17:05:48 +0100 + seivot (1.12-1) unstable; urgency=low * New upstream release. diff --git a/debian/control b/debian/control index 2da51cb..35306a2 100644 --- a/debian/control +++ b/debian/control @@ -12,6 +12,7 @@ Package: seivot Architecture: all Depends: ${shlibs:Depends}, ${python:Depends}, ${misc:Depends}, python-cliapp (>= 0.15) +Suggests: summain Description: benchmark program for backup software seivot generates synthetic test data and backs it up using the desired backup tool. It then modifies the test data, and makes -- cgit v1.2.1