<div dir="ltr">I doubt whether I need to umount and remove ZDTM_ROOT.<div><br></div><div>ZDTM_ROOT is mounted when calling start_test() at the first time, and is unmounted at exit_callback() when the script is over. So it is only mounted once in all.</div>
<div><br></div><div>In batch-test mode, when some test failed, we just want to cleanup its related resources. Based on the fact that ZDTM_TEST could be used still, I think I should reserve it.</div><div><br></div><div>After consideration, it seems that %.cleanout is unnecessary and may delete some import debug info. I will delete that one.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 13, 2013 at 8:34 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="im">On Tue, Aug 13, 2013 at 08:20:32AM -0700, Yicheng Qin wrote:<br>
> It is set in case_error().<br>
> Whenever it calls case_error, ZDTM_FAILED will be set to 1.<br>
<br>
</div>Ok. It's my fault. I thought that this patch adds ZDTM_FAILED.<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> It is a variable that has been in the script. The call of it is as follows in<br>
> exit_callback():<br>
><br>
><br>
> [[ -n "$ZDTM_FAILED" && -n "$DUMP_ARCHIVE" ]] && tar -czf $DUMP_ARCHIVE dump<br>
><br>
><br>
> I think it is definitely used to indicate whether zdtm tests failed or not.<br>
><br>
><br>
><br>
> On Tue, Aug 13, 2013 at 2:38 AM, Andrew Vagin <<a href="mailto:avagin@parallels.com">avagin@parallels.com</a>> wrote:<br>
><br>
> 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<br>
> return<br>
> > # code is non-zero because of post dump action.<br>
> > if [ "$retcode" -ne 0 ] && [[ "$retcode" -ne 32 || -z<br>
> "$dump_only" ]]; then<br>
> > - echo WARNING: $tname returned $retcode and left<br>
> running for debug needs<br>
> > + if [ $BATCH_TEST -eq 0 ]; then<br>
> > + echo WARNING: $tname returned $retcode and<br>
> left running for debug needs<br>
> > + else<br>
> > + echo WARNING: $tname failed and returned<br>
> $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>
> where is ZDTM_FAILED set?<br>
><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>
> > _______________________________________________<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>
><br>
><br>
</div></div></blockquote></div><br></div>