All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP PATCH v2 1/3] nfs_lib.sh: Detect unsupported protocol
@ 2021-05-26 17:25 ` Petr Vorel
  0 siblings, 0 replies; 18+ messages in thread
From: Petr Vorel @ 2021-05-26 17:25 UTC (permalink / raw)
  To: ltp; +Cc: Petr Vorel, Alexey Kodanev, linux-nfs

Caused by disabled CONFIG_NFSD_V[34] in kernel config.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
new in v2

 testcases/network/nfs/nfs_stress/nfs_lib.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh
index 3fad8778a..b80ee0e18 100644
--- a/testcases/network/nfs/nfs_stress/nfs_lib.sh
+++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh
@@ -94,9 +94,15 @@ nfs_mount()
 
 	if [ $? -ne 0 ]; then
 		cat mount.log
+
 		if [ "$type" = "udp" -o "$type" = "udp6" ] && tst_kvcmp -ge 5.6; then
 			tst_brk TCONF "UDP support disabled with the kernel config NFS_DISABLE_UDP_SUPPORT?"
 		fi
+
+		if grep -i "Protocol not supported" mount.log; then
+			tst_brk TCONF "Protocol not supported"
+		fi
+
 		tst_brk TBROK "mount command failed"
 	fi
 }
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [LTP] [LTP PATCH v2 1/3] nfs_lib.sh: Detect unsupported protocol
@ 2021-05-26 17:25 ` Petr Vorel
  0 siblings, 0 replies; 18+ messages in thread
From: Petr Vorel @ 2021-05-26 17:25 UTC (permalink / raw)
  To: ltp

Caused by disabled CONFIG_NFSD_V[34] in kernel config.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
new in v2

 testcases/network/nfs/nfs_stress/nfs_lib.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh
index 3fad8778a..b80ee0e18 100644
--- a/testcases/network/nfs/nfs_stress/nfs_lib.sh
+++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh
@@ -94,9 +94,15 @@ nfs_mount()
 
 	if [ $? -ne 0 ]; then
 		cat mount.log
+
 		if [ "$type" = "udp" -o "$type" = "udp6" ] && tst_kvcmp -ge 5.6; then
 			tst_brk TCONF "UDP support disabled with the kernel config NFS_DISABLE_UDP_SUPPORT?"
 		fi
+
+		if grep -i "Protocol not supported" mount.log; then
+			tst_brk TCONF "Protocol not supported"
+		fi
+
 		tst_brk TBROK "mount command failed"
 	fi
 }
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [LTP PATCH v2 2/3] nfs_lib.sh: Require nfsd kernel module
  2021-05-26 17:25 ` [LTP] " Petr Vorel
@ 2021-05-26 17:25   ` Petr Vorel
  -1 siblings, 0 replies; 18+ messages in thread
From: Petr Vorel @ 2021-05-26 17:25 UTC (permalink / raw)
  To: ltp; +Cc: Petr Vorel, Alexey Kodanev, linux-nfs

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
new in v2

 testcases/network/nfs/nfs_stress/nfs_lib.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh
index b80ee0e18..26b670c35 100644
--- a/testcases/network/nfs/nfs_stress/nfs_lib.sh
+++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh
@@ -30,6 +30,7 @@ TST_NEEDS_ROOT=1
 TST_NEEDS_CMDS="$TST_NEEDS_CMDS mount exportfs"
 TST_SETUP="${TST_SETUP:-nfs_setup}"
 TST_CLEANUP="${TST_CLEANUP:-nfs_cleanup}"
