[LTP] [PATCH 3/3] test_net.sh: netns as default in tst_rhost_run

Alexey Kodanev alexey.kodanev@oracle.com
Fri Jan 20 17:14:03 CET 2017


On 01/19/2017 08:50 PM, Petr Vorel wrote:
>>   	local output=
>>   	local ret=0
>> -	if [ -n "$TST_USE_SSH" ]; then
>> -		output=`ssh -n -q $user@$RHOST "sh -c \
>> -			'$pre_cmd $cmd $post_cmd'" $out 2>&1 || echo 'RTERR'`
>> -	elif [ -n "$TST_USE_NETNS" ]; then
>> +	if [ -n "$TST_USE_NETNS" ]; then
>>   		output=`$LTP_NETNS sh -c \
>>   			"$pre_cmd $cmd $post_cmd" $out 2>&1 || echo 'RTERR'`
>> +	elif [ -n "$TST_USE_SSH" ]; then
>> +		output=`ssh -n -q $user@$RHOST "sh -c \
>> +			'$pre_cmd $cmd $post_cmd'" $out 2>&1 || echo 'RTERR'`
>>   	else
>>   		output=`rsh -n -l $user $RHOST "sh -c \
>>   			'$pre_cmd $cmd $post_cmd'" $out 2>&1 || echo 'RTERR'`
> How about this patch? (just this one, please ignore 1st and 2nd) NACK?

With this patch, if user wants to use ssh (explicitly set this variable) 
but forgot
to set remote host variable, the test will continue with netns and the user
might not even notice it.

Thanks,
Alexey


More information about the ltp mailing list