On Sat, Jul 18, 2026 at 3:47 AM Ihar Hrachyshka <[email protected]>
wrote:

> NixOS does not provide /bin/cat. Its Coreutils commands are available
> through PATH, so echo-server tests which hard-code that pathname fail
> when Ncat tries to execute it.
>
> Ncat documents that --exec takes a full pathname. Resolve cat with
> command -v for those invocations. Commands passed through --sh-exec are
> interpreted by a shell and can use the unqualified cat name directly.
>
> This preserves the existing echo-server behavior without assuming the
> traditional filesystem hierarchy.
>
> Assisted-by: Codex gpt-5.6-sol high
> Signed-off-by: Ihar Hrachyshka <[email protected]>
> ---
>

Hi Ihar,

thank you for the patch, I have one question down below.


>  tests/multinode.at            | 2 +-
>  tests/system-common-macros.at | 6 +++---
>  tests/system-ovn-kmod.at      | 8 ++++----
>  tests/system-ovn.at           | 4 ++--
>  4 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/tests/multinode.at b/tests/multinode.at
> index 9dab187d4..868ff6da0 100644
> --- a/tests/multinode.at
> +++ b/tests/multinode.at
> @@ -2584,7 +2584,7 @@ M_NS_CHECK_EXEC([ovn-chassis-1], [external], [ping
> -q -c 5 -i 0.3 -w 2 10:200::2
>  ])
>
>  M_NS_CHECK_EXEC([ovn-chassis-1], [mgmt], [ip a a 172.16.100.2/24 dev
> mgmt])
> -M_NS_DAEMONIZE([ovn-chassis-1], [pod10], [nc -e /bin/cat -v -l -o
> server.log 10.100.200.10 2324], [pod10.pid])
> +M_NS_DAEMONIZE([ovn-chassis-1], [pod10], [nc -e "$(command -v cat)" -v -l
> -o server.log 10.100.200.10 2324], [pod10.pid])
>

Is this correct? That `nc` runs inside a container, which, to my knowledge
should be Fedora, so we might pass wrong cat path there.


