Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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")
Fixes: 05ae83d5a4a2 ("selftests: net: test IPV6_HOPLIMIT")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Jakub Kicinski and committed by
David S. Miller
4b00d0c5 38cc3c6d

+2 -2
+2 -2
tools/testing/selftests/net/cmsg_ipv6.sh
··· 89 89 check_result $? 0 "TCLASS $prot $ovr - pass" 90 90 91 91 while [ -d /proc/$BG ]; do 92 - $NSEXE ./cmsg_sender -6 -p u $TGT6 1234 92 + $NSEXE ./cmsg_sender -6 -p $p $m $((TOS2)) $TGT6 1234 93 93 done 94 94 95 95 tcpdump -r $TMPF -v 2>&1 | grep "class $TOS2" >> /dev/null ··· 126 126 check_result $? 0 "HOPLIMIT $prot $ovr - pass" 127 127 128 128 while [ -d /proc/$BG ]; do 129 - $NSEXE ./cmsg_sender -6 -p u $TGT6 1234 129 + $NSEXE ./cmsg_sender -6 -p $p $m $LIM $TGT6 1234 130 130 done 131 131 132 132 tcpdump -r $TMPF -v 2>&1 | grep "hlim $LIM[^0-9]" >> /dev/null