Commit 05745cee authored by Yicheng Qin's avatar Yicheng Qin Committed by Pavel Emelyanov

test/zdtm: add option -n for batch test

In batch-test mode, the script skips failed individual tests
instead of exiting. This ensures that all zdtm tests can be run
in one pass, which provides better overview of test result.
Signed-off-by: 's avatarYicheng Qin <yichengq@google.com>
Acked-by: 's avatarAndrew Vagin <avagin@parallels.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent a7a787a4
...@@ -168,6 +168,7 @@ PAGE_SERVER=0 ...@@ -168,6 +168,7 @@ PAGE_SERVER=0
PS_PORT=12345 PS_PORT=12345
TCPDUMP_PID= TCPDUMP_PID=
COMPILE_ONLY=0 COMPILE_ONLY=0
BATCH_TEST=0
check_criu() check_criu()
{ {
...@@ -439,7 +440,11 @@ EOF ...@@ -439,7 +440,11 @@ EOF
# with some error code, or checkpoint is complete but return # with some error code, or checkpoint is complete but return
# code is non-zero because of post dump action. # code is non-zero because of post dump action.
if [ "$retcode" -ne 0 ] && [[ "$retcode" -ne 32 || -z "$dump_only" ]]; then if [ "$retcode" -ne 0 ] && [[ "$retcode" -ne 32 || -z "$dump_only" ]]; then
echo WARNING: $tname returned $retcode and left running for debug needs if [ $BATCH_TEST -eq 0 ]; then
echo WARNING: $tname returned $retcode and left running for debug needs
else
echo WARNING: $tname failed and returned $retcode
fi
return 1 return 1
fi fi
...@@ -574,7 +579,13 @@ EOF ...@@ -574,7 +579,13 @@ EOF
=========================== ERROR OVER ============================ =========================== ERROR OVER ============================
EOF EOF
) )
exit 1 if [ $BATCH_TEST -eq 0 ]; then
exit 1
else
# kill failed test
local tname=`basename $test`
killall -9 $tname > /dev/null 2>&1
fi
} }
checkout() checkout()
...@@ -653,6 +664,11 @@ while :; do ...@@ -653,6 +664,11 @@ while :; do
shift shift
continue continue
fi fi
if [ "$1" = "-n" ]; then
BATCH_TEST=1
shift
continue
fi
break; break;
done done
...@@ -679,6 +695,7 @@ Options: ...@@ -679,6 +695,7 @@ Options:
-t : mount tmpfs for dump files -t : mount tmpfs for dump files
-a <FILE>.tar.gz : save archive with dump files and logs -a <FILE>.tar.gz : save archive with dump files and logs
-g : Generate executables only -g : Generate executables only
-n : Batch test
EOF EOF
elif [ "${1:0:1}" = '-' ]; then elif [ "${1:0:1}" = '-' ]; then
echo "unrecognized option $1" echo "unrecognized option $1"
...@@ -705,6 +722,15 @@ else ...@@ -705,6 +722,15 @@ else
for t in $(echo "$IPC_TEST_LIST" | grep -x "$pattern"); do for t in $(echo "$IPC_TEST_LIST" | grep -x "$pattern"); do
run_test $t -n ipc || case_error $t run_test $t -n ipc || case_error $t
done done
if [ $COMPILE_ONLY -eq 0 ]; then
if [ -n "$ZDTM_FAILED" ]; then
echo ZDTM tests FAIL.
else
echo ZDTM tests PASS.
fi
fi
fi fi
[ -n "$TMP_TREE" ] && rm -rf $TMP_TREE || exit 0 [ -n "$TMP_TREE" ] && rm -rf $TMP_TREE
[ -n "$ZDTM_FAILED" ] && exit 1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment