[CRIU] [PATCH v6] zdtm: print test dir, dump and restore path (if any) in case of error

Kinsbursky Stanislav skinsbursky at openvz.org
Mon Jan 30 07:54:40 EST 2012


30.01.2012 16:52, Kir Kolyshkin пишет:
> On 01/30/2012 03:54 PM, Kinsbursky Stanislav wrote:
>> From: Stanislav Kinsbursky<skinsbursky at parallels.com>
>>
>> v6: silly "/" miss fixed
>>
>> v5: it finally workks as expected
>>
>> v4: fixed wrong error print after successfull  run on all zdtm tests
>>
>> v3: spaces removed
>>
>> v2: print test output file path  (if present)
>>
>> Print dump and restore file in case of running all tests suit.
>>
>> Signed-off-by: Stanislav Kinsbursky<skinsbursky at parallels.com>
>>
>> ---
>>    test/zdtm.sh |   35 +++++++++++++++++++++++------------
>>    1 files changed, 23 insertions(+), 12 deletions(-)
>>
>> diff --git a/test/zdtm.sh b/test/zdtm.sh
>> index 2586186..864b28e 100644
>> --- a/test/zdtm.sh
>> +++ b/test/zdtm.sh
>> @@ -1,6 +1,6 @@
>>    #!/bin/bash
>>
>> -ZP="zdtm/live/"
>> +ZP="zdtm/live"
>>
>>    TEST_LIST="\
>>    $ZP/static/pipe00
>> @@ -67,29 +67,40 @@ run_test()
>>    	cat $test.out | grep PASS || return 2
>>    }
>>
>> +case_error()
>> +{
>> +	test=$1
>> +	echo "Test: "$test
>> +	echo "====================== ERROR ======================"
>> +	test_log="`pwd`/$test.out"
>> +	if [ -e "$dump_path/dump.log" ]; then
>> +		echo "Dump log   : "$dump_path"/dump.log"
> (1) There is no need to have $var out of double quotes in shell, you
> just make
> the code less readable that way. Can be as simple as
>
> 	echo "Dump log   : $dump_path/dump.log"
>
> or, if you are really picky,
>
> 	echo "Dump log   : ${dump_path}/dump.log"
>
> (2) You can use one-liners like
>
> 	[ -e $dump_path/dump.log ]&&   echo "Dump log   : $dump_path/dump.log"
>
> but that's really a matter of personal preference.
>
> (3) Traditional convention is to name global variables using UPPERCASE letters, and local variables using lower-case letters. I'm unsure if it makes sense to fix here, but it's a good practice to follow in the future.
>
>

Thanks, Kir. Will take it into account next time.

-- 
Best regards,
Stanislav Kinsbursky




More information about the CRIU mailing list