From dc5b666d7dba02c0a5617605463967c86739568e Mon Sep 17 00:00:00 2001 From: Ales Musil Date: Tue, 27 Aug 2024 16:28:32 +0200 Subject: [PATCH] tests: Prevent netcat from forking. Netcat is able to handle multiple connections when "-k, --keep-open" "-e command, --exec command" by forking the netcat. Prevent this behavior by allowing only one connection at a time. This also prevents the test getting stuck on cleanup as the netcat PID wouldn't be added to the cleanup script. Fixes: d15b12da6fe6 ("northd: Add ACL Sampling.") Signed-off-by: Ales Musil Acked-by: Mark Michelson Signed-off-by: Mark Michelson --- tests/system-ovn.at | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/system-ovn.at b/tests/system-ovn.at index 0831a21088..78020ecda0 100644 --- a/tests/system-ovn.at +++ b/tests/system-ovn.at @@ -13169,12 +13169,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 /bin/cat -k -u -v -l 1000], [nc-vm2-1000.pid]) -NETNS_DAEMONIZE([vm2], [nc -e /bin/cat -k -u -v -l 1010], [nc-vm2-1010.pid]) -NETNS_DAEMONIZE([vm2], [nc -e /bin/cat -k -u -v -l 2000], [nc-vm2-2000.pid]) -NETNS_DAEMONIZE([vm2], [nc -e /bin/cat -k -u -v -l 2010], [nc-vm2-2010.pid]) -NETNS_DAEMONIZE([vm2], [nc -e /bin/cat -k -u -v -l 3000], [nc-vm2-3000.pid]) -NETNS_DAEMONIZE([vm2], [nc -e /bin/cat -k -u -v -l 3010], [nc-vm2-3010.pid]) +NETNS_DAEMONIZE([vm2], [nc -e /bin/cat -k -u -v -l -m 1 1000], [nc-vm2-1000.pid]) +NETNS_DAEMONIZE([vm2], [nc -e /bin/cat -k -u -v -l -m 1 1010], [nc-vm2-1010.pid]) +NETNS_DAEMONIZE([vm2], [nc -e /bin/cat -k -u -v -l -m 1 2000], [nc-vm2-2000.pid]) +NETNS_DAEMONIZE([vm2], [nc -e /bin/cat -k -u -v -l -m 1 2010], [nc-vm2-2010.pid]) +NETNS_DAEMONIZE([vm2], [nc -e /bin/cat -k -u -v -l -m 1 3000], [nc-vm2-3000.pid]) +NETNS_DAEMONIZE([vm2], [nc -e /bin/cat -k -u -v -l -m 1 3010], [nc-vm2-3010.pid]) dnl Send traffic (2 packets) to the UDP LB1 (hits the from-lport ACL). NS_CHECK_EXEC([vm1], [(echo a; sleep 1; echo a) | nc --send-only -u 43.43.43.43 1000]) @@ -13337,7 +13337,7 @@ 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 /bin/cat -k -u -v -l 1000], [nc-vm2-1000.pid]) +NETNS_DAEMONIZE([vm2], [nc -e /bin/cat -k -u -v -l -m 1 1000], [nc-vm2-1000.pid]) dnl Send traffic to the UDP server (hits both ACL tiers). NS_CHECK_EXEC([vm1], [echo a | nc --send-only -u 42.42.42.3 1000])