Skip to content

Commit

Permalink
system-test: Fix tcpdump usage in LB template tests.
Browse files Browse the repository at this point in the history
Otherwise tcpdump might not print anything until the interface goes away
making the test fail.  Also, make sure the capture is up before
continuing the test.  A similar fix was committed earlier via
6c4ffe5 ("system-test: Use OVS_WAIT_UNTIL for tcpdump start instead
fo sleep") but other tests were added in the meantime.

Suggested-by: Xavier Simonart <xsimonar@redhat.com>
Fixes: 086744a ("northd: Use LB port_str in northd.")
Reported-at: https://issues.redhat.com/browse/FDP-192
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
---
NOTE: we should probably try to find a unified way of using tcpdump
throughout the test suite.  However, since the LB template tests fail
quite often in CI, I'd like to find a quick fix for them for now so that
we simplify the work maintainers have to do on every patch.
  • Loading branch information
dceara committed Dec 4, 2023
1 parent 8c165db commit 872ad33
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/system-ovn.at
Original file line number Diff line number Diff line change
Expand Up @@ -9213,8 +9213,9 @@ name: 'vport4' value: '999'
NETNS_DAEMONIZE([vm1], [nc -k -l 42.42.42.2 4242], [nc-vm1.pid])

NETNS_DAEMONIZE([vm1],
[tcpdump -n -i vm1 -nnleX -c6 udp and dst 42.42.42.2 and dst port 4343 > vm1.pcap 2>/dev/null],
[tcpdump -n -i vm1 -nnleX -c6 udp and dst 42.42.42.2 and dst port 4343 > vm1.pcap 2> vm1.pcap.stderr],
[tcpdump1.pid])
OVS_WAIT_UNTIL([grep "listening" vm1.pcap.stderr])

# Make sure connecting to the VIP works (hairpin, via ls and via lr).
NS_CHECK_EXEC([vm1], [nc 66.66.66.66 666 -z], [0], [ignore], [ignore])
Expand Down Expand Up @@ -9364,8 +9365,9 @@ name: 'vport4' value: '999'
NETNS_DAEMONIZE([vm1], [nc -k -l 4242::2 4242], [nc-vm1.pid])

NETNS_DAEMONIZE([vm1],
[tcpdump -n -i vm1 -nnleX -c6 udp and dst 4242::2 and dst port 4343 > vm1.pcap 2>/dev/null],
[tcpdump -n -i vm1 -nnleX -c6 udp and dst 4242::2 and dst port 4343 > vm1.pcap 2> vm1.pcap.stderr],
[tcpdump1.pid])
OVS_WAIT_UNTIL([grep "listening" vm1.pcap.stderr])

# Make sure connecting to the VIP works (hairpin, via ls and via lr).
NS_CHECK_EXEC([vm1], [nc 6666::1 666 -z], [0], [ignore], [ignore])
Expand Down

0 comments on commit 872ad33

Please sign in to comment.