diff mbox series

[ovs-dev] system-test: Fix tcpdump usage in LB template tests.

Message ID 20231204230918.3266867-1-dceara@redhat.com
State Accepted
Headers show
Series [ovs-dev] system-test: Fix tcpdump usage in LB template tests. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes success github build: passed

Commit Message

Dumitru Ceara Dec. 4, 2023, 11:09 p.m. UTC
Make sure the capture is up before continuing the test.
A similar fix was committed earlier via 6c4ffe5f111f
("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: 086744a645a7 ("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.
---
 tests/system-ovn.at | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Eelco Chaudron Dec. 7, 2023, 12:18 p.m. UTC | #1
On 5 Dec 2023, at 0:09, Dumitru Ceara wrote:

> Make sure the capture is up before continuing the test.
> A similar fix was committed earlier via 6c4ffe5f111f
> ("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: 086744a645a7 ("northd: Use LB port_str in northd.")
> Reported-at: https://issues.redhat.com/browse/FDP-192
> Signed-off-by: Dumitru Ceara <dceara@redhat.com>

This change looks good to me, we use similar checks in OVS.

Acked-by: Eelco Chaudron <echaudro@redhat.com>
Dumitru Ceara Dec. 7, 2023, 1:19 p.m. UTC | #2
On 12/7/23 13:18, Eelco Chaudron wrote:
> 
> 
> On 5 Dec 2023, at 0:09, Dumitru Ceara wrote:
> 
>> Make sure the capture is up before continuing the test.
>> A similar fix was committed earlier via 6c4ffe5f111f
>> ("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: 086744a645a7 ("northd: Use LB port_str in northd.")
>> Reported-at: https://issues.redhat.com/browse/FDP-192
>> Signed-off-by: Dumitru Ceara <dceara@redhat.com>
> 
> This change looks good to me, we use similar checks in OVS.
> 
> Acked-by: Eelco Chaudron <echaudro@redhat.com>
> 

Thanks, Eelco!  I pushed this to main and stable branches down to 22.12.

Regards,
Dumitru
diff mbox series

Patch

diff --git a/tests/system-ovn.at b/tests/system-ovn.at
index c454526073..58c3142d7f 100644
--- a/tests/system-ovn.at
+++ b/tests/system-ovn.at
@@ -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])
@@ -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])