Skip to content

Commit 96984fb

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 b7efdca commit 96984fb

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
@@ -7880,7 +7880,8 @@ AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(10.1.1.2) | sed -e 's/dst=
78807880
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
78817881
])
78827882

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

78857886
OVS_TRAFFIC_VSWITCHD_STOP
78867887
AT_CLEANUP
@@ -7969,7 +7970,8 @@ AT_CHECK([ovs-ofctl -O OpenFlow15 dump-flows br0 | ofctl_strip | ofctl_strip_byt
79697970
OFPST_FLOW reply (OF1.5):
79707971
])
79717972

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

79747976
OVS_TRAFFIC_VSWITCHD_STOP
79757977
AT_CLEANUP
@@ -8720,7 +8722,8 @@ sleep 1
87208722
dnl UDP packets from ns0->ns1 should solicit "destination unreachable" response.
87218723
NS_CHECK_EXEC([at_ns0], [bash -c "echo a | nc -6 $NC_EOF_OPT -u fc00::2 1"])
87228724

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

87258728
AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(fc00::2)], [0], [dnl
87268729
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)