Michael Terry has proposed merging lp:~mterry/duplicity/resume-inc into 
lp:duplicity.

Requested reviews:
  duplicity-team (duplicity-team)

For more details, see:
https://code.launchpad.net/~mterry/duplicity/resume-inc/+merge/84655

I found a bug while running the deja-dup test suite.  If you are resuming an 
interrupted incremental backup, duplicity will first set the curtime and 
prevtime to be the same as the existing incremental.  But then it will reset 
the time to be current.  Which results in an error message later [1].  This 
branch fixes that and adds a test for it.

[1] A safety check I added to actually check for mismatches in encryption 
settings, but it caught this too, thankfully.  "Restarting backup, but current 
encryption settings do not match original settings"
-- 
https://code.launchpad.net/~mterry/duplicity/resume-inc/+merge/84655
Your team duplicity-team is requested to review the proposed merge of 
lp:~mterry/duplicity/resume-inc into lp:duplicity.
=== modified file 'bin/duplicity'
--- bin/duplicity	2011-11-25 17:47:57 +0000
+++ bin/duplicity	2011-12-06 19:14:26 +0000
@@ -551,11 +551,12 @@
     @rtype: void
     @return: void
     """
-    dup_time.setprevtime(sig_chain.end_time)
-    if dup_time.curtime == dup_time.prevtime:
-        time.sleep(2)
-        dup_time.setcurtime()
-        assert dup_time.curtime != dup_time.prevtime, "time not moving forward at appropriate pace - system clock issues?"
+    if not globals.restart:
+        dup_time.setprevtime(sig_chain.end_time)
+        if dup_time.curtime == dup_time.prevtime:
+            time.sleep(2)
+            dup_time.setcurtime()
+            assert dup_time.curtime != dup_time.prevtime, "time not moving forward at appropriate pace - system clock issues?"
     if globals.dry_run:
         tarblock_iter = diffdir.DirDelta(globals.select,
                                          sig_chain.get_fileobjs())

=== modified file 'testing/tests/restarttest.py'
--- testing/tests/restarttest.py	2011-11-07 15:08:24 +0000
+++ testing/tests/restarttest.py	2011-12-06 19:14:26 +0000
@@ -270,5 +270,25 @@
         # there should be 2 differences found, one missing file, one mtime change
         #self.verify("testfiles/largefiles")
 
+    def test_restart_incremental(self):
+        """
+        Test restarting an incremental backup
+        """
+        # Make first normal full backup
+        self.backup("full", "testfiles/dir1")
+        # create 3 2M files
+        assert not os.system("mkdir testfiles/largefiles")
+        for n in (1,2,3):
+            assert not os.system("dd if=/dev/urandom of=testfiles/largefiles/file%d bs=1024 count=2048 > /dev/null 2>&1" % n)
+        # Force a failure partway through
+        try:
+            self.backup("inc", "testfiles/largefiles", options = ["--vols 1", "--fail 2"])
+            assert False # shouldn't get this far
+        except CmdError, e:
+            pass
+        # Now finish that incremental
+        self.backup("inc", "testfiles/largefiles")
+        self.verify("testfiles/largefiles")
+
 if __name__ == "__main__":
     unittest.main()

_______________________________________________
Mailing list: https://launchpad.net/~duplicity-team
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~duplicity-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to