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

Vitaly Ostrosablin vostrosablin at virtuozzo.com
Mon Nov 28 03:22:43 PST 2016


> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

> *От:* Pavel Emelianov
> *Отправлено:* 25 ноября 2016 г. 18:00
> *Кому:* Cyrill Gorcunov; crml
> *Копия:* Vitaly Ostrosablin; Andrey Vagin
> *Тема:* Re: [CRIU] [PATCH 3/3] test: Handle parseargs for VZ7 qa envinronment
>
> 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"
>>
>
> .


On 11/28/2016 11:51 AM, Vitaly Ostrosablin wrote:

> Well, yes, it's possible to add that. But our testing lib has no mechanism to properly set
> env vars,

Really? You were supposed to pass VZENV var every time ;)

> so we'll have to pass them in each system() call along with make command to start tests.

OK, then fix the criu scripts to make it stop relying on
PATH being set to anything, but don't introduce these if-s.

-- Pavel



Not really, it was zdtm.py who was supposed to pass VZENV var. If var is unset, it should've taken ../lib/parseargs.sh. This change required complementary change in zdtm.py. But I initially proposed version without if-s.


Looking at zdtm.py's code, make is invoked with -C parameter and should cd into directory of test file:


>s_args = ['make', '--no-print-directory',
>'-C', os.path.dirname(tpath),
>      os.path.basename(tpath)]

So I think plain unconditional ../lib/parseargs.sh should work for both zdtm.py and our test engine.

-- Vitaly
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/criu/attachments/20161128/90ac5841/attachment.html>


More information about the CRIU mailing list