FS/XFS testing framework
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: cem@kernel.org
Cc: zlang@kernel.org, hch@lst.de, linux-xfs@vger.kernel.org,
	fstests@vger.kernel.org, jack@suse.cz
Subject: Re: [RFC PATCH 1/2] common/nfs: add management helpers
Date: Tue, 8 Sep 2026 07:22:26 -0700	[thread overview]
Message-ID: <20260908142226.GL839663@frogsfrogsfrogs> (raw)
In-Reply-To: <20260907164054.111393-2-cem@kernel.org>

On Mon, Sep 07, 2026 at 06:40:47PM +0200, cem@kernel.org wrote:
> From: Carlos Maiolino <cem@kernel.org>
> 
> This adds a few new helpers to manage local nfs client/servers. These
> can be used to exercise bugs which happens through a nfs share.
> 
> Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
> ---
>  common/nfs | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 55 insertions(+)
> 
> diff --git a/common/nfs b/common/nfs
> index a03eaf48e1c0..4508a8a2e494 100644
> --- a/common/nfs
> +++ b/common/nfs
> @@ -33,3 +33,58 @@ _require_scratch_nfs_version()
>  	fi
>  	_scratch_unmount
>  }
> +
> +# Start rpcbind if it is not already running.
> +_start_rpcbind()
> +{
> +	rpcinfo -p localhost > /dev/null 2>&1 && return 0
> +	rpcbind 2>> $seqres.full || _notrun "Cannot start rpcbind"
> +	/usr/sbin/rpc.statd 2>> $seqres.full || _notrun "Cannot start rpc.statd"
> +	/usr/sbin/rpc.idmapd 2>> $seqres.full || _notrun "Cannot start rpc.idmapd"
> +	/usr/sbin/nfsdcld 2>> $seqres.full || _notrun "Cannot start nfsdcld"

Aren't these daemons usually configured as system services?

# service rpcbind start

etc?

> +}
> +
> +# Stop rpcbind.
> +_stop_rpcbind()
> +{
> +	pkill rpcbind 2>/dev/null
> +}
> +
> +# Start the NFS server if not already running.
> +_start_nfsd()
> +{
> +	rpcinfo -p localhost 2>/dev/null | grep -q nfs && return 0
> +	rpc.nfsd 2>> $seqres.full || _notrun "Cannot start rpc.nfsd"
> +	rpc.mountd 2>> $seqres.full || _notrun "Cannot start rpc.mountd"
> +}
> +
> +# Stop the NFS server.
> +_stop_nfsd()
> +{
> +	rpc.nfsd 0 2>/dev/null
> +	pkill rpc.mountd 2>/dev/null

If the system under test has nfs filesystems mounted, won't killing
those daemons also break the mounts?

I think that might break testing of nfs itself, and nfs-booted testing
nodes as well?

--D

> +}
> +
> +# Require a NFS server to be available and start rpcbind and nfsd if they are
> +# not already running.
> +_require_nfs_server()
> +{
> +	type -P exportfs > /dev/null 2>&1 || \
> +		_notrun "exportfs utility required, skipped this test"
> +	type -P rpc.nfsd > /dev/null 2>&1 || \
> +		_notrun "rpc.nfsd utility required, skipped this test"
> +	type -P rpc.mountd > /dev/null 2>&1 || \
> +		_notrun "rpc.mountd utility required, skipped this test"
> +	_start_rpcbind
> +	_start_nfsd
> +}
> +
> +# Require a NFS client to be available.
> +_require_nfs_client()
> +{
> +	grep -q nfs /proc/filesystems 2>/dev/null || \
> +		_notrun "Kernel does not support NFS client"
> +	type -P mount.nfs > /dev/null 2>&1 || \
> +		_notrun "mount.nfs utility required, skipped this test"
> +}
> -- 
> 2.55.0
> 
> 

  reply	other threads:[~2026-09-08 14:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-07 16:40 [RFC PATCH 0/2] quota evasion test and nfs helpers cem
2026-09-07 16:40 ` [RFC PATCH 1/2] common/nfs: add management helpers cem
2026-09-08 14:22   ` Darrick J. Wong [this message]
2026-09-09  6:12     ` Christoph Hellwig
2026-09-09 16:13       ` Darrick J. Wong
2026-09-10  9:45         ` Carlos Maiolino
2026-09-10 11:30       ` Jeff Layton
2026-09-10 11:40         ` Carlos Maiolino
2026-09-10 11:48           ` Jeff Layton
2026-09-07 16:40 ` [RFC PATCH 2/2] generic: add test for quota enforcement via a nfs share cem
2026-09-08 10:25   ` Jan Kara
2026-09-08 10:29 ` [RFC PATCH 0/2] quota evasion test and nfs helpers Jan Kara
2026-09-10 11:34 ` Jeff Layton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260908142226.GL839663@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=cem@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=linux-xfs@vger.kernel.org \
    --cc=zlang@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox