Skip to content

Commit

Permalink
MDRAID: test case for inheritance
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Mudrunka <[email protected]>
  • Loading branch information
Harvie committed Dec 30, 2024
1 parent fd6215f commit 43a3588
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
9 changes: 8 additions & 1 deletion test/mdraid.config
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
image test.mdraid {
image test.mdraid-a {
mdraid {
level = 1
devices = 2
timestamp = 638022222
raid-uuid = "de9980f1-0449-4e83-84bd-98e4b1ca3fe3"
disk-uuid = "eb3b107b-ae9d-4c6b-994a-ec412d36959b"
}
size = 5M
}

image test.mdraid-b {
mdraid {
inherit = "test.mdraid-a"
}
}
16 changes: 10 additions & 6 deletions test/misc.test
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,16 @@ test_expect_success fiptool "fip" "

exec_test_set_prereq mdadm
test_expect_success mdadm "mdraid" "
run_genimage_root mdraid.config test.mdraid &&
LANG=C mdadm --examine images/test.mdraid | tee images/test.mdraid.txt &&
grep 'Checksum.*correct$' images/test.mdraid.txt &&
grep 'State.*active$' images/test.mdraid.txt &&
grep 'Internal Bitmap.*sectors' images/test.mdraid.txt &&
grep 'Bad Block Log.*entries available' images/test.mdraid.txt
run_genimage_root mdraid.config test.mdraid-a &&
LANG=C mdadm --examine images/test.mdraid-a | tee images/test.mdraid-a.txt &&
LANG=C mdadm --examine images/test.mdraid-b | tee images/test.mdraid-b.txt &&
grep 'Checksum.*correct$' images/test.mdraid-a.txt &&
grep 'State.*active$' images/test.mdraid-a.txt &&
grep 'Internal Bitmap.*sectors' images/test.mdraid-a.txt &&
grep 'Bad Block Log.*entries available' images/test.mdraid-a.txt &&
grep -Ev '(Device UUID|Checksum|Device Role) :' images/test.mdraid-a.txt | tail -n +2 > images/test.mdraid-a.arr.txt &&
grep -Ev '(Device UUID|Checksum|Device Role) :' images/test.mdraid-b.txt | tail -n +2 > images/test.mdraid-b.arr.txt &&
diff images/test.mdraid-a.arr.txt images/test.mdraid-b.arr.txt
"

test_done
Expand Down

0 comments on commit 43a3588

Please sign in to comment.