From 9f315de4c063edd7a1485732308230554bb70fc4 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Tue, 7 Jan 2025 12:09:25 +0200 Subject: [PATCH] test: Adapt to change in mdadm bitmap default --- test/verify/check-storage-mdraid | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/test/verify/check-storage-mdraid b/test/verify/check-storage-mdraid index a6bc74a8be56..ca674127f18f 100755 --- a/test/verify/check-storage-mdraid +++ b/test/verify/check-storage-mdraid @@ -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")') @@ -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")')