]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - test
mdmon: clear safe_mode_delay on shutdown
[thirdparty/mdadm.git] / test
diff --git a/test b/test
index 76d410f68d701b7902966ce68adff14bd41924a5..9e140f0abc269d52618c7e80c0afec23c2d99767 100755 (executable)
--- a/test
+++ b/test
@@ -64,7 +64,7 @@ config=/tmp/mdadm.conf
 cleanup() {
        udevadm settle
        $mdadm -Ssq 2> /dev/null
-       for d in 0 1 2 3 4 5 6 7  8 9 10 11 12
+       for d in 0 1 2 3 4 5 6 7  8 9 10 11 12 13
        do
            losetup -d /dev/loop$d ; # rm -f $targetdir/mdtest$d
            rm -f /dev/disk/by-path/loop*
@@ -80,7 +80,7 @@ do_setup() {
   trap ctrl_c 2
 
   devlist=
-  for d in 0 1 2 3 4 5 6 7 8 9 10 11 12
+  for d in 0 1 2 3 4 5 6 7 8 9 10 11 12 13
   do
     sz=$size
     if [ $d -gt 7 ]; then sz=$ddfsize ; fi
@@ -95,6 +95,7 @@ do_setup() {
     eval dev$d=/dev/loop$d
     eval file$d=$targetdir/mdtest$d
     eval devlist=\"\$devlist \$dev$d\"
+    eval devlist$d=\"\$devlist\"
    #" <-- add this quote to un-confuse vim syntax highlighting
   done
   path0=$dev6
@@ -156,10 +157,13 @@ check() {
      ;;
 
     wait )
+      p=`cat /proc/sys/dev/raid/speed_limit_max`
+      echo 2000000 > /proc/sys/dev/raid/speed_limit_max
       sleep 0.1
       while grep -E '(resync|recovery|reshape|check|repair) *=' > /dev/null /proc/mdstat
-      do sleep 2;
+      do sleep 0.5;
       done
+      echo $p > /proc/sys/dev/raid/speed_limit_max
       ;;
 
     state )
@@ -216,6 +220,10 @@ testdev() {
    fi
 }
 
+fast_sync() {
+  echo 200000 > /proc/sys/dev/raid/speed_limit_max
+}
+
 rotest() {
   dev=$1
   fsck -fn $dev >&2
@@ -231,6 +239,8 @@ do_test() {
     $mdadm -Ssq 2> /dev/null
     mdadm --zero $devlist 2> /dev/null
     mdadm --zero $devlist 2> /dev/null
+    # this might have been reset: restore the default.
+    echo 2000 > /proc/sys/dev/raid/speed_limit_max
     # source script in a subshell, so it has access to our
     # namespace, but cannot change it.
     echo -ne "$_script... "
@@ -240,6 +250,7 @@ do_test() {
       _fail=0
     else
       log=log
+      cat $targetdir/stderr >> $targetdir/log
       if [ $exitonerror == 0 ]; then
          log=log-`basename $_script`
          mv $targetdir/log $targetdir/$log