test/zdtm.sh: kill the test case process if crtools failed

Do not leave it running

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
This commit is contained in:
Kir Kolyshkin 2012-02-06 22:07:19 +04:00 committed by Andrey Vagin
parent 6f5cf13f29
commit f9408a054e

View file

@ -51,6 +51,7 @@ run_test()
local args=$*
local tname=`basename $test`
local tdir=`dirname $test`
local ret
killall -9 $tname
make -C $tdir cleanout $tname.pid
@ -62,12 +63,14 @@ run_test()
echo Dump $pid
mkdir -p $ddump
setsid $CRTOOLS dump -D $ddump -o dump.log -t $pid $args || return 1
setsid $CRTOOLS dump -D $ddump -o dump.log -t $pid $args
ret=$?
while :; do
killall -9 $tname &> /dev/null || break
echo Waiting...
sleep 1
done
[ "$ret" -eq 0 ] || return 1
echo Restore $pid
setsid $CRTOOLS restore -D $ddump -o restore.log -d -t $pid $args || return 2