Skip to content

Commit

Permalink
MDRAID: strict metadata check test case
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Mudrunka <tomas.mudrunka@gmail.com>
  • Loading branch information
Harvie committed Dec 26, 2024
1 parent 0197ea3 commit 6991d55
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ EXTRA_DIST += \
test/ext4test.2.dump \
test/f2fs.config \
test/mdraid.config \
test/mdraid.examine.txt \
test/btrfs.config \
test/fip.config \
test/fit.its \
Expand Down
26 changes: 26 additions & 0 deletions test/mdraid.examine.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
images/test.mdraid:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : f18099de:4904834e:84bd98e4:b1ca3fe3
Name : localhost:42
Creation Time : Wed Mar 21 12:23:42 1990
Raid Level : raid1
Raid Devices : 1

Avail Dev Size : 8192 sectors
Array Size : 4096 KiB
Data Offset : 2048 sectors
Super Offset : 8 sectors
Unused Space : before=1968 sectors, after=0 sectors
State : active
Device UUID : 7b103beb:9dae6b4c:994aec41:2d36959b

Update Time : Thu Jan 1 00:00:00 1970
Bad Block Log : 512 entries available at offset 16 sectors
Checksum : e05f720d - correct
Events : 0


Device Role : Active device 0
Array State : A ('A' == active, '.' == missing, 'R' == replacing)
8 changes: 5 additions & 3 deletions test/misc.test
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,11 @@ test_expect_success fiptool "fip" "
exec_test_set_prereq mdadm
test_expect_success mdadm "mdraid" "
run_genimage_root mdraid.config test.mdraid &&
mdadm --examine images/test.mdraid &&
mdadm --examine images/test.mdraid | grep 'Checksum.*correct$' &&
mdadm --examine images/test.mdraid | grep 'State.*active$'
pwd &&
LANG=C mdadm --examine images/test.mdraid | tee images/test.mdraid.examine.txt &&
grep 'Checksum.*correct$' images/test.mdraid.examine.txt &&
grep 'State.*active$' images/test.mdraid.examine.txt &&
diff images/test.mdraid.examine.txt ../$(dirname "${0}")/mdraid.examine.txt
"

test_done
Expand Down

0 comments on commit 6991d55

Please sign in to comment.