summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2015-07-23 03:17:10 +0200
committerNeilBrown <neilb@suse.com>2015-07-23 03:17:10 +0200
commit6fba5a339c86731cfb6d3e2bb954deb578d2873a (patch)
treec56a26055ac50558434fdb038ab392ebc18f89c3 /test
parenttests: flushbufs after writing zeros (diff)
downloadmdadm-6fba5a339c86731cfb6d3e2bb954deb578d2873a.tar.xz
mdadm-6fba5a339c86731cfb6d3e2bb954deb578d2873a.zip
test: assume recovery has completed if sync_completed says so.
The final completion of a recovery can be delayed, so use sync_completed to check if it is finished, just not been reaped. Signed-off-by: NeilBrown <neilb@suse.com>
Diffstat (limited to 'test')
-rwxr-xr-xtest8
1 files changed, 8 insertions, 0 deletions
diff --git a/test b/test
index 939410ce..d0a6cb85 100755
--- a/test
+++ b/test
@@ -205,8 +205,16 @@ check() {
nosync )
sleep 0.5
+ # Since 4.2 we delay the close of recovery until there has been a chance for
+ # spares to be activated. That means that a recovery that finds nothing
+ # to do can still take a little longer than expected.
+ # add an extra check: is sync_completed shows the end is reached, assume
+ # there is no recovery.
if grep -s -E '(resync|recovery|reshape) *=' > /dev/null /proc/mdstat ; then
+ incomplete=`grep / /sys/block/md*/md/sync_completed 2> /dev/null | sed '/^ *\([0-9]*\) \/ \1/d'`
+ if [ -n "$incomplete" ]; then
echo >&2 "ERROR resync or recovery is happening!"; cat /proc/mdstat ; exit 1;
+ fi
fi
;;