[LTP] [PATCH 2/3] nfs_lib.sh: Check running rpc.mountd, rpcbind/portmap

Petr Vorel pvorel@suse.cz
Wed May 26 09:18:35 CEST 2021


Hi Alexey,

> Both are required to be running for NFS tests.

> This requires to add pgrep dependency, as we don't have custom LTP C
> based tool for searching in processes.

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

> diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh
> index 1bd057717..25fe67bda 100644
> --- a/testcases/network/nfs/nfs_stress/nfs_lib.sh
> +++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh
> @@ -27,7 +27,7 @@ TST_PARSE_ARGS=nfs_parse_args
>  TST_USAGE=nfs_usage
>  TST_NEEDS_TMPDIR=1
>  TST_NEEDS_ROOT=1
> -TST_NEEDS_CMDS="$TST_NEEDS_CMDS mount exportfs"
> +TST_NEEDS_CMDS="$TST_NEEDS_CMDS exportfs mount pgrep"
>  TST_SETUP="${TST_SETUP:-nfs_setup}"
>  TST_CLEANUP="${TST_CLEANUP:-nfs_cleanup}"

> @@ -107,6 +107,11 @@ nfs_setup()
>  		tst_brk TCONF "Cannot run nfs-stress test on mounted NFS"
>  	fi

> +	pgrep rpc.mountd > /dev/null || \
> +		tst_brk TCONF "rpc.mountd not running"
> +
> +	check_portmap_rpcbind

I found that at least some tests (e.g. nfs01) runs with stopped rpcbind.
I suppose that's because nfs-server.service is able to restart it
(it's activated via socket).

Although rpc.mountd (nfs-mountd.service) is required, nfs-mountd.service is a
nfs-server.service dependency (nfs-server.service:Requires=nfs-mountd.service).
Thus it's probably enough to check that rpc.nfsd is running.
=> sending v2 with just single commit.

Kind regards,
Petr


More information about the ltp mailing list