Skip to contentSkip to conversation

selftests: cmsg_ipv6: repeat the exact packet

PATCH Applied Jakub Kicinski 3 participants 3 messages Feb 4, 2024 – Feb 7, 2024

Subsystems (3)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/1 selftests: cmsg_ipv6: repeat the exact packet

cmsg_ipv6 test requests tcpdump to capture 4 packets, and sends until tcpdump quits. Only the first packet is "real", however, and the rest are basic UDP packets. So if tcpdump doesn't start in time it will miss the real packet and only capture the UDP ones.

This makes the test fail on slow machine (no KVM or with debug enabled) 100% of the time, while it passes in fast environments.

Repeat the "real" / expected packet.

Fixes 9657ad09e1fa ("selftests: net: test IPV6_TCLASS")

---
CC: [email protected]
CC: [email protected]

---
 tools/testing/selftests/net/cmsg_ipv6.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/net/cmsg_ipv6.sh +2 -2
index f30bd57d5e38..8bc23fb4c82b 100755
@@ -89,7 +89,7 @@ for ovr in setsock cmsg both diff; do
 	check_result $? 0 "TCLASS $prot $ovr - pass"
 
 	while [ -d /proc/$BG ]; do
-	    $NSEXE ./cmsg_sender -6 -p u $TGT6 1234
+	    $NSEXE ./cmsg_sender -6 -p $p $m $((TOS2)) $TGT6 1234
 	done
 
 	tcpdump -r $TMPF -v 2>&1 | grep "class $TOS2" >> /dev/null
@@ -126,7 +126,7 @@ for ovr in setsock cmsg both diff; do
 	check_result $? 0 "HOPLIMIT $prot $ovr - pass"
 
 	while [ -d /proc/$BG ]; do
-	    $NSEXE ./cmsg_sender -6 -p u $TGT6 1234
+	    $NSEXE ./cmsg_sender -6 -p $p $m $LIM $TGT6 1234
 	done
 
 	tcpdump -r $TMPF -v 2>&1 | grep "hlim $LIM[^0-9]" >> /dev/null
Signature · 1 line
2.43.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Jakub Kicinski

cmsg_ipv6 test requests tcpdump to capture 4 packets, and sends until tcpdump quits. Only the first packet is "real", however, and the rest are basic UDP packets. So if tcpdump doesn't start in time it will miss the real packet and only capture the UDP ones.

Quoted 8 lines

This makes the test fail on slow machine (no KVM or with debug enabled) 100% of the time, while it passes in fast environments.

Repeat the "real" / expected packet.

Fixes 9657ad09e1fa ("selftests: net: test IPV6_TCLASS")

I'm not sure if it is important, but doesn't this also:

Fixes 05ae83d5a4a2 ("selftests: net: test IPV6_HOPLIMIT")

In any case, this looks good to me.

#2 lore raw
In reply to Jakub Kicinski
This patch was applied to netdev/net.git (main) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:

Quoted 11 lines · On Sun, 4 Feb 2024 08:56:18 -0800 you wrote:

cmsg_ipv6 test requests tcpdump to capture 4 packets, and sends until tcpdump quits. Only the first packet is "real", however, and the rest are basic UDP packets. So if tcpdump doesn't start in time it will miss the real packet and only capture the UDP ones.

This makes the test fail on slow machine (no KVM or with debug enabled) 100% of the time, while it passes in fast environments.

[...]

Here is the summary with links:
- [net] selftests: cmsg_ipv6: repeat the exact packet

    https://git.kernel.org/netdev/net/c/4b00d0c513da

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html