]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
test: make 'check wait' more reliable.
authorNeilBrown <neilb@suse.de>
Thu, 28 May 2015 06:53:26 +0000 (16:53 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 28 May 2015 07:00:36 +0000 (17:00 +1000)
'recover' etc doesn't appear in /proc/mdstat immediately.
The "sync" thread must be started first.
But 'sync_action' shows it as soon as MD_RECOVERY_NEEDED is set
in the kernel.  So look there too.

Now maybe I can get rid of some of those silly 'sleep' calls.

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

diff --git a/test b/test
index 50acedfe606edbd93efc889857da5b39ac8922b5..9610b6574ef7f8f45612b4320f3f20bc96fec113 100755 (executable)
--- a/test
+++ b/test
@@ -200,7 +200,7 @@ check() {
       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
+      while grep -E '(resync|recovery|reshape|check|repair) *=' > /dev/null /proc/mdstat /sys/block/md*/md/sync_action
       do sleep 0.5;
       done
       echo $p > /proc/sys/dev/raid/speed_limit_max