[LTP] [PATCH 2/2] nfsstat01: Check that RPC stats don't leak between net namespaces

Martin Doucha mdoucha@suse.cz
Mon Sep 2 13:58:39 CEST 2024


Hi,

On 30. 08. 24 22:15, Petr Vorel wrote:
>> @@ -93,6 +97,16 @@ do_test()
>>   		tst_res TPASS "client RPC calls increased"
>>   	fi
> 
>> +	if [ $NS_STAT_RHOST -ne 0 ]; then
>> +		tst_res TINFO "Root NS client RPC calls: $root_calls => $new_root_calls"
>> +
>> +		if [ $root_calls -ne $new_root_calls ]; then
>> +			tst_res TFAIL "RPC stats leaked between net namespaces"
>> +		else
>> +			tst_res TPASS "RPC stats stay within net namespaces"
>> +		fi
> 
> Maybe also add TCONF message? (can be added before merge)
> 
>      else
> 		tst_res TCONF "Not testing leak between root NS and net NS due old kernel"

I think the TCONF message doesn't make sense here. There are several 
cases where the new check will be skipped:
1) the NFS server runs on another machine ($RHOST is not empty)
2) the test is configure to ignore namespaces ($LTP_NFS_NETNS_USE_LO is 
not empty)
3) /proc/net/rpc/nfs doesn't exist in nested net namespaces

You want to print the TCONF message only in case #3. Let's keep the 
condition above simple.

-- 
Martin Doucha   mdoucha@suse.cz
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic



More information about the ltp mailing list