]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
test: allow resync/reshape etc to go faster.
authorNeilBrown <neilb@suse.de>
Thu, 11 Jul 2013 03:16:40 +0000 (13:16 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 11 Jul 2013 03:24:40 +0000 (13:24 +1000)
Whenever we "check wait" - make the resync process go at full speed.

Also allow script to adjust it manually.

Signed-off-by: NeilBrown <neilb@suse.de>
test

diff --git a/test b/test
index 8a6418d66bb63121f50e03bd2b0dd355889799b1..850084c4b80f8424119abdfec66f38b54a10eec2 100755 (executable)
--- a/test
+++ b/test
@@ -157,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 )
@@ -217,6 +220,10 @@ testdev() {
    fi
 }
 
+fast_sync() {
+  echo 200000 > /proc/sys/dev/raid/speed_limit_max
+}
+
 rotest() {
   dev=$1
   fsck -fn $dev >&2
@@ -232,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... "