]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Check for multipath module before running multipath tests
authorJes Sorensen <Jes.Sorensen@redhat.com>
Tue, 22 May 2012 16:55:29 +0000 (18:55 +0200)
committerNeilBrown <neilb@suse.de>
Wed, 23 May 2012 03:25:44 +0000 (13:25 +1000)
Some systems do not ship the md multipath module. If not available
simply skip any multipath tests.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
test
tests/00multipath

diff --git a/test b/test
index 4f0979eb4d94afbeb163a8337e9f7dab8142499c..0679983e7ddab76d52e86d38e5f904336516f980 100755 (executable)
--- a/test
+++ b/test
@@ -19,6 +19,12 @@ then
    echo >&2 "test: $mdadm isn't usable."
 fi
 
+# Check whether to run multipath tests
+modprobe multipath 2> /dev/null
+if grep -s 'Personalities : .*multipath' > /dev/null /proc/mdstat ; then
+    MULTIPATH="yes"
+fi
+
 # assume md0, md1, md2 exist in /dev
 md0=/dev/md0 md1=/dev/md1 md2=/dev/md2
 mdp0=/dev/md_d0
index bc0429f4d8ed07861effbba6b17aff4b566d0208..84e4d693b4603e0927227f23c607b977420f297f 100644 (file)
@@ -2,6 +2,11 @@
 #
 # create a multipath, and fail and stuff
 
+if [ "$MULTIPATH" != "yes" ]; then
+  echo -ne 'skipping... '
+  exit 0
+fi
+
 mdadm -CR $md1 -l multipath -n2 $path0 $path1
 
 testdev $md1 1 $mdsize12 1