* [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* [LTP] [PATCH 2/2] ip_tests.sh: Update TST_NEEDS_CMDS
2024-12-17 14:50 [LTP] [PATCH 1/2] ip_tests.sh: Iprove grep count Petr Vorel
@ 2024-12-17 14:50 ` 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
2 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2024-12-17 14:50 UTC (permalink / raw)
To: ltp
Add 'ip' (obviously), 'lsmod' and 'modprobe'.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
testcases/network/iproute/ip_tests.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testcases/network/iproute/ip_tests.sh b/testcases/network/iproute/ip_tests.sh
index 0b1d5a85e6..77940481a1 100755
--- a/testcases/network/iproute/ip_tests.sh
+++ b/testcases/network/iproute/ip_tests.sh
@@ -12,7 +12,7 @@ TST_TESTFUNC="test"
TST_CLEANUP="cleanup"
TST_NEEDS_TMPDIR=1
TST_NEEDS_ROOT=1
-TST_NEEDS_CMDS="cat awk diff"
+TST_NEEDS_CMDS="awk cat diff ip lsmod modprobe"
TST_NEEDS_DRIVERS="dummy"
--
2.47.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH 1/2] ip_tests.sh: Iprove grep count
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 ` Petr Vorel
2024-12-18 17:37 ` Avinesh Kumar
2 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2024-12-17 21:33 UTC (permalink / raw)
To: ltp
Hi,
typo in the subject, I'll fix it before merge:
s/Iprove/Improve/
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH 1/2] ip_tests.sh: Iprove grep count
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
2 siblings, 1 reply; 6+ messages in thread
From: Avinesh Kumar @ 2024-12-18 17:37 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
Hi Petr,
On Tuesday, December 17, 2024 3:50:40 PM CET Petr Vorel wrote:
> 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>
Reviewed-by: Avinesh Kumar <akumar@suse.de>
for both the patches.
> ---
> 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
>
Regards,
Avinesh
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH 1/2] ip_tests.sh: Iprove grep count
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
0 siblings, 1 reply; 6+ messages in thread
From: Wei Gao via ltp @ 2024-12-19 1:49 UTC (permalink / raw)
To: Avinesh Kumar; +Cc: ltp
On Wed, Dec 18, 2024 at 06:37:26PM +0100, Avinesh Kumar wrote:
> Hi Petr,
>
> On Tuesday, December 17, 2024 3:50:40 PM CET Petr Vorel wrote:
> > 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>
>
> Reviewed-by: Avinesh Kumar <akumar@suse.de>
> for both the patches.
>
> > ---
> > 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
> >
Reviewed-by: Wei Gao <wegao@suse.com>
for both the patches.
Thanks
>
> Regards,
> Avinesh
>
>
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [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