diff options
author | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2005-11-24 05:07:09 +0000 |
---|---|---|
committer | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2005-11-24 05:07:09 +0000 |
commit | 4f008bb4653629b2bec6d3202d413f7c02b0fcb0 (patch) | |
tree | c6d1821c6f01543a2e13903b8f38d1301a09743b /rdiff-backup/testing | |
parent | 75a31e34270bfbf735d31fea152675160493b900 (diff) | |
download | rdiff-backup-4f008bb4653629b2bec6d3202d413f7c02b0fcb0.tar.gz |
Remove older than overenthusiastic deletion fix
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@689 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/testing')
-rw-r--r-- | rdiff-backup/testing/finaltest.py | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/rdiff-backup/testing/finaltest.py b/rdiff-backup/testing/finaltest.py index 8fe04f1..6dc73f2 100644 --- a/rdiff-backup/testing/finaltest.py +++ b/rdiff-backup/testing/finaltest.py @@ -427,13 +427,34 @@ class FinalMisc(PathSetter): for inc in self.get_all_increments(rbdir): assert inc.getinctime() >= 30000 + def testRemoveOlderThanCurrent(self): + """Make sure --remove-older-than doesn't delete current incs""" + Myrm("testfiles/output") + assert not os.system('cp -a testfiles/restoretest3 testfiles/output') + self.set_connections(None, None, None, None) + self.exec_rb_extra_args(None, '--remove-older-than now --force', + 'testfiles/output') + rbdir = rpath.RPath(Globals.local_connection, + "testfiles/output/rdiff-backup-data") + + has_cur_mirror, has_metadata = 0, 0 + for inc in self.get_all_increments(rbdir): + if inc.getincbase().index[-1] == 'current_mirror': + has_cur_mirror = 1 + elif inc.getincbase().index[-1] == 'mirror_metadata': + has_metadata = 1 + assert has_cur_mirror and has_metadata, (has_cur_mirror, has_metadata) + def testRemoveOlderThanQuoting(self): """Test --remove-older-than when dest directory is quoted""" Myrm("testfiles/output") self.set_connections(None, None, None, None) - self.exec_rb_extra_args(None, "--override-chars-to-quote '^a-z0-9_ -.'", - "testfiles/increment1", "testfiles/output") - self.exec_rb_extra_args(None, "--remove-older-than now", "testfiles/output") + self.exec_rb_extra_args(None, "--override-chars-to-quote '^a-z0-9_ -.'" + " --current-time 10000", "testfiles/increment1", "testfiles/output") + self.exec_rb_extra_args(None, "--override-chars-to-quote '^a-z0-9_ -.'" + " --current-time 20000", "testfiles/increment2", "testfiles/output") + self.exec_rb_extra_args(None, "--remove-older-than now", + "testfiles/output") def testRemoveOlderThanRemote(self): """Test --remove-older-than remotely""" |