<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 &quot;$ZDTM_FAILED&quot; &amp;&amp; -n &quot;$DUMP_ARCHIVE&quot; ]] &amp;&amp; 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">&lt;<a href="mailto:avagin@parallels.com" target="_blank">avagin@parallels.com</a>&gt;</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>
&gt; In batch-test mode, the script skips failed individual tests<br>
&gt; instead of exiting. This ensures that all zdtm tests can be run<br>
&gt; in one pass, which provides better overview of test result.<br>
&gt;<br>
&gt; Signed-off-by: Yicheng Qin &lt;<a href="mailto:yichengq@google.com">yichengq@google.com</a>&gt;<br>
&gt; ---<br>
&gt; Changelog since v1:<br>
&gt; - add option -n<br>
&gt;<br>
&gt;  test/zdtm.sh | 34 +++++++++++++++++++++++++++++++---<br>
&gt;  1 file changed, 31 insertions(+), 3 deletions(-)<br>
&gt;<br>
&gt; diff --git a/test/zdtm.sh b/test/zdtm.sh<br>
&gt; index 8881b3a..2ca48f5 100755<br>
&gt; --- a/test/zdtm.sh<br>
&gt; +++ b/test/zdtm.sh<br>
&gt; @@ -168,6 +168,7 @@ PAGE_SERVER=0<br>
&gt;  PS_PORT=12345<br>
&gt;  TCPDUMP_PID=<br>
&gt;  COMPILE_ONLY=0<br>
&gt; +BATCH_TEST=0<br>
&gt;<br>
&gt;  check_criu()<br>
&gt;  {<br>
&gt; @@ -439,7 +440,11 @@ EOF<br>
&gt;               # with some error code, or checkpoint is complete but return<br>
&gt;               # code is non-zero because of post dump action.<br>
&gt;               if [ &quot;$retcode&quot; -ne 0 ] &amp;&amp; [[ &quot;$retcode&quot; -ne 32 || -z &quot;$dump_only&quot; ]]; then<br>
&gt; -                     echo WARNING: $tname returned $retcode and left running for debug needs<br>
&gt; +                     if [ $BATCH_TEST -eq 0 ]; then<br>
&gt; +                             echo WARNING: $tname returned $retcode and left running for debug needs<br>
&gt; +                     else<br>
&gt; +                             echo WARNING: $tname failed and returned $retcode<br>
&gt; +                     fi<br>
&gt;                       return 1<br>
&gt;               fi<br>
&gt;<br>
&gt; @@ -556,7 +561,15 @@ case_error()<br>
&gt;<br>
&gt;       echo &quot;==================== ERROR OVER ====================&quot;<br>
&gt;  )<br>
&gt; -     exit 1<br>
&gt; +     if [ $BATCH_TEST -eq 0 ]; then<br>
&gt; +             exit 1<br>
&gt; +     else<br>
&gt; +             # cleanout failed test to prepare for next one<br>
&gt; +             local tname=`basename $test`<br>
&gt; +             local tdir=`dirname $test`<br>
&gt; +             killall -9 $tname &gt; /dev/null 2&gt;&amp;1<br>
&gt; +             make -C $tdir $tname.cleanout<br>
&gt; +     fi<br>
&gt;  }<br>
&gt;<br>
&gt;  checkout()<br>
&gt; @@ -635,6 +648,11 @@ while :; do<br>
&gt;               shift<br>
&gt;               continue<br>
&gt;       fi<br>
&gt; +     if [ &quot;$1&quot; = &quot;-n&quot; ]; then<br>
&gt; +             BATCH_TEST=1<br>
&gt; +             shift<br>
&gt; +             continue<br>
&gt; +     fi<br>
&gt;       break;<br>
&gt;  done<br>
&gt;<br>
&gt; @@ -661,6 +679,7 @@ Options:<br>
&gt;       -t : mount tmpfs for dump files<br>
&gt;       -a &lt;FILE&gt;.tar.gz : save archive with dump files and logs<br>
&gt;       -g : Generate executables only<br>
&gt; +     -n : Batch test<br>
&gt;  EOF<br>
&gt;  elif [ &quot;${1:0:1}&quot; = &#39;-&#39; ]; then<br>
&gt;       echo &quot;unrecognized option $1&quot;<br>
&gt; @@ -688,6 +707,15 @@ else<br>
&gt;       for t in $(echo &quot;$IPC_TEST_LIST&quot; | grep -x &quot;$pattern&quot;); do<br>
&gt;               run_test $t -n ipc || case_error $t<br>
&gt;       done<br>
&gt; +<br>
&gt; +     if [ $COMPILE_ONLY -eq 0 ]; then<br>
&gt; +             if [ -n &quot;$ZDTM_FAILED&quot; ]; then<br>
<br>
</div></div>where is ZDTM_FAILED set?<br>
<div class="im"><br>
&gt; +                     echo ZDTM tests FAIL.<br>
&gt; +             else<br>
&gt; +                     echo ZDTM tests PASS.<br>
&gt; +             fi<br>
&gt; +     fi<br>
&gt;  fi<br>
&gt;<br>
&gt; -[ -n &quot;$TMP_TREE&quot; ] &amp;&amp; rm -rf $TMP_TREE || exit 0<br>
&gt; +[ -n &quot;$TMP_TREE&quot; ] &amp;&amp; rm -rf $TMP_TREE<br>
&gt; +[ -n &quot;$ZDTM_FAILED&quot; ] &amp;&amp; exit 1<br>
&gt; --<br>
&gt; 1.8.3<br>
&gt;<br>
</div>&gt; _______________________________________________<br>
&gt; CRIU mailing list<br>
&gt; <a href="mailto:CRIU@openvz.org">CRIU@openvz.org</a><br>
&gt; <a href="https://lists.openvz.org/mailman/listinfo/criu" target="_blank">https://lists.openvz.org/mailman/listinfo/criu</a><br>
</blockquote></div><br></div>