+TST_NEEDS_DRIVERS="nfsd"
 
 # When set and test is using netns ($TST_USE_NETNS set) NFS traffic will go
 # through lo interface instead of ltp_ns_veth* netns interfaces (useful for
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [LTP] [LTP PATCH v2 2/3] nfs_lib.sh: Require nfsd kernel module
@ 2021-05-26 17:25   ` Petr Vorel
  0 siblings, 0 replies; 18+ messages in thread
From: Petr Vorel @ 2021-05-26 17:25 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
new in v2

 testcases/network/nfs/nfs_stress/nfs_lib.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh
index b80ee0e18..26b670c35 100644
--- a/testcases/network/nfs/nfs_stress/nfs_lib.sh
+++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh
@@ -30,6 +30,7 @@ TST_NEEDS_ROOT=1
 TST_NEEDS_CMDS="$TST_NEEDS_CMDS mount exportfs"
 TST_SETUP="${TST_SETUP:-nfs_setup}"
 TST_CLEANUP="${TST_CLEANUP:-nfs_cleanup}"
+TST_NEEDS_DRIVERS="nfsd"
 
 # When set and test is using netns ($TST_USE_NETNS set) NFS traffic will go
 # through lo interface instead of ltp_ns_veth* netns interfaces (useful for
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [LTP PATCH v2 3/3] nfs_lib.sh: Check running rpc.mountd, rpc.statd
  2021-05-26 17:25 ` [LTP] " Petr Vorel
@ 2021-05-26 17:25   ` Petr Vorel
  -1 siblings, 0 replies; 18+ messages in thread
From: Petr Vorel @ 2021-05-26 17:25 UTC (permalink / raw)
  To: ltp; +Cc: Petr Vorel, Alexey Kodanev, linux-nfs

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


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [LTP] [LTP PATCH v2 3/3] nfs_lib.sh: Check running rpc.mountd, rpc.statd
@ 2021-05-26 17:25   ` Petr Vorel
  0 siblings, 0 replies; 18+ messages in thread
From: Petr Vorel @ 2021-05-26 17:25 UTC (permalink / raw)
  To: ltp

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


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [LTP PATCH v2 1/3] nfs_lib.sh: Detect unsupported protocol
  2021-05-26 17:25 ` [LTP] " Petr Vorel
@ 2021-05-27  6:32   ` Petr Vorel
  -1 siblings, 0 replies; 18+ messages in thread
From: Petr Vorel @ 2021-05-27  6:32 UTC (permalink / raw)
  To: ltp; +Cc: Alexey Kodanev, linux-nfs

Hi all,

> Caused by disabled CONFIG_NFSD_V[34] in kernel config.

Looking for other errno in nfs-utils (in utils/mount/):
EACCES 13 Permission denied
EAFNOSUPPORT 97 Address family not supported by protocol
EAGAIN 11 Resource temporarily unavailable
EALREADY 114 Operation already in progress
ECONNREFUSED 111 Connection refused
EINVAL 22 Invalid argument
EIO 5 Input/output error
ENOMEM 12 Cannot allocate memory
EOPNOTSUPP 95 Operation not supported
EPROTONOSUPPORT 93 Protocol not supported
ESPIPE 29 Illegal seek
ETIMEDOUT 110 Connection timed out

I suppose I should add only:
EAFNOSUPPORT 97 Address family not supported by protocol
(I guess for kernel without IPv6 support).

But doing a quick test with v3 enabled and v4 disabled:
CONFIG_NFS_V2=m
CONFIG_NFS_V3=m
# CONFIG_NFS_V3_ACL is not set
# CONFIG_NFS_V4 is not set
CONFIG_NFSD_V3=y
# CONFIG_NFSD_V3_ACL is not set
CONFIG_NFSD_V4=y

nfs-utils does not print it for enabled protocol:

nfs01 1 TINFO: setup NFSv3, socket type tcp6
nfs01 1 TINFO: Mounting NFS: mount -v -t nfs -o proto=tcp6,vers=3 [fd00:1:1:1::2]:/var/tmp/LTP_nfs01.XXXXySFHMF/3/tcp6 /var/tmp/LTP_nfs01.XXXXySFHMF/3/0
mount: mounting [fd00:1:1:1::2]:/var/tmp/LTP_nfs01.XXXXySFHMF/3/tcp6 on /var/tmp/LTP_nfs01.XXXXySFHMF/3/0 failed: Input/output error
nfs01 1 TBROK: mount command failed

