[CRIU] [PATCH 2/2] zdtm: wait a test process instead of output file

Pavel Emelyanov xemul at parallels.com
Thu Jul 4 04:26:49 EDT 2013


On 07/04/2013 03:21 PM, Andrey Vagin wrote:
> A test should be completed if a test process exited.
> 
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
>  test/zdtm.sh | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/test/zdtm.sh b/test/zdtm.sh
> index f28d33a..530379a 100755
> --- a/test/zdtm.sh
> +++ b/test/zdtm.sh
> @@ -425,10 +425,14 @@ EOF
>  	done
>  
>  	echo Check results $PID
> -	stop_test $tdir $tname
> +	stop_test $tdir $tname || {
> +		echo "Unable to stop $tname ($PID)"
> +		return 2
> +	}
> +
>  	sltime=1
>  	for i in `seq 50`; do
> -		test -f $test.out && break
> +		kill -0 $PID || break

How about "pid reuse" thing?

>  		echo Waiting...
>  		sleep 0.$sltime
>  		[ $sltime -lt 9 ] && sltime=$((sltime+1))
> 




More information about the CRIU mailing list