<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=koi8-r">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p><span style="font-size: 10pt;">> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span><br>
</p>
<div style="color: rgb(0, 0, 0);"><font size="2"><span style="font-size:10pt;">
<div class="PlainText">> *От:* Pavel Emelianov<br>
> *Отправлено:* 25 ноября 2016 г. 18:00<br>
> *Кому:* Cyrill Gorcunov; crml<br>
> *Копия:* Vitaly Ostrosablin; Andrey Vagin<br>
> *Тема:* Re: [CRIU] [PATCH 3/3] test: Handle parseargs for VZ7 qa envinronment<br>
> <br>
> On 11/25/2016 05:20 PM, Cyrill Gorcunov wrote:<br>
>> From: Vitaly Ostrosablin <vostrosablin@virtuozzo.com><br>
>> <br>
>> Test seem to assume that zdtm lib directory is on PATH, but if it's not<br>
> <br>
> ... then it should be added there by the caller ;)<br>
> <br>
>> - calling for parseargs.sh would fail (if cwd is static). Therefore,<br>
>> this patch adds a envvar, which, if set, uses old behavior, and else<br>
>> goes to ../lib/parseargs.sh<br>
>> <br>
>> Signed-off-by: Vitaly Ostrosablin <vostrosablin@virtuozzo.com><br>
>> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org><br>
>> ---<br>
>> test/zdtm/static/conntracks | 7 ++++++-<br>
>> test/zdtm/static/route_rules | 7 ++++++-<br>
>> 2 files changed, 12 insertions(+), 2 deletions(-)<br>
>> <br>
>> diff --git a/test/zdtm/static/conntracks b/test/zdtm/static/conntracks<br>
>> index 54898c76f157..9c5be1be4de7 100755<br>
>> --- a/test/zdtm/static/conntracks<br>
>> +++ b/test/zdtm/static/conntracks<br>
>> @@ -45,8 +45,13 @@ do_stop()<br>
>> echo "PASS" > $outfile<br>
>> }<br>
>> <br>
>> +if [ -z $VZENV ]; then<br>
>> + parseargs=../lib/parseargs.sh<br>
>> +else<br>
>> + parseargs=parseargs.sh<br>
>> +fi<br>
>> <br>
>> -tmpargs="$(parseargs.sh --name=$0 \<br>
>> +tmpargs="$($parseargs --name=$0 \<br>
>> --flags-req=statefile,outfile \<br>
>> --flags-opt="start,stop" -- "$@")" ||<br>
>> die "can't parse command line"<br>
>> diff --git a/test/zdtm/static/route_rules b/test/zdtm/static/route_rules<br>
>> index ea44537c78b9..139fbb9e05a6 100755<br>
>> --- a/test/zdtm/static/route_rules<br>
>> +++ b/test/zdtm/static/route_rules<br>
>> @@ -60,8 +60,13 @@ do_stop()<br>
>> echo "PASS" > $outfile<br>
>> }<br>
>> <br>
>> +if [ -z $VZENV ]; then<br>
>> + parseargs=../lib/parseargs.sh<br>
>> +else<br>
>> + parseargs=parseargs.sh<br>
>> +fi<br>
>> <br>
>> -tmpargs="$(parseargs.sh --name=$0 \<br>
>> +tmpargs="$($parseargs --name=$0 \<br>
>> --flags-req=statefile,outfile \<br>
>> -- "$@")" ||<br>
>> die "can't parse command line"<br>
>> <br>
> <br>
> .</div>
<div class="PlainText"><br>
</div>
<div class="PlainText">
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><span style="font-size: 10pt;">On 11/28/2016 11:51 AM, Vitaly Ostrosablin wrote:</span><br>
</p>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<font size="2"><span style="font-size: 10pt;">
<div class="PlainText">> Well, yes, it's possible to add that. But our testing lib has no mechanism to properly set<br>
> env vars, <br>
<br>
Really? You were supposed to pass VZENV var every time ;)<br>
<br>
> so we'll have to pass them in each system() call along with make command to start tests.<br>
<br>
OK, then fix the criu scripts to make it stop relying on<br>
PATH being set to anything, but don't introduce these if-s.<br>
<br>
-- Pavel<br>
<br>
</div>
</span></font></div>
<br>
</div>
<div class="PlainText">
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">Not really,
it was</span><span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;"> 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.</span></p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">Looking at zdtm.py's code, make is invoked with -C parameter and should cd into directory of test file:</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
<span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;"></span></p>
<div style="font-size: 16px; font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<span class="Apple-tab-span" style="white-space: pre;"></span>>s_args = ['make', '--no-print-directory',</div>
<div style="font-size: 16px; font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<span class="Apple-tab-span" style="white-space: pre;"></span>>'-C', os.path.dirname(tpath),</div>
<div style="font-size: 16px; font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<span class="Apple-tab-span" style="white-space: pre;"></span>> os.path.basename(tpath)]</div>
<div style="font-size: 16px; font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<br>
</div>
<div style="font-size: 16px; font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">So I think plain unconditional ../lib/parseargs.sh should work for both zdtm.py and our test engine.</span><br>
</div>
<div style="font-size: 16px; font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</span></div>
<div style="font-size: 16px; font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">-- Vitaly</span></div>
</div>
</span></font></div>
</div>
</body>
</html>