diff mbox series

tcp_cmds/ping: TCONF on unknown -f parameter

Message ID 20201106103748.20241-1-kory.maincent@bootlin.com
State Changes Requested
Headers show
Series tcp_cmds/ping: TCONF on unknown -f parameter | expand

Commit Message

Kory Maincent Nov. 6, 2020, 10:37 a.m. UTC
The ping from busybox does not have -f parameter.
Return TCONF in that case.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
---
 testcases/network/tcp_cmds/ping/ping02.sh | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Alexey Kodanev Nov. 6, 2020, 11:38 a.m. UTC | #1
On 06.11.2020 13:37, Kory Maincent wrote:
> The ping from busybox does not have -f parameter.
> Return TCONF in that case.
> 
> Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
> ---
>  testcases/network/tcp_cmds/ping/ping02.sh | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/testcases/network/tcp_cmds/ping/ping02.sh b/testcases/network/tcp_cmds/ping/ping02.sh
> index e0a63c5f6..6daf22635 100755
> --- a/testcases/network/tcp_cmds/ping/ping02.sh
> +++ b/testcases/network/tcp_cmds/ping/ping02.sh
> @@ -27,6 +27,10 @@ do_test()
>  	local ipaddr=$(tst_ipaddr rhost)
>  	local s
>  
> +	if ! $PING -c 1 -f $ipaddr >/dev/null; then
> +		tst_brk TCONF "$PING: invalid option -- 'f'"

Hi Kory,

If it's not supported, what about replacing it with '-i 0'?


> +	fi
> +
>  	for s in $PACKETSIZES; do
>  		EXPECT_PASS $PING -c $COUNT -f -s $s $ipaddr -p "$pat" \>/dev/null
>  	done
>
Kory Maincent Nov. 6, 2020, 1:42 p.m. UTC | #2
Hello Alexey,

On Fri, 6 Nov 2020 14:38:33 +0300
Alexey Kodanev <alexey.kodanev@oracle.com> wrote:

> On 06.11.2020 13:37, Kory Maincent wrote:
> > The ping from busybox does not have -f parameter.
> > Return TCONF in that case.
> > 
> > Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
> > ---
> >  testcases/network/tcp_cmds/ping/ping02.sh | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/testcases/network/tcp_cmds/ping/ping02.sh
> > b/testcases/network/tcp_cmds/ping/ping02.sh index
> > e0a63c5f6..6daf22635 100755 ---
> > a/testcases/network/tcp_cmds/ping/ping02.sh +++
> > b/testcases/network/tcp_cmds/ping/ping02.sh @@ -27,6 +27,10 @@
> > do_test() local ipaddr=$(tst_ipaddr rhost)
> >  	local s
> >  
> > +	if ! $PING -c 1 -f $ipaddr >/dev/null; then
> > +		tst_brk TCONF "$PING: invalid option -- 'f'"  
> 
> Hi Kory,
> 
> If it's not supported, what about replacing it with '-i 0'?

Ah yes good idea, thanks.

Regards,

> 
> 
> > +	fi
> > +
> >  	for s in $PACKETSIZES; do
> >  		EXPECT_PASS $PING -c $COUNT -f -s $s $ipaddr -p
> > "$pat" \>/dev/null done
> >   
>
diff mbox series

Patch

diff --git a/testcases/network/tcp_cmds/ping/ping02.sh b/testcases/network/tcp_cmds/ping/ping02.sh
index e0a63c5f6..6daf22635 100755
--- a/testcases/network/tcp_cmds/ping/ping02.sh
+++ b/testcases/network/tcp_cmds/ping/ping02.sh
@@ -27,6 +27,10 @@  do_test()
 	local ipaddr=$(tst_ipaddr rhost)
 	local s
 
+	if ! $PING -c 1 -f $ipaddr >/dev/null; then
+		tst_brk TCONF "$PING: invalid option -- 'f'"
+	fi
+
 	for s in $PACKETSIZES; do
 		EXPECT_PASS $PING -c $COUNT -f -s $s $ipaddr -p "$pat" \>/dev/null
 	done