Skip to content

Commit 9420779

Browse files
committed
tests: system-traffic: Fix checks for wrong checksums in NAT tests.
Tests are matching on words 'wrong' and 'bad' in tcpdump output to capture reports about incorrect checksums. However, 'bad' is a valid hex string and can occur as part of IPv6 flowlabel or some other parts of the packet. Let's match on words instead of simply sub-strings. Example of the failed check from our CI: $ tcpdump -n -v "icmp6" -r p0.pcap 2>/dev/null | grep -E 'wrong|bad' 11:37:41.485535 IP6 (flowlabel 0xbad6a, hlim 64, next-header ICMPv6 (58), ... fc00::2 > fc00::1:[icmp6 sum ok] ICMP6 Also, let's actually log the output so it's easier to understand what happened from the log without the need to run tcpdump manually on the captured pcap manually. Chances to hit this issue are quite low, but it happened more than once at this point. Fixes: b020a41 ("System Tests: Enhance NAT tests.") Acked-by: Eelco Chaudron <echaudron@ovn.org> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
1 parent d00f566 commit 9420779

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎tests/system-traffic.at‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7955,7 +7955,8 @@ AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(10.1.1.2) | sed -e 's/dst=
79557955
udp,orig=(src=10.1.1.1,dst=10.1.1.2,sport=<cleared>,dport=<cleared>),reply=(src=10.1.1.2,dst=10.1.1.2XX,sport=<cleared>,dport=<cleared>),mark=1
79567956
])
79577957

7958-
AT_CHECK([tcpdump -n -v "icmp" -r p0.pcap 2>/dev/null | grep -E 'wrong|bad'], [1], [ignore-nolog])
7958+
AT_CHECK([tcpdump -n -v "icmp" -r p0.pcap 2>/dev/null \
7959+
| grep -E '\<wrong\>|\<bad\>'], [1], [ignore])
79597960

79607961
OVS_TRAFFIC_VSWITCHD_STOP
79617962
AT_CLEANUP
@@ -8044,7 +8045,8 @@ AT_CHECK([ovs-ofctl -O OpenFlow15 dump-flows br0 | ofctl_strip | ofctl_strip_byt
80448045
OFPST_FLOW reply (OF1.5):
80458046
])
80468047

8047-
AT_CHECK([tcpdump -n -v "icmp" -r p0.pcap 2>/dev/null | grep -E 'wrong|bad'], [1], [ignore-nolog])
8048+
AT_CHECK([tcpdump -n -v "icmp" -r p0.pcap 2>/dev/null \
8049+
| grep -E '\<wrong\>|\<bad\>'], [1], [ignore])
80488050

80498051
OVS_TRAFFIC_VSWITCHD_STOP
80508052
AT_CLEANUP
@@ -8797,7 +8799,8 @@ sleep 1
87978799
dnl UDP packets from ns0->ns1 should solicit "destination unreachable" response.
87988800
NS_CHECK_EXEC([at_ns0], [echo a | nc -6 $NC_EOF_OPT -u fc00::2 1])
87998801

8800-
AT_CHECK([tcpdump -n -v "icmp6" -r p0.pcap 2>/dev/null | grep -E 'wrong|bad'], [1], [ignore-nolog])
8802+
AT_CHECK([tcpdump -n -v "icmp6" -r p0.pcap 2>/dev/null \
8803+
| grep -E '\<wrong\>|\<bad\>'], [1], [ignore])
88018804

88028805
AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(fc00::2)], [0], [dnl
88038806
udp,orig=(src=fc00::1,dst=fc00::2,sport=<cleared>,dport=<cleared>),reply=(src=fc00::2,dst=fc00::240,sport=<cleared>,dport=<cleared>)

0 commit comments

Comments
 (0)