From: Petr Vorel <pvorel@suse.cz> To: ltp@lists.linux.it Cc: Petr Vorel <pvorel@suse.cz>, Alexey Kodanev <aleksei.kodanev@bell-sw.com>, linux-nfs@vger.kernel.org Subject: [LTP PATCH v2 3/3] nfs_lib.sh: Check running rpc.mountd, rpc.statd Date: Wed, 26 May 2021 19:25:03 +0200 [thread overview] Message-ID: <20210526172503.18621-3-pvorel@suse.cz> (raw) In-Reply-To: <20210526172503.18621-1-pvorel@suse.cz> NOTE: we're not checking rpcbind/portmap which is required for NFSv3, as it's rpc.mountd dependency. Deliberately not add pgrep as required dependency. Signed-off-by: Petr Vorel <pvorel@suse.cz> --- changes v1->v2: * check for rpc.mountd, rpc.statd (previsously checked for rpc.mountd, rpcbind/portmap) testcases/network/nfs/nfs_stress/nfs_lib.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh index 26b670c35..9bef1b86a 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" TST_SETUP="${TST_SETUP:-nfs_setup}" TST_CLEANUP="${TST_CLEANUP:-nfs_cleanup}" TST_NEEDS_DRIVERS="nfsd" @@ -110,11 +110,6 @@ nfs_mount() nfs_setup() { - # Check if current filesystem is NFS - if [ "$(stat -f . | grep "Type: nfs")" ]; then - tst_brk TCONF "Cannot run nfs-stress test on mounted NFS" - fi - local i local type local n=0 @@ -123,6 +118,16 @@ nfs_setup() local remote_dir local mount_dir + if [ "$(stat -f . | grep "Type: nfs")" ]; then + tst_brk TCONF "Cannot run nfs-stress test on mounted NFS" + fi + + if tst_cmd_available pgrep; then + for i in rpc.mountd rpc.statd; do + pgrep $i > /dev/null || tst_brk TCONF "$i not running" + done + fi + for i in $VERSION; do type=$(get_socket_type $n) tst_res TINFO "setup NFSv$i, socket type $type" -- 2.31.1
WARNING: multiple messages have this Message-ID (diff)
From: Petr Vorel <pvorel@suse.cz> To: ltp@lists.linux.it Subject: [LTP] [LTP PATCH v2 3/3] nfs_lib.sh: Check running rpc.mountd, rpc.statd Date: Wed, 26 May 2021 19:25:03 +0200 [thread overview] Message-ID: <20210526172503.18621-3-pvorel@suse.cz> (raw) In-Reply-To: <20210526172503.18621-1-pvorel@suse.cz> NOTE: we're not checking rpcbind/portmap which is required for NFSv3, as it's rpc.mountd dependency. Deliberately not add pgrep as required dependency. Signed-off-by: Petr Vorel <pvorel@suse.cz> --- changes v1->v2: * check for rpc.mountd, rpc.statd (previsously checked for rpc.mountd, rpcbind/portmap) testcases/network/nfs/nfs_stress/nfs_lib.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh index 26b670c35..9bef1b86a 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" TST_SETUP="${TST_SETUP:-nfs_setup}" TST_CLEANUP="${TST_CLEANUP:-nfs_cleanup}" TST_NEEDS_DRIVERS="nfsd" @@ -110,11 +110,6 @@ nfs_mount() nfs_setup() { - # Check if current filesystem is NFS - if [ "$(stat -f . | grep "Type: nfs")" ]; then - tst_brk TCONF "Cannot run nfs-stress test on mounted NFS" - fi - local i local type local n=0 @@ -123,6 +118,16 @@ nfs_setup() local remote_dir local mount_dir + if [ "$(stat -f . | grep "Type: nfs")" ]; then + tst_brk TCONF "Cannot run nfs-stress test on mounted NFS" + fi + + if tst_cmd_available pgrep; then + for i in rpc.mountd rpc.statd; do + pgrep $i > /dev/null || tst_brk TCONF "$i not running" + done + fi + for i in $VERSION; do type=$(get_socket_type $n) tst_res TINFO "setup NFSv$i, socket type $type" -- 2.31.1
next prev parent reply other threads:[~2021-05-26 17:34 UTC|newest] Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-05-26 17:25 [LTP PATCH v2 1/3] nfs_lib.sh: Detect unsupported protocol Petr Vorel 2021-05-26 17:25 ` [LTP] " Petr Vorel 2021-05-26 17:25 ` [LTP PATCH v2 2/3] nfs_lib.sh: Require nfsd kernel module Petr Vorel 2021-05-26 17:25 ` [LTP] " Petr Vorel 2021-05-26 17:25 ` Petr Vorel [this message] 2021-05-26 17:25 ` [LTP] [LTP PATCH v2 3/3] nfs_lib.sh: Check running rpc.mountd, rpc.statd Petr Vorel 2021-06-02 8:08 ` Alexey Kodanev 2021-06-02 8:08 ` [LTP] " Alexey Kodanev 2021-06-02 11:04 ` Petr Vorel 2021-06-02 11:04 ` [LTP] " Petr Vorel 2021-05-27 6:32 ` [LTP PATCH v2 1/3] nfs_lib.sh: Detect unsupported protocol Petr Vorel 2021-05-27 6:32 ` [LTP] " Petr Vorel 2021-06-01 14:11 ` Petr Vorel 2021-06-01 14:11 ` [LTP] " Petr Vorel 2021-06-02 7:44 ` Alexey Kodanev 2021-06-02 7:44 ` [LTP] " Alexey Kodanev 2021-06-02 11:08 ` Petr Vorel 2021-06-02 11:08 ` [LTP] " Petr Vorel
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=20210526172503.18621-3-pvorel@suse.cz \ --to=pvorel@suse.cz \ --cc=aleksei.kodanev@bell-sw.com \ --cc=linux-nfs@vger.kernel.org \ --cc=ltp@lists.linux.it \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.