public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/2] ip_tests.sh: Iprove grep count
@ 2024-12-17 14:50 Petr Vorel
  2024-12-17 14:50 ` [LTP] [PATCH 2/2] ip_tests.sh: Update TST_NEEDS_CMDS Petr Vorel
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Petr Vorel @ 2024-12-17 14:50 UTC (permalink / raw)
  To: ltp

Some systems have already defined another route with src 127.0.0.1,
therefore more exact pattern is needed.

Also 1) escape '.' (dot) in regex 2) use '-q' instead of redirecting
stdout to /dev/null.

Reported-by: Petr Cervinka <pcervinka@suse.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/network/iproute/ip_tests.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/testcases/network/iproute/ip_tests.sh b/testcases/network/iproute/ip_tests.sh
index ee9768073f..0b1d5a85e6 100755
--- a/testcases/network/iproute/ip_tests.sh
+++ b/testcases/network/iproute/ip_tests.sh
@@ -179,7 +179,7 @@ test5()
 $ip4_addr via 127.0.0.1 dev lo
 	EOF
 
-	ip route show | grep "$ip4_addr via 127.0.0.1 dev lo" > tst_ip.out 2>&1
+	ip route show | grep "$ip4_addr via 127\.0\.0\.1 dev lo" > tst_ip\.out 2>&1
 	if [ $? -ne 0 ]; then
 		tst_res TFAIL "'ip route show' command failed"
 		return
@@ -195,7 +195,7 @@ $ip4_addr via 127.0.0.1 dev lo
 
 	ROD ip route del $ip4_addr via 127.0.0.1
 
-	ip route show | grep 127.0.0.1 > /dev/null
+	ip route show | grep -q "$ip4_addr via 127\.0\.0\.1 dev lo"
 	if [ $? -eq 0 ]; then
 		tst_res TFAIL "route not deleted"
 		return
-- 
2.47.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2024-12-19 13:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-17 14:50 [LTP] [PATCH 1/2] ip_tests.sh: Iprove grep count Petr Vorel
2024-12-17 14:50 ` [LTP] [PATCH 2/2] ip_tests.sh: Update TST_NEEDS_CMDS Petr Vorel
2024-12-17 21:33 ` [LTP] [PATCH 1/2] ip_tests.sh: Iprove grep count Petr Vorel
2024-12-18 17:37 ` Avinesh Kumar
2024-12-19  1:49   ` Wei Gao via ltp
2024-12-19 13:33     ` [LTP] [PATCH 1/2] ip_tests.sh: Improve " Petr Vorel

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