but it does for disabled protocol:

nfs01 1 TINFO: setup NFSv4, socket type tcp6
nfs01 1 TINFO: Mounting NFS: mount -v -t nfs -o proto=tcp6,vers=4 [fd00:1:1:1::2]:/var/tmp/LTP_nfs01.XXXXWyckxh/4/tcp6 /var/tmp/LTP_nfs01.XXXXWyckxh/4/0
NFS: NFSv4 is not compiled into kernel
mount: mounting [fd00:1:1:1::2]:/var/tmp/LTP_nfs01.XXXXWyckxh/4/tcp6 on /var/tmp/LTP_nfs01.XXXXWyckxh/4/0 failed: Protocol not supported
mount: mounting [fd00:1:1:1::2]:/var/tmp/LTP_nfs01.XXXXWyckxh/4/tcp6 on /var/tmp/LTP_nfs01.XXXXWyckxh/4/0 failed: Protocol not supported
nfs01 1 TCONF: Protocol not supported

It might be a problem with LTP tst_net.sh library, which might not support
disabled IPv6 properly. Testing ping02.sh -6:

ping02 1 TINFO: initialize 'lhost' 'ltp_ns_veth2' interface
ping02 1 TINFO: add local addr 10.0.0.2/24
ping02 1 TINFO: add local addr fd00:1:1:1::2/64
RTNETLINK answers: Operation not supported
ping02 1 TINFO: initialize 'rhost' 'ltp_ns_veth1' interface
ping02 1 TINFO: add remote addr 10.0.0.1/24
ping02 1 TINFO: add remote addr fd00:1:1:1::1/64
RTNETLINK answers: Operation not supported
# tst_net_iface_prefix.c:133: TINFO: prefix and interface not found for 'fd00:1:1:1::2'.

ping02 1 TINFO: Network config (local -- remote):
ping02 1 TINFO: ltp_ns_veth2 -- ltp_ns_veth1
ping02 1 TINFO: 10.0.0.2/24 -- 10.0.0.1/24
ping02 1 TINFO: fd00:1:1:1::2/64 -- fd00:1:1:1::1/64
ping02 1 TINFO: timeout per run is 0h 5m 0s
ping6: socket: Address family not supported by protocol
ping02 1 TFAIL: ping6 -I ltp_ns_veth2 -c 3 -s 8 -f -p 000102030405060708090a0b0c0d0e0f fd00:1:1:1::1 >/dev/null failed unexpectedly

=> It's not a priority, I'll try to have look into it in when time permits.
https://github.com/linux-test-project/ltp/issues/821

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [LTP] [LTP PATCH v2 1/3] nfs_lib.sh: Detect unsupported protocol
@ 2021-05-27  6:32   ` Petr Vorel
  0 siblings, 0 replies; 18+ messages in thread
From: Petr Vorel @ 2021-05-27  6:32 UTC (permalink / raw)
  To: ltp

Hi all,

> Caused by disabled CONFIG_NFSD_V[34] in kernel config.

Looking for other errno in nfs-utils (in utils/mount/):
EACCES 13 Permission denied
EAFNOSUPPORT 97 Address family not supported by protocol
EAGAIN 11 Resource temporarily unavailable
EALREADY 114 Operation already in progress
ECONNREFUSED 111 Connection refused
EINVAL 22 Invalid argument
EIO 5 Input/output error
ENOMEM 12 Cannot allocate memory
EOPNOTSUPP 95 Operation not supported
EPROTONOSUPPORT 93 Protocol not supported
ESPIPE 29 Illegal seek
ETIMEDOUT 110 Connection timed out

I suppose I should add only:
EAFNOSUPPORT 97 Address family not supported by protocol
(I guess for kernel without IPv6 support).

But doing a quick test with v3 enabled and v4 disabled:
CONFIG_NFS_V2=m
CONFIG_NFS_V3=m
# CONFIG_NFS_V3_ACL is not set
# CONFIG_NFS_V4 is not set
CONFIG_NFSD_V3=y
# CONFIG_NFSD_V3_ACL is not set
CONFIG_NFSD_V4=y

nfs-utils does not print it for enabled protocol:

nfs01 1 TINFO: setup NFSv3, socket type tcp6
nfs01 1 TINFO: Mounting NFS: mount -v -t nfs -o proto=tcp6,vers=3 [fd00:1:1:1::2]:/var/tmp/LTP_nfs01.XXXXySFHMF/3/tcp6 /var/tmp/LTP_nfs01.XXXXySFHMF/3/0
mount: mounting [fd00:1:1:1::2]:/var/tmp/LTP_nfs01.XXXXySFHMF/3/tcp6 on /var/tmp/LTP_nfs01.XXXXySFHMF/3/0 failed: Input/output error
nfs01 1 TBROK: mount command failed

but it does for disabled protocol:

nfs01 1 TINFO: setup NFSv4, socket type tcp6
nfs01 1 TINFO: Mounting NFS: mount -v -t nfs -o proto=tcp6,vers=4 [fd00:1:1:1::2]:/var/tmp/LTP_nfs01.XXXXWyckxh/4/tcp6 /var/tmp/LTP_nfs01.XXXXWyckxh/4/0
NFS: NFSv4 is not compiled into kernel
mount: mounting [fd00:1:1:1::2]:/var/tmp/LTP_nfs01.XXXXWyckxh/4/tcp6 on /var/tmp/LTP_nfs01.XXXXWyckxh/4/0 failed: Protocol not supported
mount: mounting [fd00:1:1:1::2]:/var/tmp/LTP_nfs01.XXXXWyckxh/4/tcp6 on /var/tmp/LTP_nfs01.XXXXWyckxh/4/0 failed: Protocol not supported
nfs01 1 TCONF: Protocol not supported

It might be a problem with LTP tst_net.sh library, which might not support
disabled IPv6 properly. Testing ping02.sh -6:

ping02 1 TINFO: initialize 'lhost' 'ltp_ns_veth2' interface
ping02 1 TINFO: add local addr 10.0.0.2/24
ping02 1 TINFO: add local addr fd00:1:1:1::2/64
RTNETLINK answers: Operation not supported
ping02 1 TINFO: initialize 'rhost' 'ltp_ns_veth1' interface
ping02 1 TINFO: add remote addr 10.0.0.1/24
ping02 1 TINFO: add remote addr fd00:1:1:1::1/64
RTNETLINK answers: Operation not supported
# tst_net_iface_prefix.c:133: TINFO: prefix and interface not found for 'fd00:1:1:1::2'.

ping02 1 TINFO: Network config (local -- remote):
ping02 1 TINFO: ltp_ns_veth2 -- ltp_ns_veth1
ping02 1 TINFO: 10.0.0.2/24 -- 10.0.0.1/24
ping02 1 TINFO: fd00:1:1:1::2/64 -- fd00:1:1:1::1/64
ping02 1 TINFO: timeout per run is 0h 5m 0s
ping6: socket: Address family not supported by protocol
ping02 1 TFAIL: ping6 -I ltp_ns_veth2 -c 3 -s 8 -f -p 000102030405060708090a0b0c0d0e0f fd00:1:1:1::1 >/dev/null failed unexpectedly

=> It's not a priority, I'll try to have look into it in when time permits.
https://github.com/linux-test-project/ltp/issues/821

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [LTP PATCH v2 1/3] nfs_lib.sh: Detect unsupported protocol
  2021-05-26 17:25 ` [LTP] " Petr Vorel
