[LTP] nfsstat02.sh: Properly fix netns enforcement

linuxtestproject.agent@gmail.com linuxtestproject.agent@gmail.com
Fri Oct 30 14:37:32 CET 2026


Hi Petr,

On Fri Oct 30 12:36:37 2026 +0100, Petr Vorel <pvorel@suse.cz> wrote:
> nfsstat02.sh: Properly fix netns enforcement

> diff --git a/testcases/network/nfs/nfsstat01/nfsstat02.sh b/testcases/network/nfs/nfsstat01/nfsstat02.sh
> index 75a1a01b5..193a52b59 100755
> --- a/testcases/network/nfs/nfsstat01/nfsstat02.sh
> +++ b/testcases/network/nfs/nfsstat01/nfsstat02.sh
> @@ -20,7 +20,7 @@ do_test()
>  }
>  
>  # Force use of nested net namespace
> -unset RHOST
> +tst_net_use_netns || tst_net_unset_2_hosts_variables
>  
>  . nfs_lib.sh
>  tst_run

tst_net_use_netns and tst_net_unset_2_hosts_variables are called before
nfs_lib.sh (which sources tst_net.sh) is sourced, so both functions are
undefined at this point and fail with "not found". Calling them after
sourcing nfs_lib.sh is also too late because tst_net.sh already evaluates
RHOST and runs tst_net_setup_network at top level while being sourced. Set a
variable such as TST_NET_FORCE_NETNS=1 before sourcing nfs_lib.sh and handle
unsetting the 2-host variables inside tst_net.sh before the RHOST check.

Verdict - Needs revision

---
Note:

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer


More information about the ltp mailing list