]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
test: add --disable-integrity switch.
authorNeilBrown <neilb@suse.de>
Wed, 31 Oct 2012 06:02:35 +0000 (17:02 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 20 Nov 2012 01:08:03 +0000 (12:08 +1100)
The integrity tests are very slow and aren't always needed.
So make them optional.

Signed-off-by: NeilBrown <neilb@suse.de>
test
tests/01r5integ
tests/01raid6integ

diff --git a/test b/test
index 3f8515fe17e14fdc51cf1d22fb73621d34f8a535..24704548d26716c3a6befe127ead07ce8c8effb3 100755 (executable)
--- a/test
+++ b/test
@@ -26,6 +26,7 @@ modprobe multipath 2> /dev/null
 if grep -s 'Personalities : .*multipath' > /dev/null /proc/mdstat ; then
     MULTIPATH="yes"
 fi
+INTEGRITY=yes
 
 # assume md0, md1, md2 exist in /dev
 md0=/dev/md0 md1=/dev/md1 md2=/dev/md2
@@ -254,6 +255,7 @@ do_help() {
   echo " Options:"
   echo "    --tests=<test1,test2,..>    Comma separated list of tests to run"
   echo "    --disable-multipath         Disable any tests involving multipath"
+  echo "    --disable-integrity         Disable slow tests of RAID[56] consistency"
   echo "    --logdir=<directory>        Directory to save logfiles in"
   echo "    --save-logs                 Save all logs in <logdir>"
   echo "    --keep-going                Don't stop on error, ie. run all tests"
@@ -299,6 +301,9 @@ parse_args() {
     --disable-multipath)
       unset MULTIPATH
       ;;
+    --disable-integrity)
+      unset INTEGRITY
+      ;;
     --help)
       do_help
       exit 0;
index 97a71f34aefadd3b1a6fe3c98b2fd1c93013c031..759acd7da803a5346cf36b13443e6fd1bf5880de 100644 (file)
@@ -3,6 +3,11 @@
 # Create a 4 disk raid5, create a filesystem and
 # sha1sum it with each device failed
 
+if [ "$INTEGRITY" != "yes" ]; then
+  echo -ne 'skipping... '
+  exit 0
+fi
+
 for layout in ls rs la ra
 do
   mdadm -CR $md0 -l5 --layout $layout -n4 $dev0 $dev1 $dev2 $dev3
index 7123e2b804d99be8f39b12918634df9136ceb142..d4ef2fd88b6472dd553d8228e2072f61114654cb 100644 (file)
@@ -3,6 +3,11 @@
 # Create a 5 disk raid6, dump some data to it, then
 # sha1sum it with different pairs of devices failed
 
+if [ "$INTEGRITY" != "yes" ]; then
+  echo -ne 'skipping... '
+  exit 0
+fi
+
 layouts='ls rs la ra'
 lv=`uname -r`
 if expr $lv '>=' 2.6.30 > /dev/null