diff options
author | Lars Wirzenius <liw@liw.fi> | 2011-08-25 17:03:22 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2011-08-25 17:03:22 +0100 |
commit | bb4a003a0d2946d05d495e840e6e66d6be3eda10 (patch) | |
tree | 3e2d70adc821836bc8d33c69d3ed7cf8f463b540 | |
parent | b3a10a1fa23da3b79cc2c4199e19a8538483a492 (diff) | |
download | seivot-bb4a003a0d2946d05d495e840e6e66d6be3eda10.tar.gz |
Verify restore results.
-rwxr-xr-x | seivot | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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): |