[LTP] [PATCH v2 3/3] Add test for NFS directory listing regression

Alexey Kodanev aleksei.kodanev@bell-sw.com
Wed Nov 24 15:07:28 CET 2021


On 24.11.2021 12:50, Petr Vorel wrote:
> Hi Martin,
> 
>>> -	echo "-n x    Create x files and x directories, default is 5000"
>>> +	echo "-n x    Create x files and x directories, default is $FILE_COUNT"
>>>  }
> 
>> If you run `nfs07.sh -hn 123`, your version will print that the default
>> is 123.
> 
> Out of curiosity (as it's not anything important) not sure what's wrong on my
> side (I tested it before I suggested it, I also reinstalled LTP to make sure
> it's updated), but it works as expected:
> 
> # PATH="/opt/ltp/testcases/bin:$PATH" ./nfs07.sh -hn 123
> nfs07 1 TINFO: initialize 'lhost' 'ltp_ns_veth2' interface
> nfs07 1 TINFO: add local addr 10.0.0.2/24
> nfs07 1 TINFO: add local addr fd00:1:1:1::2/64
> nfs07 1 TINFO: initialize 'rhost' 'ltp_ns_veth1' interface
> nfs07 1 TINFO: add remote addr 10.0.0.1/24
> nfs07 1 TINFO: add remote addr fd00:1:1:1::1/64
> nfs07 1 TINFO: Network config (local -- remote):
> nfs07 1 TINFO: ltp_ns_veth2 -- ltp_ns_veth1
> nfs07 1 TINFO: 10.0.0.2/24 -- 10.0.0.1/24
> nfs07 1 TINFO: fd00:1:1:1::2/64 -- fd00:1:1:1::1/64
> -t x    Socket type, tcp or udp, default is udp
> -v x    NFS version, default is '3'
> -n x    Create x files and x directories, default is 5000
> -h      Prints this help
> -i n    Execute test n times
> 
>>>  do_setup()
>>> @@ -45,7 +45,7 @@ do_test()
>>>  {
>>>  	local count
> 
>>> -	# Pass the list of files through `sort -u` in case `ls` doesn't fitler
>>> +	# Pass the list of files through `sort -u` in case `ls` doesn't filter
>>>  	# out potential duplicate filenames returned by buggy NFS
>>>  	count=`ls | grep '^file' | sort -u | wc -l`
> 
>>> @@ -61,7 +61,7 @@ do_test()
>>>  		return
>>>  	fi
> 
>>> -	tst_res TPASS "All files and directories were correctly listed"
>>> +	tst_res TPASS "All $FILE_COUNT files and directories were correctly listed"
>>>  }
> 
>> That would make the line over 80 characters and the number isn't that
>> important. Let's fix just the "fitler" typo.
> I don't consider 80 as an issue as long as it's not over 100 chars (barier
> increased also in mainline checkpatch.pl), but sure, these are really minor
> issues, thus agree to fix just the typo.
> 
> Waiting little longer if Alexey has any comments and then merge.

Hi Petr, Martin

Overall the new test looks good, and I would only replace the old style
command substitution count=`ls ...` with count=$(ls ...).

Thanks,
Alexey

> 
> Thanks a lot for very useful test case!
> 
> Kind regards,
> Petr
> 



More information about the ltp mailing list