test: allow resync/reshape etc to go faster.

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>
This commit is contained in:
NeilBrown 2013-07-11 13:16:40 +10:00
parent ca36d70735
commit 6fd2a36f9b
1 changed files with 10 additions and 1 deletions

11
test
View File

@ -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... "