adjust post-conditions for GZ[,AES]/rescue unit test
authorPhilipp Gesang <philipp.gesang@intra2net.com>
Mon, 28 Aug 2017 07:45:44 +0000 (09:45 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 2 Apr 2018 11:34:09 +0000 (13:34 +0200)
testing/test_recover.py

index 7c26504..cd48a00 100644 (file)
@@ -454,9 +454,6 @@ class RescueTest (DefectiveTest):
         # but recover will succeed
         failed = dtar.rescue_backup(target_path=self.dst_path,
                                     backup_tar_path=backup_full)
-
-        assert len (failed) == self.FAILURES
-
         # with one file missing
         missing  = []
         mismatch = []
@@ -468,6 +465,7 @@ class RescueTest (DefectiveTest):
             else:
                 missing.append (key)
 
+        assert len (failed)   == self.FAILURES
         assert len (missing)  == (self.MISSING if self.MISSING is not None
                                                else self.FAILURES)
         assert len (mismatch) == self.MISMATCHES
@@ -740,24 +738,28 @@ class RescueCorruptHoleBaseTest (RescueTest):
     """
     COMPRESSION = None
     PASSWORD    = None
-    FAILURES    = 3
+    FAILURES    = 0
     CORRUPT     = corrupt_hole
     VOLUMES     = 2 # request two vols to swell up the first one
-    MISMATCHES  = 1
+    MISMATCHES  = 2 # intersected by hole
+    MISSING     = 1 # excised by hole
 
 class RescueCorruptHoleTest (RescueCorruptHoleBaseTest):
-    FAILURES    = 0
-    MISMATCHES  = 1 # intersected by hole
-    MISSING     = 1 # excised by hole
+    pass
 
 class RescueCorruptHoleGZTest (RescueCorruptHoleBaseTest):
     COMPRESSION = "#gz"
-    MISSING     = 2
+    # the decompressor explodes in our face processing the first dummy, nothing
+    # we can do to recover
+    FAILURES    = 1
 
 class RescueCorruptHoleGZAESTest (RescueCorruptHoleBaseTest):
     COMPRESSION = "#gz"
     PASSWORD    = TEST_PASSWORD
-    MISSING     = 2
+    # again, ignoring the crypto errors yields a bad zlib stream causing the
+    # decompressor to abort where the hole begins; the file is extracted up
+    # to this point though
+    FAILURES    = 1
 
 ###############################################################################
 # index