Skip to contentSkip to conversation

tcp_cmds/ping: TCONF on unknown -f parameter

PATCH New Kory Maincent 2 participants 3 messages Nov 6, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tcp_cmds/ping: TCONF on unknown -f parameter

The ping from busybox does not have -f parameter.
Return TCONF in that case.

---
 testcases/network/tcp_cmds/ping/ping02.sh | 4 ++++
 1 file changed, 4 insertions(+)
testcases/network/tcp_cmds/ping/ping02.sh +4 -0
index e0a63c5f6..6daf22635 100755
@@ -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
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 tcp_cmds/ping: TCONF on unknown -f parameter

Quoted 13 lines · Kory Maincent

The ping from busybox does not have -f parameter.
Return TCONF in that case.

---
 testcases/network/tcp_cmds/ping/ping02.sh | 4 ++++
 1 file changed, 4 insertions(+)
testcases/network/tcp_cmds/ping/ping02.sh +0 -0
index e0a63c5f6..6daf22635 100755

testcases/network/tcp_cmds/ping/ping02.sh do_test() · line 31

Quoted 5 lines
testcases/network/tcp_cmds/ping/ping02.sh +2 -0
@@ -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'?

Quoted 6 lines
testcases/network/tcp_cmds/ping/ping02.sh +2 -0
+	fi
+
 	for s in $PACKETSIZES; do
 		EXPECT_PASS $PING -c $COUNT -f -s $s $ipaddr -p "$pat" \>/dev/null
 	done
#2 lore raw

PATCH 1/1 tcp_cmds/ping: TCONF on unknown -f parameter

Hello Alexey,

Quoted 17 lines · On Fri, 6 Nov 2020 14:38:33 +0300 Alexey Kodanev <[email protected]>…
Quoted 16 lines · Kory Maincent

The ping from busybox does not have -f parameter.
Return TCONF in that case.

---
 testcases/network/tcp_cmds/ping/ping02.sh | 4 ++++
 1 file changed, 4 insertions(+)
(quoted diff) +0 -0

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

Quoted 6 lines

testcases/network/tcp_cmds/ping/ping02.sh do_test() · line 31

Quoted 2 lines
testcases/network/tcp_cmds/ping/ping02.sh +2 -0
+	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,

Quoted 9 lines
Quoted 8 lines
testcases/network/tcp_cmds/ping/ping02.sh +2 -0
+	fi
+
 	for s in $PACKETSIZES; do
 		EXPECT_PASS $PING -c $COUNT -f -s $s $ipaddr -p

"$pat" \>/dev/null done

Signature · 3 lines
K?ry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com