[CRIU] [PATCH v2] zdtm: print test dir,
dump and restore path (if any) in case of error
Stanislav Kinsbursky
skinsbursky at parallels.com
Mon Jan 30 04:19:31 EST 2012
v2: print test output file path (if present)
Print dump and restore file in case of running all tests suit.
---
test/zdtm.sh | 30 ++++++++++++++++++++----------
1 files changed, 20 insertions(+), 10 deletions(-)
-------------- next part --------------
diff --git a/test/zdtm.sh b/test/zdtm.sh
index f660dfd..9a179af 100644
--- a/test/zdtm.sh
+++ b/test/zdtm.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-ZP="zdtm/live/"
+ZP="zdtm/live"
TEST_LIST="\
$ZP/static/pipe00
@@ -67,27 +67,37 @@ run_test()
cd `dirname $0` || exit 1
+res=0
if [ $# -eq 0 ]; then
for t in $TEST_LIST; do
- run_test $t "" || exit 1
- done
+ run_test $t "" || res=$?
+ done &&
for t in $NS_TEST_LIST; do
- run_test $t "-n" || exit 1
+ run_test $t "-n" || res=$?
done
elif [ "$1" == "-l" ]; then
echo $TEST_LIST | sed -e "s#$ZP/##g" -e 's/ /\n/g'
echo $NS_TEST_LIST | sed -e "s#$ZP/##g" -e 's/ /\n/g'
else
if echo "$NS_TEST_LIST" | fgrep -q "$1" ; then
- run_test "$ZP/$1" "-n" && exit 0
+ run_test "$ZP/$1" "-n"
else
- run_test "$ZP/$1" && exit 0
+ run_test "$ZP/$1"
fi
- result=$?
+ res=$?
+fi
+
+if [ $res -ne 0 ]; then
echo "====================== ERROR ======================"
- if [ $result == 1 ]; then
- echo "Dump log: "$dump_path"/dump.log"
- else
+ test_dir="`pwd`/$tdir"
+ test_log="`pwd`/$test.out"
+ if [ -e "$dump_path/dump.log" ]; then
+ echo "Dump log : "$dump_path"/dump.log"
+ fi
+ if [ -e "$dump_path/restore.log" ]; then
echo "Restore log: "$dump_path"/restore.log"
fi
+ if [ -e "$test_log" ]; then
+ echo "Output file: "$test_log
+ fi
fi
More information about the CRIU
mailing list