diff mbox series

[1/1] nfsstat01: Update client RPC calls for kernel 6.9

Message ID 20240620111129.594449-1-pvorel@suse.cz
State Superseded
Headers show
Series [1/1] nfsstat01: Update client RPC calls for kernel 6.9 | expand

Commit Message

Petr Vorel June 20, 2024, 11:11 a.m. UTC
6.9 moved client RPC calls to namespace (likely 1548036ef1204 ("nfs:
make the rpc_stat per net namespace") [1]), thus update test.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1548036ef1204df65ca5a16e8b199c858cb80075

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/network/nfs/nfsstat01/nfsstat01.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Petr Vorel June 20, 2024, 11:13 a.m. UTC | #1
Hi all,

> 6.9 moved client RPC calls to namespace (likely 1548036ef1204 ("nfs:
> make the rpc_stat per net namespace") [1]), thus update test.

> [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1548036ef1204df65ca5a16e8b199c858cb80075

Actually d47151b79e322 ("nfs: expose /proc/net/sunrpc/nfs in net namespaces")
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d47151b79e3220e72ae323b8b8e9d6da20dc884e
but the previous one is obviously related.

Kind regards,
Petr


> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
>  testcases/network/nfs/nfsstat01/nfsstat01.sh | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

> diff --git a/testcases/network/nfs/nfsstat01/nfsstat01.sh b/testcases/network/nfs/nfsstat01/nfsstat01.sh
> index c2856eff1..a12b80fad 100755
> --- a/testcases/network/nfs/nfsstat01/nfsstat01.sh
> +++ b/testcases/network/nfs/nfsstat01/nfsstat01.sh
> @@ -15,7 +15,12 @@ get_calls()
>  	local calls opt

>  	[ "$name" = "rpc" ] && opt="r" || opt="n"
> -	! tst_net_use_netns && [ "$nfs_f" != "nfs" ] && type="rhost"
> +
> +	if tst_net_use_netns; then
> +		tst_kvcmp -ge "6.9" && [ "$nfs_f" = "nfs" ] && type="rhost"
> +	else
> +		[ "$nfs_f" != "nfs" ] && type="rhost"
> +	fi

>  	if [ "$type" = "lhost" ]; then
>  		calls="$(grep $name /proc/net/rpc/$nfs_f | cut -d' ' -f$field)"
diff mbox series

Patch

diff --git a/testcases/network/nfs/nfsstat01/nfsstat01.sh b/testcases/network/nfs/nfsstat01/nfsstat01.sh
index c2856eff1..a12b80fad 100755
--- a/testcases/network/nfs/nfsstat01/nfsstat01.sh
+++ b/testcases/network/nfs/nfsstat01/nfsstat01.sh
@@ -15,7 +15,12 @@  get_calls()
 	local calls opt
 
 	[ "$name" = "rpc" ] && opt="r" || opt="n"
-	! tst_net_use_netns && [ "$nfs_f" != "nfs" ] && type="rhost"
+
+	if tst_net_use_netns; then
+		tst_kvcmp -ge "6.9" && [ "$nfs_f" = "nfs" ] && type="rhost"
+	else
+		[ "$nfs_f" != "nfs" ] && type="rhost"
+	fi
 
 	if [ "$type" = "lhost" ]; then
 		calls="$(grep $name /proc/net/rpc/$nfs_f | cut -d' ' -f$field)"