Add one sanity check for missing device

Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
This commit is contained in:
Xiao Ni 2018-02-21 13:04:45 +08:00 committed by Jes Sorensen
parent 62f1aee7ad
commit 9c816fe2ad
2 changed files with 8 additions and 0 deletions

View File

@ -3,6 +3,10 @@
# test version0, version1, and no super
# test resync and recovery.
# It's just a sanity check. This command shouldn't run successfully
mdadm -CR $md0 -l 1 -n2 missing missing
check opposite_result
mdadm -CR $md0 -l 1 -n2 $dev0 $dev1
check resync
check raid1

View File

@ -219,6 +219,10 @@ do_setup() {
# check various things
check() {
case $1 in
opposite_result )
if [ $? -eq 0 ]; then
die "This command shouldn't run successfully"
fi
spares )
spares=$(tr '] ' '\012\012' < /proc/mdstat | grep -c '(S)' || exit 0)
[ $spares -ne $2 ] &&