@ 2021-06-01 14:11   ` Petr Vorel
  -1 siblings, 0 replies; 18+ messages in thread
From: Petr Vorel @ 2021-06-01 14:11 UTC (permalink / raw)
  To: ltp; +Cc: Alexey Kodanev, linux-nfs

Hi Alexey,

could you please have look on v2 before I merge it?

Kind regards,
Petr

> Caused by disabled CONFIG_NFSD_V[34] in kernel config.

> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> new in v2

>  testcases/network/nfs/nfs_stress/nfs_lib.sh | 6 ++++++
>  1 file changed, 6 insertions(+)

> diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh
> index 3fad8778a..b80ee0e18 100644
> --- a/testcases/network/nfs/nfs_stress/nfs_lib.sh
> +++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh
> @@ -94,9 +94,15 @@ nfs_mount()

>  	if [ $? -ne 0 ]; then
>  		cat mount.log
> +
>  		if [ "$type" = "udp" -o "$type" = "udp6" ] && tst_kvcmp -ge 5.6; then
>  			tst_brk TCONF "UDP support disabled with the kernel config NFS_DISABLE_UDP_SUPPORT?"
>  		fi
> +
> +		if grep -i "Protocol not supported" mount.log; then
> +			tst_brk TCONF "Protocol not supported"
> +		fi
> +
>  		tst_brk TBROK "mount command failed"
>  	fi
>  }

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [LTP] [LTP PATCH v2 1/3] nfs_lib.sh: Detect unsupported protocol
@ 2021-06-01 14:11   ` Petr Vorel
  0 siblings, 0 replies; 18+ messages in thread
From: Petr Vorel @ 2021-06-01 14:11 UTC (permalink / raw)
  To: ltp

Hi Alexey,

could you please have look on v2 before I merge it?

Kind regards,
Petr

> Caused by disabled CONFIG_NFSD_V[34] in kernel config.

> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> new in v2

>  testcases/network/nfs/nfs_stress/nfs_lib.sh | 6 ++++++
>  1 file changed, 6 insertions(+)

> diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh
> index 3fad8778a..b80ee0e18 100644
> --- a/testcases/network/nfs/nfs_stress/nfs_lib.sh
> +++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh
> @@ -94,9 +94,15 @@ nfs_mount()

>  	if [ $? -ne 0 ]; then
>  		cat mount.log
> +
>  		if [ "$type" = "udp" -o "$type" = "udp6" ] && tst_kvcmp -ge 5.6; then
>  			tst_brk TCONF "UDP support disabled with the kernel config NFS_DISABLE_UDP_SUPPORT?"
>  		fi
> +
> +		if grep -i "Protocol not supported" mount.log; then
> +			tst_brk TCONF "Protocol not supported"
> +		fi
> +
>  		tst_brk TBROK "mount command failed"
>  	fi
>  }

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [LTP PATCH v2 1/3] nfs_lib.sh: Detect unsupported protocol
  2021-05-26 17:25 ` [LTP] " Petr Vorel
@ 2021-06-02  7:44   ` Alexey Kodanev
  -1 siblings, 0 replies; 18+ messages in thread
From: Alexey Kodanev @ 2021-06-02  7:44 UTC (permalink / raw)
  To: Petr Vorel, ltp; +Cc: linux-nfs

On 26.05.2021 20:25, Petr Vorel wrote:
> Caused by disabled CONFIG_NFSD_V[34] in kernel config.
> 
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> new in v2
> 
>  testcases/network/nfs/nfs_stress/nfs_lib.sh | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh
> index 3fad8778a..b80ee0e18 100644
> --- a/testcases/network/nfs/nfs_stress/nfs_lib.sh
> +++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh
> @@ -94,9 +94,15 @@ nfs_mount()
>  
>  	if [ $? -ne 0 ]; then
>  		cat mount.log
> +
>  		if [ "$type" = "udp" -o "$type" = "udp6" ] && tst_kvcmp -ge 5.6; then
>  			tst_brk TCONF "UDP support disabled with the kernel config NFS_DISABLE_UDP_SUPPORT?"
>  		fi
> +
> +		if grep -i "Protocol not supported" mount.log; then

