[PATCH] Check for multipath module before running multipath tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


From: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx>

Some systems do not ship the md multipath module. If not available
simply skip any multipath tests.

Signed-off-by: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx>
---
 test              |    6 ++++++
 tests/00multipath |    5 +++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/test b/test
index 2964b3b..67f05e5 100755
--- 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
diff --git a/tests/00multipath b/tests/00multipath
index bc0429f..1a80419 100644
--- a/tests/00multipath
+++ b/tests/00multipath
@@ -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
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ATA RAID]     [Linux SCSI Target Infrastructure]     [Managing RAID on Linux]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device-Mapper]     [Kernel]     [Linux Books]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Photos]     [Yosemite Photos]     [Yosemite News]     [AMD 64]     [Linux Networking]

Add to Google Powered by Linux