Skip to content

Commit e3c7970

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 4ac74a2 commit e3c7970

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
@@ -7463,7 +7463,8 @@ AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(10.1.1.2) | sed -e 's/dst=
74637463
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
74647464
])
74657465

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

74687469
OVS_TRAFFIC_VSWITCHD_STOP
74697470
AT_CLEANUP
@@ -7552,7 +7553,8 @@ AT_CHECK([ovs-ofctl -O OpenFlow15 dump-flows br0 | ofctl_strip | ofctl_strip_byt
75527553
OFPST_FLOW reply (OF1.5):
75537554
])
75547555

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

75577559
OVS_TRAFFIC_VSWITCHD_STOP
75587560
AT_CLEANUP
@@ -8303,7 +8305,8 @@ sleep 1
83038305
dnl UDP packets from ns0->ns1 should solicit "destination unreachable" response.
83048306
NS_CHECK_EXEC([at_ns0], [bash -c "echo a | nc -6 $NC_EOF_OPT -u fc00::2 1"])
83058307

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

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