>  M_START_TCPDUMP([ovn-chassis-1], [-neei pod10-p ip], [pod10])
>  M_START_TCPDUMP([ovn-chassis-1], [-neei mgmt-p ip], [mgmt])
>
> diff --git a/tests/system-common-macros.at b/tests/system-common-macros.at
> index ea3504a7b..a7585eeb6 100644
> --- a/tests/system-common-macros.at
> +++ b/tests/system-common-macros.at
> @@ -209,7 +209,7 @@ m4_define([NETNS_START_DHCPD],
>  # test.
>  #
>  m4_define([NETNS_START_UDP_ECHO],
> -   [ip netns exec $1 nc -$2 -k -l -u -p $3 -d 0.1 -c '/bin/cat' & echo $!
> > $4
> +   [ip netns exec $1 nc -$2 -k -l -u -p $3 -d 0.1 -c 'cat' & echo $! > $4
>       echo "pkill -P \`cat $4\`; kill \`cat $4\`" >> cleanup
>     ]
>  )
> @@ -498,8 +498,8 @@ m4_define([NS_CHECK_CONNECTIVITY__],
>      check ovs-appctl revalidator/wait
>
>      # Start a simple TCP and UDP echo server that replies with "ack
> <received_msg>".
> -    NETNS_DAEMONIZE($ns_dst, [nc $proto -l -p 1235 -d 0.1 -c '/bin/cat'],
> [nc-$ns_dst-$ip-tcp.pid])
> -    NETNS_DAEMONIZE($ns_dst, [nc $proto -l -u -p 1234 -d 0.1 -c
> '/bin/cat'], [nc-$ns_dst-$ip-udp.pid])
> +    NETNS_DAEMONIZE($ns_dst, [nc $proto -l -p 1235 -d 0.1 -c 'cat'],
> [nc-$ns_dst-$ip-tcp.pid])
> +    NETNS_DAEMONIZE($ns_dst, [nc $proto -l -u -p 1234 -d 0.1 -c 'cat'],
> [nc-$ns_dst-$ip-udp.pid])
>
>      # Ensure that the destination NS can be pinged on the specified IP
>      NS_CHECK_EXEC([$ns_src], [ping $proto -q -c 3 -i 0.3 -w 2 $ip |
> FORMAT_PING], \
> diff --git a/tests/system-ovn-kmod.at b/tests/system-ovn-kmod.at
> index 53fc45734..754926721 100644
> --- a/tests/system-ovn-kmod.at
> +++ b/tests/system-ovn-kmod.at
> @@ -931,7 +931,7 @@ printf %8000s > datafile
>  printf %32000s > frag_test_srv.expected
>  printf %16000s > frag_test_client.expected
>
> -NETNS_DAEMONIZE([lsp], [nc -e /bin/cat -u -v -l 42.42.42.1 2021 -o
> udp_frag_test_srv.rcvd], [lsp-nc.pid])
> +NETNS_DAEMONIZE([lsp], [nc -e "$(command -v cat)" -u -v -l 42.42.42.1
> 2021 -o udp_frag_test_srv.rcvd], [lsp-nc.pid])
>
>  # Send 2 client requests with the same port so that the 2nd one
>  # is categorized as ct.est and not ct.new.
> @@ -993,7 +993,7 @@ printf %8000s > datafile
>  printf %32000s > frag_test_srv.expected
>  printf %16000s > frag_test_client.expected
>
> -NETNS_DAEMONIZE([lsp], [nc -e /bin/cat -u -v -l 4200::1 2021 -o
> udp_frag_test_srv.rcvd], [lsp-nc.pid])
> +NETNS_DAEMONIZE([lsp], [nc -e "$(command -v cat)" -u -v -l 4200::1 2021
> -o udp_frag_test_srv.rcvd], [lsp-nc.pid])
>
>  # Send 2 client requests with the same port so that the 2nd one
>  # is categorized as ct.est and not ct.new.
> @@ -1536,8 +1536,8 @@ NETNS_START_TCPDUMP([pod], [-vnne "ip or icmp"],
> [pod])
>  echo -e "Hello UDP\nHello UDP" > udp.expected
>  echo -e "Hello TCP\nHello TCP" > tcp.expected
>
> -NETNS_DAEMONIZE([pod], [nc -e /bin/cat -v -l -u -o server_udp.log
> 192.168.100.5 2323], [nc1.pid])
> -NETNS_DAEMONIZE([pod], [nc -e /bin/cat -v -l -o server_tcp.log
> 192.168.100.5 2324], [nc2.pid])
> +NETNS_DAEMONIZE([pod], [nc -e "$(command -v cat)" -v -l -u -o
> server_udp.log 192.168.100.5 2323], [nc1.pid])
> +NETNS_DAEMONIZE([pod], [nc -e "$(command -v cat)" -v -l -o server_tcp.log
> 192.168.100.5 2324], [nc2.pid])
>
>  NS_CHECK_EXEC([mgmt], [(echo "Hello UDP"; sleep 3) | nc -u -s
> 172.16.100.2 -o client_udp.log 172.16.0.5 5656], [0], [ignore], [ignore])
>  check cmp server_udp.log udp.expected
> diff --git a/tests/system-ovn.at b/tests/system-ovn.at
> index 65a79b633..818c50b7a 100644
> --- a/tests/system-ovn.at
> +++ b/tests/system-ovn.at
> @@ -13332,7 +13332,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 -m 1 1000],
> [nc-vm2-1000.pid])
> +NETNS_DAEMONIZE([vm2], [nc -e "$(command -v 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])
> @@ -13450,7 +13450,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 -m 1 1000],
> [nc-vm2-1000.pid])
> +NETNS_DAEMONIZE([vm2], [nc -e "$(command -v 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])
> --
> 2.54.0
>
> _______________________________________________
> dev mailing list
> [email protected]
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
>
Regards,
Ales
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to