Fixes: b42edf4a43b3 ("northd, controller, tests: Network Function Health 
monitoring.")
Suggested-by: Dumitru Ceara <[email protected]>
CC: Sragdhara Datta Chaudhuri <[email protected]>
Signed-off-by: Naveen Yerramneni <[email protected]>
---
v1:
- First patch
 
v2:
- Addressed "Fixes" tag formatting issue
---
 tests/system-ovn.at | 25 +++++++++----------------
 1 file changed, 9 insertions(+), 16 deletions(-)

diff --git a/tests/system-ovn.at b/tests/system-ovn.at
index eb22e9ec6..ca0d3c77b 100644
--- a/tests/system-ovn.at
+++ b/tests/system-ovn.at
@@ -18989,7 +18989,7 @@ $recv_data
     : > output.txt
 
     OVS_WAIT_UNTIL([
-        total_pkts=$(cat pkt.pcap | wc -l)
+        total_pkts=$(cat tcpdump-nf.tcpdump | wc -l)
         test ${total_pkts} -ge ${pkt_cnt}
     ])
 }
@@ -19017,9 +19017,7 @@ Server Ready
     AS_BOX([$direction: Verify traffic forwarding through single NF without 
health check])
 
     # Capture traffic on nf0
-    NS_CHECK_EXEC([nf], [tcpdump -l -nvv -i nf-p1 tcp > pkt.pcap 2>tcpdump_err 
&])
-    OVS_WAIT_UNTIL([grep "listening" tcpdump_err])
-    on_exit 'kill $(pidof tcpdump)'
+    NETNS_START_TCPDUMP([nf], [-nvv -i nf-p1 tcp], [tcpdump-nf])
 
     # Verify no service monitors exist when health check is not configured
     #AT_CHECK([ovn-sbctl list service_monitor | grep -v "^$"], [1])
@@ -19029,7 +19027,7 @@ Server Ready
 
     validate_traffic "test" "test" 5
 
-    kill $(pidof tcpdump)
+    kill $(cat tcpdump-nf.pid)
     kill $(cat client.pid)
     kill $(cat server.pid)
     rm -f client.pid server.pid /tmp/nffifo
@@ -19095,9 +19093,7 @@ Server Ready
     NS_CHECK_EXEC([nf], [ip link set dev br0 up])
     NS_CHECK_EXEC([nf], [ip link set dev br1 down])
 
-    NS_CHECK_EXEC([nf], [tcpdump -l -nvv -i nf-p1 tcp > pkt.pcap 2>tcpdump_err 
&])
-    OVS_WAIT_UNTIL([grep "listening" tcpdump_err])
-    on_exit 'kill $(pidof tcpdump)'
+    NETNS_START_TCPDUMP([nf], [-nvv -i nf-p1 tcp], [tcpdump-nf])
 
     # sleep to allow service_monitor to detect the state
     sleep 5
@@ -19109,10 +19105,8 @@ Server Ready
 
     AS_BOX([$direction: Verify traffic forwarding through NF when nf1 is 
active])
 
-    kill $(pidof tcpdump)
-    NS_CHECK_EXEC([nf], [tcpdump -l -nvv -i nf-p3 tcp > pkt.pcap 2>tcpdump_err 
&])
-    OVS_WAIT_UNTIL([grep "listening" tcpdump_err])
-    on_exit 'kill $(pidof tcpdump)'
+    kill $(cat tcpdump-nf.pid)
+    NETNS_START_TCPDUMP([nf], [-nvv -i nf-p3 tcp], [tcpdump-nf])
 
     # Bring nf0 down and nf1 up
     NS_CHECK_EXEC([nf], [ip link set dev br0 down])
@@ -19127,10 +19121,8 @@ Server Ready
 
     AS_BOX([$direction: Verify traffic forwarding through NF when nf0 and nf1 
are down])
 
-    kill $(pidof tcpdump)
-    NS_CHECK_EXEC([nf], [tcpdump -l -nvv -i nf-p3 tcp > pkt.pcap 2>tcpdump_err 
&])
-    OVS_WAIT_UNTIL([grep "listening" tcpdump_err])
-    on_exit 'kill $(pidof tcpdump)'
+    kill $(cat tcpdump-nf.pid)
+    NETNS_START_TCPDUMP([nf], [-nvv -i nf-p3 tcp], [tcpdump-nf])
 
     # Bring nf0 down and nf1 up
     NS_CHECK_EXEC([nf], [ip link set dev br1 down])
@@ -19142,6 +19134,7 @@ Server Ready
 
     validate_traffic "test" "" 0
 
+    kill $(cat tcpdump-nf.pid)
     kill $(cat client.pid)
     kill $(cat server.pid)
     rm -f client.pid
-- 
2.43.5

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

Reply via email to