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: b020a416e24c ("System Tests: Enhance NAT tests.")
Signed-off-by: Ilya Maximets <[email protected]>
---
 tests/system-traffic.at | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests/system-traffic.at b/tests/system-traffic.at
index a1794ceca..eca0f1b96 100644
--- a/tests/system-traffic.at
+++ b/tests/system-traffic.at
@@ -7955,7 +7955,8 @@ AT_CHECK([ovs-appctl dpctl/dump-conntrack | 
FORMAT_CT(10.1.1.2) | sed -e 's/dst=
 
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
 ])
 
-AT_CHECK([tcpdump -n -v "icmp" -r p0.pcap 2>/dev/null | grep -E 'wrong|bad'], 
[1], [ignore-nolog])
+AT_CHECK([tcpdump -n -v "icmp" -r p0.pcap 2>/dev/null \
+            | grep -E '\<wrong\>|\<bad\>'], [1], [ignore])
 
 OVS_TRAFFIC_VSWITCHD_STOP
 AT_CLEANUP
@@ -8044,7 +8045,8 @@ AT_CHECK([ovs-ofctl -O OpenFlow15 dump-flows br0 | 
ofctl_strip | ofctl_strip_byt
 OFPST_FLOW reply (OF1.5):
 ])
 
-AT_CHECK([tcpdump -n -v "icmp" -r p0.pcap 2>/dev/null | grep -E 'wrong|bad'], 
[1], [ignore-nolog])
+AT_CHECK([tcpdump -n -v "icmp" -r p0.pcap 2>/dev/null \
+            | grep -E '\<wrong\>|\<bad\>'], [1], [ignore])
 
 OVS_TRAFFIC_VSWITCHD_STOP
 AT_CLEANUP
@@ -8797,7 +8799,8 @@ sleep 1
 dnl UDP packets from ns0->ns1 should solicit "destination unreachable" 
response.
 NS_CHECK_EXEC([at_ns0], [echo a | nc -6 $NC_EOF_OPT -u fc00::2 1])
 
-AT_CHECK([tcpdump -n -v "icmp6" -r p0.pcap 2>/dev/null | grep -E 'wrong|bad'], 
[1], [ignore-nolog])
+AT_CHECK([tcpdump -n -v "icmp6" -r p0.pcap 2>/dev/null \
+            | grep -E '\<wrong\>|\<bad\>'], [1], [ignore])
 
 AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(fc00::2)], [0], [dnl
 
udp,orig=(src=fc00::1,dst=fc00::2,sport=<cleared>,dport=<cleared>),reply=(src=fc00::2,dst=fc00::240,sport=<cleared>,dport=<cleared>)
-- 
2.56.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to