Hi Petr,

It's better to add '-q' flag to grep.

> +			tst_brk TCONF "Protocol not supported"
> +		fi
> +
>  		tst_brk TBROK "mount command failed"
>  	fi
>  }
> 


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [LTP] [LTP PATCH v2 1/3] nfs_lib.sh: Detect unsupported protocol
@ 2021-06-02  7:44   ` Alexey Kodanev
  0 siblings, 0 replies; 18+ messages in thread
From: Alexey Kodanev @ 2021-06-02  7:44 UTC (permalink / raw)
  To: ltp

On 26.05.2021 20:25, Petr Vorel wrote:
> Caused by disabled CONFIG_NFSD_V[34] in kernel config.
> 
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> new in v2
> 
>  testcases/network/nfs/nfs_stress/nfs_lib.sh | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh
> index 3fad8778a..b80ee0e18 100644
> --- a/testcases/network/nfs/nfs_stress/nfs_lib.sh
> +++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh
> @@ -94,9 +94,15 @@ nfs_mount()
>  
>  	if [ $? -ne 0 ]; then
>  		cat mount.log
> +
>  		if [ "$type" = "udp" -o "$type" = "udp6" ] && tst_kvcmp -ge 5.6; then
>  			tst_brk TCONF "UDP support disabled with the kernel config NFS_DISABLE_UDP_SUPPORT?"
>  		fi
> +
> +		if grep -i "Protocol not supported" mount.log; then

Hi Petr,

It's better to add '-q' flag to grep.

> +			tst_brk TCONF "Protocol not supported"
> +		fi
> +
>  		tst_brk TBROK "mount command failed"
>  	fi
>  }
> 


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [LTP PATCH v2 3/3] nfs_lib.sh: Check running rpc.mountd, rpc.statd
  2021-05-26 17:25   ` [LTP] " Petr Vorel
@ 2021-06-02  8:08     ` Alexey Kodanev
  -1 siblings, 0 replies; 18+ messages in thread
From: Alexey Kodanev @ 2021-06-02  8:08 UTC (permalink / raw)
  To: Petr Vorel, ltp; +Cc: linux-nfs

On 26.05.2021 20:25, Petr Vorel wrote:
> 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"

Does it change anything?

The rest looks good.

>  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"
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [LTP] [LTP PATCH v2 3/3] nfs_lib.sh: Check running rpc.mountd, rpc.statd
@ 2021-06-02  8:08     ` Alexey Kodanev
  0 siblings, 0 replies; 18+ messages in thread
From: Alexey Kodanev @ 2021-06-02  8:08 UTC (permalink / raw)
  To: ltp

On 26.05.2021 20:25, Petr Vorel wrote:
> 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"

Does it change anything?

The rest looks good.

>  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"
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [LTP PATCH v2 3/3] nfs_lib.sh: Check running rpc.mountd, rpc.statd
  2021-06-02  8:08     ` [LTP] " Alexey Kodanev
@ 2021-06-02 11:04       ` Petr Vorel
  -1 siblings, 0 replies; 18+ messages in thread
From: Petr Vorel @ 2021-06-02 11:04 UTC (permalink / raw)
  To: Alexey Kodanev; +Cc: ltp, linux-nfs

Hi Alexey,

> > -TST_NEEDS_CMDS="$TST_NEEDS_CMDS mount exportfs"
> > +TST_NEEDS_CMDS="$TST_NEEDS_CMDS exportfs mount"

> Does it change anything?

Just sort alphabetically (not a problem here, but in longer list it's easier to
read).

