Skip to content

Commit cda8fff

Browse files
dancesWithMachinesmtkaczyk
authored andcommitted
tests: fix 07autoassemble
Block device check in testdev() is not sufficient as it does not account for symlinks. Fix the check to use lsblk instead. Add mdstat check for better debugging TC and change md0 for md127 as that will be array name after assembly. Signed-off-by: Mateusz Kusiak <[email protected]>
1 parent 2b3f671 commit cda8fff

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

tests/07autoassemble

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ mdadm -CR $md2 -l1 -n2 $dev2 $dev3
4545
mdadm -CR $md0 -l0 -n2 $md1 $md2
4646
mdadm -Ss
4747
mdadm -As -c /dev/null
48+
cat /proc/mdstat # For logs
4849
if [ $is_foreign == "yes" ]; then
4950
# md127 is md1
5051
testdev $md127 1 $mdsize1a 64
@@ -55,6 +56,6 @@ if [ $is_foreign == "yes" ]; then
5556
else
5657
testdev $md1 1 $mdsize1a 64
5758
testdev $md2 1 $mdsize1a 64
58-
testdev $md0 2 $mdsize11a 512
59+
testdev $md127 2 $mdsize11a 512
5960
fi
6061
mdadm -Ss

tests/func.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ no_errors() {
445445

446446
# basic device test
447447
testdev() {
448-
[ -b $1 ] || die "$1 isn't a block device."
448+
lsblk -no name $1 || die "$1 isn't a block device."
449449
[ "$DEVTYPE" == "disk" ] && return 0
450450
udevadm settle
451451
dev=$1

0 commit comments

Comments
 (0)