[CRIU] [PATCH 3/3] test: Handle parseargs for VZ7 qa envinronment

Pavel Emelyanov xemul at virtuozzo.com
Fri Nov 25 07:00:26 PST 2016


On 11/25/2016 05:20 PM, Cyrill Gorcunov wrote:
> From: Vitaly Ostrosablin <vostrosablin at virtuozzo.com>
> 
> Test seem to assume that zdtm lib directory is on PATH, but if it's not

... then it should be added there by the caller ;)

> - calling for parseargs.sh would fail (if cwd is static). Therefore,
> this patch adds a envvar, which, if set, uses old behavior, and else
> goes to ../lib/parseargs.sh
> 
> Signed-off-by: Vitaly Ostrosablin <vostrosablin at virtuozzo.com>
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  test/zdtm/static/conntracks  | 7 ++++++-
>  test/zdtm/static/route_rules | 7 ++++++-
>  2 files changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/test/zdtm/static/conntracks b/test/zdtm/static/conntracks
> index 54898c76f157..9c5be1be4de7 100755
> --- a/test/zdtm/static/conntracks
> +++ b/test/zdtm/static/conntracks
> @@ -45,8 +45,13 @@ do_stop()
>  	echo "PASS" > $outfile
>  }
>  
> +if [ -z $VZENV ]; then
> +    parseargs=../lib/parseargs.sh
> +else
> +    parseargs=parseargs.sh
> +fi
>  
> -tmpargs="$(parseargs.sh --name=$0 \
> +tmpargs="$($parseargs --name=$0 \
>  		--flags-req=statefile,outfile \
>  		--flags-opt="start,stop" -- "$@")" ||
>  	die "can't parse command line"
> diff --git a/test/zdtm/static/route_rules b/test/zdtm/static/route_rules
> index ea44537c78b9..139fbb9e05a6 100755
> --- a/test/zdtm/static/route_rules
> +++ b/test/zdtm/static/route_rules
> @@ -60,8 +60,13 @@ do_stop()
>  	echo "PASS" > $outfile
>  }
>  
> +if [ -z $VZENV ]; then
> +    parseargs=../lib/parseargs.sh
> +else
> +    parseargs=parseargs.sh
> +fi
>  
> -tmpargs="$(parseargs.sh --name=$0 \
> +tmpargs="$($parseargs --name=$0 \
>  		--flags-req=statefile,outfile \
>  		-- "$@")" ||
>  	die "can't parse command line"
> 



More information about the CRIU mailing list