linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/1] test suite - check for multipath available before running multipath tests
@ 2012-05-14 20:26 Jes.Sorensen
  2012-05-14 20:27 ` [PATCH v2 1/1] Check for multipath module " Jes.Sorensen
  0 siblings, 1 reply; 2+ messages in thread
From: Jes.Sorensen @ 2012-05-14 20:26 UTC (permalink / raw)
  To: neilb; +Cc: dledford, linux-raid

From: Jes Sorensen <Jes.Sorensen@redhat.com>

Hi,

Ok this one actually does the right thing and works for me on systems
where multipath is present.

Cheers,
Jes

Jes Sorensen (1):
  Check for multipath module before running multipath tests

 test              |    6 ++++++
 tests/00multipath |    5 +++++
 2 files changed, 11 insertions(+), 0 deletions(-)

-- 
1.7.7.6


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH v2 1/1] Check for multipath module before running multipath tests
  2012-05-14 20:26 [PATCH v2 0/1] test suite - check for multipath available before running multipath tests Jes.Sorensen
@ 2012-05-14 20:27 ` Jes.Sorensen
  0 siblings, 0 replies; 2+ messages in thread
From: Jes.Sorensen @ 2012-05-14 20:27 UTC (permalink / raw)
  To: neilb; +Cc: dledford, linux-raid

From: Jes Sorensen <Jes.Sorensen@redhat.com>

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>
---
 test              |    6 ++++++
 tests/00multipath |    5 +++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/test b/test
index 2964b3b..735324f 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..84e4d69 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.7.6


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-05-14 20:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-14 20:26 [PATCH v2 0/1] test suite - check for multipath available before running multipath tests Jes.Sorensen
2012-05-14 20:27 ` [PATCH v2 1/1] Check for multipath module " Jes.Sorensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).