The netcat 7.94 allows multiple connections over udp (-k/--keep-open) [0],
without this option the connection can be closed "unexpctedly". This
to keep the test backward compatible make new servers for every UDP
connection.

The second issue is that netcat is attempting to listen on IPv4 when
the there isn't any server address specified and fails to do so. Add
-6 flag to indicate that this is pure IPv6 connection.

[0] https://github.com/nmap/nmap/commit/4e6c8feb153c0c9ff8a68cd841669d650319ab45
Fixes: 40136a2f2c84 ("northd: Fix direct access to SNAT network.")
Signed-off-by: Ales Musil <[email protected]>
---
 tests/system-ovn.at | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/tests/system-ovn.at b/tests/system-ovn.at
index 41c051c1e..6dcdb45d1 100644
--- a/tests/system-ovn.at
+++ b/tests/system-ovn.at
@@ -3582,7 +3582,6 @@ test_connectivity_from_ext() {
     local ip=$1; shift
 
     # Start listening daemons for UDP and TCP connections
-    NETNS_DAEMONIZE($vm, [nc -l -u 1234], [nc-$vm-$ip-udp.pid])
     NETNS_DAEMONIZE($vm, [nc -l -k 1235], [nc-$vm-$ip-tcp.pid])
 
     # Ensure that vm can be pinged on the specified IP
@@ -3592,8 +3591,13 @@ test_connectivity_from_ext() {
 ])
 
     # Perform two consecutive UDP connections to the specified IP
+    NETNS_DAEMONIZE($vm, [nc -l -u 1234], [nc-$vm-$ip-udp.pid])
     NS_CHECK_EXEC([alice1], [nc -u $ip 1234 -p 2000 -z])
+    kill $(cat nc-$vm-$ip-udp.pid)
+
+    NETNS_DAEMONIZE($vm, [nc -l -u 1234], [nc-$vm-$ip-udp.pid])
     NS_CHECK_EXEC([alice1], [nc -u $ip 1234 -p 2000 -z])
+    kill $(cat nc-$vm-$ip-udp.pid)
 
     # Send data over TCP connection to the specified IP
     NS_CHECK_EXEC([alice1], [echo "TCP test" | nc --send-only $ip 1235])
@@ -3781,8 +3785,7 @@ test_connectivity_from_ext() {
     local ip=$1; shift
 
     # Start listening daemons for UDP and TCP connections
-    NETNS_DAEMONIZE($vm, [nc -l -u 1234], [nc-$vm-$ip-udp.pid])
-    NETNS_DAEMONIZE($vm, [nc -l -k 1235], [nc-$vm-$ip-tcp.pid])
+    NETNS_DAEMONIZE($vm, [nc -6 -l -k 1235], [nc-$vm-$ip-tcp.pid])
 
     # Ensure that vm can be pinged on the specified IP
     NS_CHECK_EXEC([alice1], [ping -q -c 3 -i 0.3 -w 2 $ip | FORMAT_PING], \
@@ -3791,8 +3794,13 @@ test_connectivity_from_ext() {
 ])
 
     # Perform two consecutive UDP connections to the specified IP
+    NETNS_DAEMONIZE($vm, [nc -6 -l -u 1234], [nc-$vm-$ip-udp.pid])
     NS_CHECK_EXEC([alice1], [nc -u $ip 1234 -p 2000 -z])
+    kill $(cat nc-$vm-$ip-udp.pid)
+
+    NETNS_DAEMONIZE($vm, [nc -6 -l -u 1234], [nc-$vm-$ip-udp.pid])
     NS_CHECK_EXEC([alice1], [nc -u $ip 1234 -p 2000 -z])
+    kill $(cat nc-$vm-$ip-udp.pid)
 
     # Send data over TCP connection to the specified IP
     NS_CHECK_EXEC([alice1], [echo "TCP test" | nc --send-only $ip 1235])
-- 
2.44.0

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

Reply via email to