[CRIU] test/zdtm: skip failed individual tests instead of exiting

Andrew Vagin avagin at parallels.com
Mon Aug 12 04:10:22 EDT 2013


On Fri, Aug 09, 2013 at 08:09:06AM -0700, Yicheng Qin wrote:
> From: Yicheng Qin <yichengq at google.com>
> Subject: [PATCH] test/zdtm: skip failed individual tests instead of exiting
> 
> This ensures that all tests can be run in one pass, which can provide
> better overview of test result.

Pls, add a seperate option for this scenario.

Currently zdtm.sh stops after an error for easier investigation.

> 
> Signed-off-by: Yicheng Qin <yichengq at google.com>
> ---
>  test/zdtm.sh | 21 ++++++++++++++++++---
>  1 file changed, 18 insertions(+), 3 deletions(-)
> 
> diff --git a/test/zdtm.sh b/test/zdtm.sh
> index 6db2bf0..094ea53 100755
> --- a/test/zdtm.sh
> +++ b/test/zdtm.sh
> @@ -174,6 +174,7 @@ PAGE_SERVER=0
>  PS_PORT=12345
>  TCPDUMP_PID=
>  NS_TEST_ONLY=0
> +EXIT_VALUE=0
>  
>  check_mainstream()
>  {
> @@ -439,7 +440,7 @@ EOF
>   # with some error code, or checkpoint is complete but return
>   # code is non-zero because of post dump action.
>   if [ "$retcode" -ne 0 ] && [[ "$retcode" -ne 32 || -z "$dump_only" ]]; then
> - echo WARNING: $tname returned $retcode and left running for debug needs


> + echo WARNING: $tname failed and returned $retcode
>   return 1
>   fi
>  
> @@ -553,7 +554,14 @@ case_error()
>  
>   echo "==================== ERROR OVER ====================" >&2
>  
> - exit 1
> + # cleanout failed test to prepare for next one
> + local tname=`basename $test`
> + local tdir=`dirname $test`
> + killall -9 $tname > /dev/null 2>&1

How are you going to investigate errors?

> + make -C $tdir $tname.cleanout
> +
> + # record the error
> + EXIT_VALUE=1
>  }
>  
>  checkout()
> @@ -664,6 +672,12 @@ if [ $# -eq 0 ]; then
>   for t in $IPC_TEST_LIST; do
>   run_test $t -n ipc || case_error $t
>   done
> +
> + if [ $EXIT_VALUE -eq 0 ]; then
> + echo ZDTM tests PASS.
> + else
> + echo ZDTM tests FAIL.
> + fi
>  elif [ "$1" = "-l" ]; then
>   echo $TEST_LIST $UTS_TEST_LIST $MNT_TEST_LIST $IPC_TEST_LIST | tr ' ' '\n'
>  elif [ "$1" = "-g" ]; then
> @@ -711,4 +725,5 @@ else
>   fi
>  fi
>  
> -[ -n "$TMP_TREE" ] && rm -rf $TMP_TREE || exit 0
> +[ -n "$TMP_TREE" ] && rm -rf $TMP_TREE
> +exit $EXIT_VALUE
> -- 
> 1.8.3
> 

> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu



More information about the CRIU mailing list