[CRIU] [PATCH 9/9] test/zdtm.sh: kill the test case process if crtools failed

Kir Kolyshkin kir at openvz.org
Mon Feb 6 13:07:19 EST 2012


Do not leave it running

Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
 test/zdtm.sh |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/test/zdtm.sh b/test/zdtm.sh
index b223110..4329da3 100644
--- a/test/zdtm.sh
+++ b/test/zdtm.sh
@@ -50,6 +50,7 @@ run_test()
 	local args=$*
 	local tname=`basename $test`
 	local tdir=`dirname $test`
+	local ret
 
 	killall -9 $tname
 	make -C $tdir cleanout $tname.pid
@@ -60,12 +61,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
-- 
1.7.5.4



More information about the CRIU mailing list