The ACL sampling test runs a one-line Python filter through Ncat exec
mode. It handles one datagram and exits. The test therefore depends on
Ncat closing that UDP pseudo-connection, returning to its -k listener,
and starting another child for the second datagram from the same client.

Ncat 7.96 includes commit b805bcf71d81 ("correctly handle EOF/error in
exec mode", GH#2843). It fixed exec mode to manage its input and output
directions independently. After child stdout reaches EOF, Ncat keeps the
socket-to-child direction open. The second datagram then reaches the
handler whose child has exited and is not echoed.

That removes the delayed reply which should reach the closed client
port. The expected ICMP error is also absent, so the IPFIX packet count
does not reach 30. Current Fedora and Ubuntu OVN CI use pre-7.96 Ncat
releases; NixOS uses Ncat 7.99 and exposes the assumption.

Use a real Python UDP server which echoes every datagram and delays the
"bye" reply. This directly expresses the traffic sequence the test needs
without depending on Ncat child-process lifecycle behavior.

Assisted-by: Codex gpt-5.6-sol high
Signed-off-by: Ihar Hrachyshka <[email protected]>
Acked-by: Han Zhou <[email protected]>
---
 tests/system-ovn.at | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/tests/system-ovn.at b/tests/system-ovn.at
index a77e983e6..3817414f9 100644
--- a/tests/system-ovn.at
+++ b/tests/system-ovn.at
@@ -13143,15 +13143,19 @@ sock.close()
 ])
 
 AT_DATA([server.py], [dnl
+import socket
 import sys
 import time
 
-line = sys.stdin.readline()
-if "bye" in line:
-    time.sleep(1)
+port = int(sys.argv[[1]])
+sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+sock.bind(("0.0.0.0", port))
 
-sys.stdout.write(line)
-sys.stdout.flush()
+while True:
+    data, addr = sock.recvfrom(65535)
+    if b"bye" in data:
+        time.sleep(1)
+    sock.sendto(data, addr)
 ])
 
 dnl Wait for ovn-controller to catch up.
@@ -13174,12 +13178,12 @@ dnl And wait for it to be up and running.
 OVS_WAIT_UNTIL([ovs-ofctl dump-ipfix-flow br-int | grep -q '1 ids'])
 
 dnl Start UDP echo server on vm2.
-NETNS_DAEMONIZE([vm2], [$NC -e "$PYTHON ./server.py" -k -u -v -l -m 1 1000], 
[nc-vm2-1000.pid])
-NETNS_DAEMONIZE([vm2], [$NC -e "$PYTHON ./server.py" -k -u -v -l -m 1 1010], 
[nc-vm2-1010.pid])
-NETNS_DAEMONIZE([vm2], [$NC -e "$PYTHON ./server.py" -k -u -v -l -m 1 2000], 
[nc-vm2-2000.pid])
-NETNS_DAEMONIZE([vm2], [$NC -e "$PYTHON ./server.py" -k -u -v -l -m 1 2010], 
[nc-vm2-2010.pid])
-NETNS_DAEMONIZE([vm2], [$NC -e "$PYTHON ./server.py" -k -u -v -l -m 1 3000], 
[nc-vm2-3000.pid])
-NETNS_DAEMONIZE([vm2], [$NC -e "$PYTHON ./server.py" -k -u -v -l -m 1 3010], 
[nc-vm2-3010.pid])
+NETNS_DAEMONIZE([vm2], [$PYTHON3 ./server.py 1000], [server-vm2-1000.pid])
+NETNS_DAEMONIZE([vm2], [$PYTHON3 ./server.py 1010], [server-vm2-1010.pid])
+NETNS_DAEMONIZE([vm2], [$PYTHON3 ./server.py 2000], [server-vm2-2000.pid])
+NETNS_DAEMONIZE([vm2], [$PYTHON3 ./server.py 2010], [server-vm2-2010.pid])
+NETNS_DAEMONIZE([vm2], [$PYTHON3 ./server.py 3000], [server-vm2-3000.pid])
+NETNS_DAEMONIZE([vm2], [$PYTHON3 ./server.py 3010], [server-vm2-3010.pid])
 NETNS_START_TCPDUMP([vm2], [-i vm2 -vnne], [vm2])
 
 dnl Send traffic (2 packets) to the UDP LB1 (hits the from-lport ACL).
-- 
2.54.0

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

Reply via email to