diff options
Diffstat (limited to 'test')
-rwxr-xr-x[-rw-r--r--] | test | 36 |
1 files changed, 18 insertions, 18 deletions
@@ -50,12 +50,12 @@ ddfsize=65536 cleanup() { udevadm settle - $mdadm -Ssq + $mdadm -Ssq 2> /dev/null for d in 0 1 2 3 4 5 6 7 8 9 10 11 12 do losetup -d /dev/loop$d ; # rm -f $targetdir/mdtest$d rm -f /dev/disk/by-path/loop* - done + done } trap cleanup 0 1 2 3 15 @@ -117,45 +117,45 @@ check() { ;; raid* | linear ) grep -s "active $1 " /proc/mdstat > /dev/null || { - echo >&2 "ERROR active $1 not found" ; cat /proc/mdstat ; exit 1;} + echo >&2 "ERROR active $1 not found" ; cat /proc/mdstat ; exit 1;} ;; resync | recovery | reshape) sleep 0.5 grep -s $1 /proc/mdstat > /dev/null || { - echo >&2 ERROR no $1 happening; cat /proc/mdstat; exit 1; } + echo >&2 ERROR no $1 happening; cat /proc/mdstat; exit 1; } ;; - + nosync ) sleep 0.5 if grep -s -E '(resync|recovery|reshape) =' > /dev/null /proc/mdstat ; then - echo >&2 "ERROR resync or recovery is happening!"; cat /proc/mdstat ; exit 1; + echo >&2 "ERROR resync or recovery is happening!"; cat /proc/mdstat ; exit 1; fi ;; - + wait ) sleep 0.1 while grep -E '(resync|recovery|reshape|check|repair) =' > /dev/null /proc/mdstat do sleep 2; done ;; - + state ) grep -s "blocks.*\[$2\]\$" /proc/mdstat > /dev/null || { - echo >&2 "ERROR state $2 not found!"; cat /proc/mdstat ; exit 1; } + echo >&2 "ERROR state $2 not found!"; cat /proc/mdstat ; exit 1; } sleep 0.5 ;; bitmap ) grep -s bitmap > /dev/null /proc/mdstat || { - echo >&2 ERROR no bitmap ; cat /proc/mdstat ; exit 1; } + echo >&2 ERROR no bitmap ; cat /proc/mdstat ; exit 1; } ;; nobitmap ) - if grep -s "bitmap" > /dev/null /proc/mdstat + if grep -s "bitmap" > /dev/null /proc/mdstat then - echo >&2 ERROR bitmap present ; cat /proc/mdstat ; exit 1; + echo >&2 ERROR bitmap present ; cat /proc/mdstat ; exit 1; fi ;; - + * ) echo >&2 ERROR unknown check $1 ; exit 1; esac } @@ -218,18 +218,18 @@ do then rm -f $targetdir/stderr # stop all arrays, just incase some script left an array active. - mdadm -Ssq + $mdadm -Ssq 2> /dev/null mdadm --zero $devlist 2> /dev/null mdadm --zero $devlist 2> /dev/null environment="tests/env-`basename $script`" setup_environment $environment # source script in a subshell, so it has access to our # namespace, but cannot change it. + echo -ne "$script... " if ( set -ex ; . $script ) 2> $targetdir/log - then echo "$script succeeded" - else cat $targetdir/log ; cat $targetdir/stderr - echo "$script failed" - reset_environment $environment + then echo "succeeded" + else echo "FAILED" + reset_environment $environment exit 1 fi reset_environment $environment |