Four ECMP tests pipe one packet, wait one second, and then pipe a second
packet into an Ncat client. The daemonized listener sees EOF on its own
stdin and normally half-closes its TCP write side, sending FIN to the
client.
Ncat 7.96 includes commit dd4a7906d652 ("Change Ncat default behavior
to avoid TCP half-closed connections"). It changed connect mode to exit
when the peer half-closes. With that release or newer, the client exits
on the listener FIN before the shell writes the second packet. OVN CI
currently uses Ncat 7.92 on Fedora and 7.94 on Ubuntu, while NixOS uses
7.99.
Adding -k to the client would restore the old behavior on new Ncat, but
older releases reject -k in connect mode. --no-shutdown has been
available since Ncat 7.00 and prevents the listener from sending FIN,
so it works with both old and new clients.
Set this option only for Ncat and only on the four listeners whose tests
require the delayed second write. Other netcat implementations and tests
retain their existing behavior.
Assisted-by: Codex gpt-5.6-sol high
Signed-off-by: Ihar Hrachyshka <[email protected]>
Acked-by: Han Zhou <[email protected]>
---
tests/atlocal.in | 2 ++
tests/system-ovn.at | 8 ++++----
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/tests/atlocal.in b/tests/atlocal.in
index 40635266f..7e70b449c 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -148,9 +148,11 @@ else
fi
# Determine correct netcat option to quit on stdin EOF
+NC_LISTEN_OPT=
if "$NC" --version 2>&1 | grep -q nmap.org; then
# Nmap netcat
NC_EOF_OPT="--send-only -w 5"
+ NC_LISTEN_OPT="--no-shutdown"
else
# BSD netcat
NC_EOF_OPT="-q 1 -w 5"
diff --git a/tests/system-ovn.at b/tests/system-ovn.at
index 8d20b952a..5a7b6112d 100644
--- a/tests/system-ovn.at
+++ b/tests/system-ovn.at
@@ -6662,7 +6662,7 @@ AT_CHECK([ovs-appctl dpctl/flush-conntrack])
NS_CHECK_EXEC([bob1], [ip r d default via 172.16.0.2 dev bob1], [0])
NS_CHECK_EXEC([bob1], [ip r a default via 172.16.0.3 dev bob1], [0])
-NETNS_DAEMONIZE([bob1], [$NC -l -k 8080], [bob1.pid])
+NETNS_DAEMONIZE([bob1], [$NC $NC_LISTEN_OPT -l -k 8080], [bob1.pid])
NS_CHECK_EXEC([alice1], [(echo "Packet 1"; sleep 1; echo "Packet 2") | $NC
172.16.0.1 8080], [0])
NS_CHECK_EXEC([alice1], [ping -q -c 3 -i 0.3 -w 2 172.16.0.1 | FORMAT_PING], \
[0], [dnl
@@ -6680,7 +6680,7 @@
tcp,orig=(src=10.0.0.2,dst=172.16.0.1,sport=<cleared>,dport=<cleared>),reply=(sr
check ovn-nbctl --policy="src-ip" lr-route-del R1 10.0.0.0/24 20.0.0.3
check ovn-nbctl --wait=hv sync
AT_CHECK([ovs-appctl dpctl/flush-conntrack])
-NETNS_DAEMONIZE([bob1], [$NC -l -k 8081], [bob2.pid])
+NETNS_DAEMONIZE([bob1], [$NC $NC_LISTEN_OPT -l -k 8081], [bob2.pid])
NS_CHECK_EXEC([alice1], [(echo "Packet 1"; sleep 1; echo "Packet 2") | $NC
172.16.0.1 8081], [0])
NS_CHECK_EXEC([alice1], [ping -q -c 3 -i 0.3 -w 2 172.16.0.1 | FORMAT_PING], \
[0], [dnl
@@ -6889,7 +6889,7 @@ test $(ovs-ofctl dump-flows br-int | grep -c
'table=OFTABLE_ECMP_NH, n_packets')
AT_CHECK([ovs-appctl dpctl/flush-conntrack])
-NETNS_DAEMONIZE([bob1], [$NC -6 -l -k 8080], [bob1.pid])
+NETNS_DAEMONIZE([bob1], [$NC $NC_LISTEN_OPT -6 -l -k 8080], [bob1.pid])
NS_CHECK_EXEC([alice1], [(echo "Packet 1"; sleep 1; echo "Packet 2") | $NC -6
fd07::1 8080], [0])
NS_CHECK_EXEC([alice1], [ping -q -c 3 -i 0.3 -w 2 fd07::1 | FORMAT_PING], \
[0], [dnl
@@ -6907,7 +6907,7 @@
tcp,orig=(src=fd01::2,dst=fd07::1,sport=<cleared>,dport=<cleared>),reply=(src=fd
check ovn-nbctl --policy="src-ip" lr-route-del R1 fd01::/126 fd02::3
check ovn-nbctl --wait=hv sync
AT_CHECK([ovs-appctl dpctl/flush-conntrack])
-NETNS_DAEMONIZE([bob1], [$NC -6 -l -k 8081], [bob2.pid])
+NETNS_DAEMONIZE([bob1], [$NC $NC_LISTEN_OPT -6 -l -k 8081], [bob2.pid])
NS_CHECK_EXEC([alice1], [(echo "Packet 1"; sleep 1; echo "Packet 2") | $NC -6
fd07::1 8081], [0])
NS_CHECK_EXEC([alice1], [ping -q -c 3 -i 0.3 -w 2 fd07::1 | FORMAT_PING], \
[0], [dnl
--
2.54.0
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev