<div dir="ltr">It is set in case_error().<div>Whenever it calls case_error, ZDTM_FAILED will be set to 1.</div><div><br></div><div>It is a variable that has been in the script. The call of it is as follows in exit_callback():</div>
<div><br></div><div><pre style="color:rgb(0,0,0)">[[ -n "$ZDTM_FAILED" && -n "$DUMP_ARCHIVE" ]] && tar -czf $DUMP_ARCHIVE dump</pre><pre style="color:rgb(0,0,0)"><br></pre><pre style="color:rgb(0,0,0)">
I think it is definitely used to indicate whether zdtm tests failed or not.</pre></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 13, 2013 at 2:38 AM, Andrew Vagin <span dir="ltr"><<a href="mailto:avagin@parallels.com" target="_blank">avagin@parallels.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, Aug 13, 2013 at 01:34:02AM -0700, Yicheng Qin wrote:<br>
> In batch-test mode, the script skips failed individual tests<br>
> instead of exiting. This ensures that all zdtm tests can be run<br>
> in one pass, which provides better overview of test result.<br>
><br>
> Signed-off-by: Yicheng Qin <<a href="mailto:yichengq@google.com">yichengq@google.com</a>><br>
> ---<br>
> Changelog since v1:<br>
> - add option -n<br>
><br>
> test/zdtm.sh | 34 +++++++++++++++++++++++++++++++---<br>
> 1 file changed, 31 insertions(+), 3 deletions(-)<br>
><br>
> diff --git a/test/zdtm.sh b/test/zdtm.sh<br>
> index 8881b3a..2ca48f5 100755<br>
> --- a/test/zdtm.sh<br>
> +++ b/test/zdtm.sh<br>
> @@ -168,6 +168,7 @@ PAGE_SERVER=0<br>
> PS_PORT=12345<br>
> TCPDUMP_PID=<br>
> COMPILE_ONLY=0<br>
> +BATCH_TEST=0<br>
><br>
> check_criu()<br>
> {<br>
> @@ -439,7 +440,11 @@ EOF<br>
> # with some error code, or checkpoint is complete but return<br>
> # code is non-zero because of post dump action.<br>
> if [ "$retcode" -ne 0 ] && [[ "$retcode" -ne 32 || -z "$dump_only" ]]; then<br>
> - echo WARNING: $tname returned $retcode and left running for debug needs<br>
> + if [ $BATCH_TEST -eq 0 ]; then<br>
> + echo WARNING: $tname returned $retcode and left running for debug needs<br>
> + else<br>
> + echo WARNING: $tname failed and returned $retcode<br>
> + fi<br>
> return 1<br>
> fi<br>
><br>
> @@ -556,7 +561,15 @@ case_error()<br>
><br>
> echo "==================== ERROR OVER ===================="<br>
> )<br>
> - exit 1<br>
> + if [ $BATCH_TEST -eq 0 ]; then<br>
> + exit 1<br>
> + else<br>
> + # cleanout failed test to prepare for next one<br>
> + local tname=`basename $test`<br>
> + local tdir=`dirname $test`<br>
> + killall -9 $tname > /dev/null 2>&1<br>
> + make -C $tdir $tname.cleanout<br>
> + fi<br>
> }<br>
><br>
> checkout()<br>
> @@ -635,6 +648,11 @@ while :; do<br>
> shift<br>
> continue<br>
> fi<br>
> + if [ "$1" = "-n" ]; then<br>
> + BATCH_TEST=1<br>
> + shift<br>
> + continue<br>
> + fi<br>
> break;<br>
> done<br>
><br>
> @@ -661,6 +679,7 @@ Options:<br>
> -t : mount tmpfs for dump files<br>
> -a <FILE>.tar.gz : save archive with dump files and logs<br>
> -g : Generate executables only<br>
> + -n : Batch test<br>
> EOF<br>
> elif [ "${1:0:1}" = '-' ]; then<br>
> echo "unrecognized option $1"<br>
> @@ -688,6 +707,15 @@ else<br>
> for t in $(echo "$IPC_TEST_LIST" | grep -x "$pattern"); do<br>
> run_test $t -n ipc || case_error $t<br>
> done<br>
> +<br>
> + if [ $COMPILE_ONLY -eq 0 ]; then<br>
> + if [ -n "$ZDTM_FAILED" ]; then<br>
<br>
</div></div>where is ZDTM_FAILED set?<br>
<div class="im"><br>
> + echo ZDTM tests FAIL.<br>
> + else<br>
> + echo ZDTM tests PASS.<br>
> + fi<br>
> + fi<br>
> fi<br>
><br>
> -[ -n "$TMP_TREE" ] && rm -rf $TMP_TREE || exit 0<br>
> +[ -n "$TMP_TREE" ] && rm -rf $TMP_TREE<br>
> +[ -n "$ZDTM_FAILED" ] && exit 1<br>
> --<br>
> 1.8.3<br>
><br>
</div>> _______________________________________________<br>
> CRIU mailing list<br>
> <a href="mailto:CRIU@openvz.org">CRIU@openvz.org</a><br>
> <a href="https://lists.openvz.org/mailman/listinfo/criu" target="_blank">https://lists.openvz.org/mailman/listinfo/criu</a><br>
</blockquote></div><br></div>