]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Add one sanity check for missing device
authorXiao Ni <xni@redhat.com>
Wed, 21 Feb 2018 05:04:45 +0000 (13:04 +0800)
committerJes Sorensen <jsorensen@fb.com>
Fri, 23 Feb 2018 16:10:00 +0000 (11:10 -0500)
Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
tests/00raid1
tests/func.sh

index c93465d83a29fb3d602bfb3e47e6a8ea261cf5cd..f6b8be19c8c30e1090625d10cabfe36297269fbf 100644 (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
index 40c6026af6fcd48be2a22215b9eb4f599f9b1aac..af08b60f2a5ec2ebb8fb10252d546cee286708b3 100644 (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 ] &&