summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2011-08-25 17:03:22 +0100
committerLars Wirzenius <liw@liw.fi>2011-08-25 17:03:22 +0100
commitbb4a003a0d2946d05d495e840e6e66d6be3eda10 (patch)
tree3e2d70adc821836bc8d33c69d3ed7cf8f463b540
parentb3a10a1fa23da3b79cc2c4199e19a8538483a492 (diff)
downloadseivot-bb4a003a0d2946d05d495e840e6e66d6be3eda10.tar.gz
Verify restore results.
-rwxr-xr-xseivot14
1 files changed, 13 insertions, 1 deletions
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):