From 41f8ded3e7c3cf200ca1f2e04b754a7ea10bc898 Mon Sep 17 00:00:00 2001 From: John Spray Date: Fri, 3 Mar 2017 12:24:41 +0000 Subject: [PATCH] qa: update TestDamage for PurgeQueue Signed-off-by: John Spray --- qa/tasks/cephfs/test_damage.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/qa/tasks/cephfs/test_damage.py b/qa/tasks/cephfs/test_damage.py index 3b98d2b829f2..380b49c4b658 100644 --- a/qa/tasks/cephfs/test_damage.py +++ b/qa/tasks/cephfs/test_damage.py @@ -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: -- 2.47.3