[LTP] [PATCH] nfs: Adapt the lib to allow to test in 2-host mode

Petr Vorel pvorel@suse.cz
Tue Feb 24 10:38:20 CET 2026


> Hi!
> > > Signed-off-by: Sebastian Chlad <sebastian.chlad@suse.com>
> > > ---
> > >  testcases/network/nfs/nfs_stress/nfs_lib.sh | 22 +++++++++++++++++----
> > >  1 file changed, 18 insertions(+), 4 deletions(-)

> > > diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh
> > > index 1ac8bd657..e52f96a5a 100644
> > > --- a/testcases/network/nfs/nfs_stress/nfs_lib.sh
> > > +++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh
> > > @@ -45,7 +45,7 @@ TST_SKIP_FILESYSTEMS="exfat,ext2,ext3,fuse,ntfs,vfat,tmpfs"
> > >  TST_MOUNT_DEVICE=1
> > >  TST_FORMAT_DEVICE=1
> > >  TST_NEEDS_ROOT=1
> > > -TST_NEEDS_CMDS="$TST_NEEDS_CMDS mount exportfs mount.nfs"
> > > +TST_NEEDS_CMDS="$TST_NEEDS_CMDS mount mount.nfs"

> I guess that in the furture we want separate scripts for the different
> hosts so that each of them can have proper metadata. I suppose that the

FYI I merged v2 (ecc02095e3). I was also thinking whether add
TST_RHOST_NEEDS_CMDS (or TST_NET_NEEDS_CMDS) variable for checking rhost. My
guess is that more tests will need this check for 2 host side. And while I'm not
keen on extending tst_net.sh, it would show us that in the end something needs
to be handled in LTP metadata (LTP C API struct tst_test or some new struct
tst_net) when we rewrite tests into shell loader or even pure C API.

> TST_MOUNT_DEVICE does not apply to the rhost either.

Good point, it'd be worth to investigate why I added TST_MOUNT_DEVICE=1 and
whether it's still valid.

> And with that we would need some kind of "master file" that would
> explain which script should be executed on which host etc. But I guess
> that it would be tricky to desing this properly.

I'm not sure if separated file is worth of adding. There is tst_rhost_run()
function which should be used for checking, which works well on both netns and 2
host based setup (that's why v2).

Kind regards,
Petr


More information about the ltp mailing list