> The rest looks good.
Thx!

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [LTP] [LTP PATCH v2 3/3] nfs_lib.sh: Check running rpc.mountd, rpc.statd
@ 2021-06-02 11:04       ` Petr Vorel
  0 siblings, 0 replies; 18+ messages in thread
From: Petr Vorel @ 2021-06-02 11:04 UTC (permalink / raw)
  To: ltp

Hi Alexey,

> > -TST_NEEDS_CMDS="$TST_NEEDS_CMDS mount exportfs"
> > +TST_NEEDS_CMDS="$TST_NEEDS_CMDS exportfs mount"

> Does it change anything?

Just sort alphabetically (not a problem here, but in longer list it's easier to
read).

> The rest looks good.
Thx!

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [LTP PATCH v2 1/3] nfs_lib.sh: Detect unsupported protocol
  2021-06-02  7:44   ` [LTP] " Alexey Kodanev
@ 2021-06-02 11:08     ` Petr Vorel
  -1 siblings, 0 replies; 18+ messages in thread
From: Petr Vorel @ 2021-06-02 11:08 UTC (permalink / raw)
  To: Alexey Kodanev; +Cc: ltp, linux-nfs

> On 26.05.2021 20:25, Petr Vorel wrote:
> > Caused by disabled CONFIG_NFSD_V[34] in kernel config.

> > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > ---
> > new in v2

> >  testcases/network/nfs/nfs_stress/nfs_lib.sh | 6 ++++++
> >  1 file changed, 6 insertions(+)

> > diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh
> > index 3fad8778a..b80ee0e18 100644
> > --- a/testcases/network/nfs/nfs_stress/nfs_lib.sh
> > +++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh
> > @@ -94,9 +94,15 @@ nfs_mount()

> >  	if [ $? -ne 0 ]; then
> >  		cat mount.log
> > +
> >  		if [ "$type" = "udp" -o "$type" = "udp6" ] && tst_kvcmp -ge 5.6; then
> >  			tst_brk TCONF "UDP support disabled with the kernel config NFS_DISABLE_UDP_SUPPORT?"
> >  		fi
> > +
> > +		if grep -i "Protocol not supported" mount.log; then

> Hi Petr,

> It's better to add '-q' flag to grep.
Good point, thanks!

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [LTP] [LTP PATCH v2 1/3] nfs_lib.sh: Detect unsupported protocol
@ 2021-06-02 11:08     ` Petr Vorel
  0 siblings, 0 replies; 18+ messages in thread
From: Petr Vorel @ 2021-06-02 11:08 UTC (permalink / raw)
  To: ltp

> On 26.05.2021 20:25, Petr Vorel wrote:
> > Caused by disabled CONFIG_NFSD_V[34] in kernel config.

> > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > ---
> > new in v2

> >  testcases/network/nfs/nfs_stress/nfs_lib.sh | 6 ++++++
> >  1 file changed, 6 insertions(+)

> > diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh
> > index 3fad8778a..b80ee0e18 100644
> > --- a/testcases/network/nfs/nfs_stress/nfs_lib.sh
> > +++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh
> > @@ -94,9 +94,15 @@ nfs_mount()

> >  	if [ $? -ne 0 ]; then
> >  		cat mount.log
> > +
> >  		if [ "$type" = "udp" -o "$type" = "udp6" ] && tst_kvcmp -ge 5.6; then
> >  			tst_brk TCONF "UDP support disabled with the kernel config NFS_DISABLE_UDP_SUPPORT?"
> >  		fi
> > +
> > +		if grep -i "Protocol not supported" mount.log; then

> Hi Petr,

> It's better to add '-q' flag to grep.
Good point, thanks!

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2021-06-02 15:18 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [LTP PATCH v2 3/3] nfs_lib.sh: Check running rpc.mountd, rpc.statd Petr Vorel
2021-05-26 17:25   ` [LTP] " 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

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.