Skip to content

Commit

Permalink
PROPOSAL - don't try to predict what mdadm will do
Browse files Browse the repository at this point in the history
Just adapt to whatever it has done.
  • Loading branch information
mvollmer committed Jan 7, 2025
1 parent 6df17cc commit e2a3f51
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions test/verify/check-storage-mdraid
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,6 @@ class TestStorageMdRaid(storagelib.StorageCase):
m = self.machine
b = self.browser

mdadm_version_str = m.execute("mdadm --version 2>&1").strip().split(" - ")[1]
mdadm_version = list(map(int, mdadm_version_str.lstrip("v").split(".")))

self.login_and_go("/storage")

# Make three huge block devices, so that we can make an array
Expand All @@ -361,17 +358,13 @@ class TestStorageMdRaid(storagelib.StorageCase):
self.wait_states({dev1: "In sync",
dev2: "In sync"})

# With mdadm < 4.4, there should be a bitmap, and cockpit should not complain.
# (debian-testing has an intermediate version that needs special handling.)

if mdadm_version < [4, 4] and m.image not in ["debian-testing"]:
self.assertIn("Consistency Policy : bitmap", m.execute("mdadm --misc -D /dev/md/md0"))
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")

# With mdadm >= 4.4, there should be no bitmap. Cockpit should
# complain and let us add it.

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")')
Expand Down

0 comments on commit e2a3f51

Please sign in to comment.