From 79bc14cf380f9bbd444875fa01498ce834d78459 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 28 Aug 2017 09:45:44 +0200 Subject: [PATCH] adjust post-conditions for GZ[,AES]/rescue unit test --- testing/test_recover.py | 22 ++++++++++++---------- 1 files changed, 12 insertions(+), 10 deletions(-) diff --git a/testing/test_recover.py b/testing/test_recover.py index 7c26504..cd48a00 100644 --- a/testing/test_recover.py +++ b/testing/test_recover.py @@ -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 -- 1.7.1