public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] network/nfs_lib.sh: Use double quotes for grep pattern
@ 2020-06-08 14:27 Xiao Yang
  2020-06-08 14:58 ` Petr Vorel
  0 siblings, 1 reply; 7+ messages in thread
From: Xiao Yang @ 2020-06-08 14:27 UTC (permalink / raw)
  To: ltp

sh -c 'grep -q '^[# ]*udp *= *y' ...' in nfs_server_udp_enabled()
cannot processe nested single quotes correctly if rsh/ssh is used
and gets the error:
--------------------------------------------
grep: Unmatched [ or [^ (or grep: Unmatched [, [^, [:, [., or [=)
nfs01 1 TCONF: UDP support disabled on NFS server
--------------------------------------------

This issue make many NFS tests including UDP become TCONF even
if NFS supports UDP so use double quotes inside to fix it.

Fixes: 0f1c36c51 ("nfs: Detect disabled UDP")
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 testcases/network/nfs/nfs_stress/nfs_lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh
index f7eb57d66..e236cd485 100644
--- a/testcases/network/nfs/nfs_stress/nfs_lib.sh
+++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh
@@ -58,7 +58,7 @@ nfs_server_udp_enabled()
 	tst_rhost_run -c "[ -f /etc/nfs.conf ]" || return 0
 	config=$(tst_rhost_run -c 'for f in $(grep ^include.*= '/etc/nfs.conf' | cut -d = -f2); do [ -f $f ] && printf "$f "; done')
 
-	tst_rhost_run -c "grep -q '^[# ]*udp *= *y' /etc/nfs.conf $config"
+	tst_rhost_run -c "grep -q \"^[# ]*udp *= *y\" /etc/nfs.conf $config"
 }
 
 nfs_setup_server()
-- 
2.25.1




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

end of thread, other threads:[~2020-06-18 13:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-08 14:27 [LTP] [PATCH] network/nfs_lib.sh: Use double quotes for grep pattern Xiao Yang
2020-06-08 14:58 ` Petr Vorel
2020-06-09  6:14   ` Xiao Yang
2020-06-17 14:28   ` Alexey Kodanev
2020-06-17 18:43     ` Petr Vorel
2020-06-18 12:38       ` Alexey Kodanev
2020-06-18 13:23         ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox