]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa: update TestDamage for PurgeQueue
authorJohn Spray <john.spray@redhat.com>
Fri, 3 Mar 2017 12:24:41 +0000 (12:24 +0000)
committerJohn Spray <john.spray@redhat.com>
Wed, 8 Mar 2017 10:27:03 +0000 (10:27 +0000)
Signed-off-by: John Spray <john.spray@redhat.com>
qa/tasks/cephfs/test_damage.py

index 3b98d2b829f223e8b08d9de99115142170c9e904..380b49c4b6584918a7bc70353f69ac8959ecde0f 100644 (file)
@@ -140,6 +140,8 @@ class TestDamage(CephFSTestCase):
                 "400.00000000",
                 # Missing dirfrags for non-system dirs result in empty directory
                 "10000000000.00000000",
+                # PurgeQueue is auto-created if not found on startup
+                "500.00000000"
             ]:
                 expectation = NO_DAMAGE
             else:
@@ -167,14 +169,21 @@ class TestDamage(CephFSTestCase):
         ])
 
         # Truncations
-        mutations.extend([
-            MetadataMutation(
-                o,
-                "Truncate {0}".format(o),
-                lambda o=o: self.fs.rados(["truncate", o, "0"]),
-                DAMAGED_ON_START
-            ) for o in data_objects
-        ])
+        for obj_id in data_objects:
+            if obj_id == "500.00000000":
+                # The PurgeQueue is allowed to be empty: Journaler interprets
+                # an empty header object as an empty journal.
+                expectation = NO_DAMAGE
+            else:
+                expectation = DAMAGED_ON_START
+
+            mutations.append(
+                MetadataMutation(
+                    o,
+                    "Truncate {0}".format(o),
+                    lambda o=o: self.fs.rados(["truncate", o, "0"]),
+                    DAMAGED_ON_START
+            ))
 
         # OMAP value corruptions
         for o, k in omap_keys: