The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] selftests: netfilter: fix missing echo in nft_nat_zones.sh
@ 2026-11-24  7:19 Zhiqi Zhang
  2026-11-24  9:21 ` Florian Westphal
  0 siblings, 1 reply; 2+ messages in thread
From: Zhiqi Zhang @ 2026-11-24  7:19 UTC (permalink / raw)
  To: Pablo Neira Ayuso, Florian Westphal, Phil Sutter
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Shuah Khan, netfilter-devel, coreteam, netdev,
	linux-kselftest, linux-kernel, Zhiqi Zhang

The ping failure path tries to execute the failure message as a command
because the echo command is missing. This reports a confusing "command not
found" error and returns 127 from that command instead of printing the
intended diagnostic.

Add the missing echo so the ping failure is reported consistently with the
other failure paths in the script.

I found this bug manually. OpenAI Codex generated the one-line code
change. I wrote the reproducer/test case, reviewed the generated change,
and tested the patch.

Fixes: d6905f088d2b ("selftests: netfilter: nft_nat_zones.sh: shellcheck cleanups")
Signed-off-by: Zhiqi Zhang <zhiqizhangg@gmail.com>
---
 tools/testing/selftests/net/netfilter/nft_nat_zones.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/netfilter/nft_nat_zones.sh b/tools/testing/selftests/net/netfilter/nft_nat_zones.sh
index d935c967dd..f15bfd3373 100755
--- a/tools/testing/selftests/net/netfilter/nft_nat_zones.sh
+++ b/tools/testing/selftests/net/netfilter/nft_nat_zones.sh
@@ -171,7 +171,7 @@ done
 
 wait || ret=1
 
-[ "$ret" -ne 0 ] && "FAIL: Ping failure from $cl" 1>&2
+[ "$ret" -ne 0 ] && echo "FAIL: Ping failure from $cl" 1>&2
 
 for i in $(seq 1 "$maxclients"); do
    if ! ip netns exec "$gw" nft get element inet raw inicmp "{ 10.1.0.3 . \"veth$i\" . 10.3.0.99 }" | grep -q "{ 10.1.0.3 . \"veth$i\" . 10.3.0.99 counter packets 3 bytes 252 }"; then
-- 
2.54.0 (Apple Git-157)


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] selftests: netfilter: fix missing echo in nft_nat_zones.sh
  2026-11-24  7:19 [PATCH] selftests: netfilter: fix missing echo in nft_nat_zones.sh Zhiqi Zhang
@ 2026-11-24  9:21 ` Florian Westphal
  0 siblings, 0 replies; 2+ messages in thread
From: Florian Westphal @ 2026-11-24  9:21 UTC (permalink / raw)
  To: Zhiqi Zhang
  Cc: Pablo Neira Ayuso, Phil Sutter, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan,
	netfilter-devel, coreteam, netdev, linux-kselftest, linux-kernel

@netdev maintainers:

feel free to take this one directly.

Zhiqi Zhang <zhiqizhangg@gmail.com> wrote:
> The ping failure path tries to execute the failure message as a command
> because the echo command is missing. This reports a confusing "command not
> found" error and returns 127 from that command instead of printing the
> intended diagnostic.
> 
> Add the missing echo so the ping failure is reported consistently with the
> other failure paths in the script.
> 
> I found this bug manually. OpenAI Codex generated the one-line code
> change. I wrote the reproducer/test case, reviewed the generated change,
> and tested the patch.
> 
> Fixes: d6905f088d2b ("selftests: netfilter: nft_nat_zones.sh: shellcheck cleanups")
> Signed-off-by: Zhiqi Zhang <zhiqizhangg@gmail.com>
> ---
>  tools/testing/selftests/net/netfilter/nft_nat_zones.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/net/netfilter/nft_nat_zones.sh b/tools/testing/selftests/net/netfilter/nft_nat_zones.sh
> index d935c967dd..f15bfd3373 100755
> --- a/tools/testing/selftests/net/netfilter/nft_nat_zones.sh
> +++ b/tools/testing/selftests/net/netfilter/nft_nat_zones.sh
> @@ -171,7 +171,7 @@ done
>  
>  wait || ret=1
>  
> -[ "$ret" -ne 0 ] && "FAIL: Ping failure from $cl" 1>&2
> +[ "$ret" -ne 0 ] && echo "FAIL: Ping failure from $cl" 1>&2

Acked-by: Florian Westphal <fw@strlen.de>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-24 11:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24  7:19 [PATCH] selftests: netfilter: fix missing echo in nft_nat_zones.sh Zhiqi Zhang
2026-11-24  9:21 ` Florian Westphal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox