Skip to content

Commit

Permalink
qa: update TestDamage for PurgeQueue
Browse files Browse the repository at this point in the history
Signed-off-by: John Spray <john.spray@redhat.com>
  • Loading branch information
John Spray committed Mar 3, 2017
1 parent c9da158 commit 6f807c6
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions qa/tasks/cephfs/test_damage.py
Expand Up @@ -140,6 +140,8 @@ def __hash__(self):
"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:
Expand Down Expand Up @@ -167,14 +169,21 @@ def __hash__(self):
])

# 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:
Expand Down

0 comments on commit 6f807c6

Please sign in to comment.