Skip to content

Commit

Permalink
test: Adapt to change in mdadm bitmap default
Browse files Browse the repository at this point in the history
  • Loading branch information
mvollmer authored and martinpitt committed Jan 8, 2025
1 parent 8451301 commit 9f315de
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions test/verify/check-storage-mdraid
Original file line number Diff line number Diff line change
Expand Up @@ -358,16 +358,14 @@ class TestStorageMdRaid(storagelib.StorageCase):
self.wait_states({dev1: "In sync",
dev2: "In sync"})

# There should be a bitmap, and cockpit should not complain
if "Consistency Policy : bitmap" in m.execute("mdadm --misc -D /dev/md/md0"):
# Earlier versions of mdadm automatically add a bitmap for
# large arrays. Check that Cockpit doesn't complain and
# then remove the bitmap to provoke the alert.
b.wait_not_present('.pf-v5-c-alert:contains("This MDRAID device has no write-intent bitmap")')
m.execute("mdadm --grow --bitmap=none /dev/md/md0; udevadm trigger /dev/md/md0")

self.assertIn("Consistency Policy : bitmap", m.execute("mdadm --misc -D /dev/md/md0"))
b.wait_not_present('.pf-v5-c-alert:contains("This MDRAID device has no write-intent bitmap")')

# Remove the bitmap, Cockpit should complain and let us put it back.

m.execute("mdadm --grow --bitmap=none /dev/md/md0; udevadm trigger /dev/md/md0")
self.assertNotIn("bitmap", m.execute("mdadm --misc -D /dev/md/md0"))

b.wait_visible('.pf-v5-c-alert:contains("This MDRAID device has no write-intent bitmap")')
b.click('button:contains("Add a bitmap")')
b.wait_not_present('.pf-v5-c-alert:contains("This MDRAID device has no write-intent bitmap")')
Expand All @@ -390,7 +388,7 @@ class TestStorageMdRaid(storagelib.StorageCase):
dev3: "In sync",
dev4: "Unknown (journal)"})

# There should be no bitmap, and cockpit should not complain
# There should be no bitmap (regardless of mdadm version), and cockpit should not complain

self.assertNotIn("bitmap", m.execute("mdadm --misc -D /dev/md/md1"))
b.wait_not_present('.pf-v5-c-alert:contains("This MDRAID device has no write-intent bitmap")')
Expand Down

0 comments on commit 9f315de

Please sign in to comment.