Skip to content

Commit ecc0209

Browse files
schladpevik
authored andcommitted
nfs: Adapt the lib to allow to test in 2-host mode
nfs_lib.sh checked key server_side prerequisites on the system under test. In 2_host setup this incorrectly required server_side tools on lhost. Switch exportfs and rpc.mountd/rpc.statd checks in nfs_setup() to tst_rhost_run(). This aligns netns and 2-host handling in one path and keeps 2-host checks on rhost. Link: https://lore.kernel.org/ltp/20260223105556.31129-1-sebastian.chlad@suse.com/ Reviewed-by: Petr Vorel <pvorel@suse.cz> Signed-off-by: Sebastian Chlad <sebastian.chlad@suse.com>
1 parent 76e20ed commit ecc0209

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

testcases/network/nfs/nfs_stress/nfs_lib.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ TST_SKIP_FILESYSTEMS="exfat,ext2,ext3,fuse,ntfs,vfat,tmpfs"
4545
TST_MOUNT_DEVICE=1
4646
TST_FORMAT_DEVICE=1
4747
TST_NEEDS_ROOT=1
48-
TST_NEEDS_CMDS="$TST_NEEDS_CMDS mount exportfs mount.nfs"
48+
TST_NEEDS_CMDS="$TST_NEEDS_CMDS mount mount.nfs"
4949
TST_SETUP="${TST_SETUP:-nfs_setup}"
5050
TST_CLEANUP="${TST_CLEANUP:-nfs_cleanup}"
5151
TST_NEEDS_DRIVERS="nfsd"
@@ -186,9 +186,13 @@ nfs_setup()
186186
tst_brk TCONF "Cannot run nfs-stress test on mounted NFS"
187187
fi
188188

189-
if tst_cmd_available pgrep; then
189+
tst_rhost_run -c "command -v exportfs >/dev/null" ||
190+
tst_brk TCONF "'exportfs' not found on rhost"
191+
192+
if tst_rhost_run -c "command -v pgrep >/dev/null"; then
193+
tst_res TINFO "checking rpc.mountd/rpc.statd on rhost"
190194
for i in rpc.mountd rpc.statd; do
191-
pgrep $i > /dev/null || tst_brk TCONF "$i not running"
195+
tst_rhost_run -c "pgrep $i > /dev/null" || tst_brk TCONF "$i not running on rhost"
192196
done
193197
fi
194198

0 commit comments

Comments
 (0)