diff mbox series

[3/3] network/tst_net.sh: extend the pattern in tst_ping_opt_unsupported()

Message ID 20210804120446.32835-3-aleksei.kodanev@bell-sw.com
State Accepted
Headers show
Series [1/3] network/tcp_cc: check sch_netem driver in the lib | expand

Commit Message

Alexey Kodanev Aug. 4, 2021, 12:04 p.m. UTC
Signed-off-by: Alexey Kodanev <aleksei.kodanev@bell-sw.com>
---
 testcases/lib/tst_net.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Petr Vorel Aug. 20, 2021, 10:46 a.m. UTC | #1
Hi Alexey,

> -	ping $@ 2>&1 | grep -q "invalid option"
> +	ping $@ 2>&1 | grep -qE "(invalid|unrecognized) option"

Which implementation needs it? Both ping from iputils and busybox report
"invalid option".

Kind regards,
Petr
Alexey Kodanev Aug. 20, 2021, 11:28 a.m. UTC | #2
Hi Petr,
On 20.08.2021 13:46, Petr Vorel wrote:
> Hi Alexey,
> 
>> -	ping $@ 2>&1 | grep -q "invalid option"
>> +	ping $@ 2>&1 | grep -qE "(invalid|unrecognized) option"
> 
> Which implementation needs it? Both ping from iputils and busybox report
> "invalid option".
> 

It's busybox/ping that is using musl libc getopt():
misc/getopt.c:			__getopt_msg(argv[0], ": unrecognized option: ", optchar, k);
Petr Vorel Aug. 20, 2021, 12:29 p.m. UTC | #3
Hi Alexey,

> Hi Petr,
> On 20.08.2021 13:46, Petr Vorel wrote:
> > Hi Alexey,

> >> -	ping $@ 2>&1 | grep -q "invalid option"
> >> +	ping $@ 2>&1 | grep -qE "(invalid|unrecognized) option"

> > Which implementation needs it? Both ping from iputils and busybox report
> > "invalid option".


> It's busybox/ping that is using musl libc getopt():
> misc/getopt.c:			__getopt_msg(argv[0], ": unrecognized option: ", optchar, k);

Ah, thx for info.
Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr
diff mbox series

Patch

diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
index bb30c13ec..c15413a6d 100644
--- a/testcases/lib/tst_net.sh
+++ b/testcases/lib/tst_net.sh
@@ -811,7 +811,7 @@  tst_netload_compare()
 
 tst_ping_opt_unsupported()
 {
-	ping $@ 2>&1 | grep -q "invalid option"
+	ping $@ 2>&1 | grep -qE "(invalid|unrecognized) option"
 }
 
 # tst_ping -c COUNT -s MESSAGE_SIZES -p PATTERN -I IFACE -H HOST