selftests: cmsg_ipv6: repeat the exact packet
Subsystems (3)
Jakub Kicinski
maintainerPATCH 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.
---
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
@@ -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
Quoted 6 lines · Jakub Kicinski
cmsg_ipv6test 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")Signed-off-by Jakub Kicinski <[email protected]>
I'm not sure if it is important, but doesn't this also:
In any case, this looks good to me.
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_ipv6test 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