From: Hangbin Liu <hangbin.liu@linux.dev>
To: Jingjing Xu <xujingjing@cmss.chinamobile.com>
Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
kuba@kernel.org, edumazet@kernel.org, pabeni@redhat.com,
horms@kernel.org, shuah@kernel.org, willemb@google.com,
annaemesenyiri@gmail.com, idosch@nvidia.com
Subject: Re: [PATCH net-next v2 1/3] selftests: net: report SO_RCV test failures to the runner
Date: Wed, 25 Nov 2026 15:18:26 +0800 [thread overview]
Message-ID: <20261125071826.GC184281@Liu-laptop> (raw)
In-Reply-To: <20261125064110.1396439-2-xujingjing@cmss.chinamobile.com>
On Wed, Nov 25, 2026 at 06:41:08AM +0000, Jingjing Xu wrote:
> test_so_rcv.sh uses KSFT_FAIL and KSFT_PASS, but lib.sh defines the
> lowercase ksft_fail and ksft_pass constants. With the uppercase variables
> unset, exit has no argument and returns the successful echo status, even
> when the script has reported failed tests.
>
> Use the constants actually provided by lib.sh so failures produce a
> nonzero exit status.
>
> Run as root from tools/testing/selftests/net after building the helpers.
> For the original four-case script, this changes only sender metadata to 1
> while the listeners still expect 2 or 3:
>
> sed '/\.\/cmsg_sender/s/\$arg/${arg% *} 1/' test_so_rcv.sh | bash
> echo $?
>
> Both versions report four failures. The original prints 0 as the exit
> status; with this fix it prints 1.
>
> AI-assisted inspection found this while extending the receive tests.
> With deliberately mismatched sender metadata, all four original cases
> fail on both versions: the original script exits 0 and
> the corrected script exits 1. The unmodified sender passes all four cases
> with exit 0. No kernel instrumentation or fault injection was used.
>
> Fixes: c935af429ec2 ("selftests: net: add support for testing SO_RCVMARK and SO_RCVPRIORITY")
> Signed-off-by: Jingjing Xu <xujingjing@cmss.chinamobile.com>
> ---
> tools/testing/selftests/net/test_so_rcv.sh | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/net/test_so_rcv.sh b/tools/testing/selftests/net/test_so_rcv.sh
> index d8aa4362879d..ae01fa3c5329 100755
> --- a/tools/testing/selftests/net/test_so_rcv.sh
> +++ b/tools/testing/selftests/net/test_so_rcv.sh
> @@ -66,8 +66,8 @@ done
>
> if [ "$FAILED_TESTS" -ne 0 ]; then
> echo "FAIL - $FAILED_TESTS/$TOTAL_TESTS tests failed"
> - exit ${KSFT_FAIL}
> + exit ${ksft_fail}
> else
> echo "OK - All $TOTAL_TESTS tests passed"
> - exit ${KSFT_PASS}
> + exit ${ksft_pass}
> fi
> base-commit: 57f165ff2f30491bc3511d24a52ca516751a268b
> --
> 2.53.0
>
>
>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
next prev parent reply other threads:[~2026-11-25 7:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 6:41 [PATCH net-next v2 0/3] selftests: net: fix receive metadata and failure reporting Jingjing Xu
2026-11-25 6:41 ` [PATCH net-next v2 1/3] selftests: net: report SO_RCV test failures to the runner Jingjing Xu
2026-11-25 7:18 ` Hangbin Liu [this message]
2026-11-25 6:41 ` [PATCH net-next v2 2/3] selftests: net: enable receive metadata independently of its value Jingjing Xu
2026-11-25 6:41 ` [PATCH net-next v2 3/3] selftests: net: cover zero receive mark and priority Jingjing Xu
2026-11-25 8:36 ` Hangbin Liu
2026-11-30 0:59 ` [PATCH net-next v2 0/3] selftests: net: fix receive metadata and failure reporting Jingjing Xu
2026-12-04 2:40 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261125071826.GC184281@Liu-laptop \
--to=hangbin.liu@linux.dev \
--cc=annaemesenyiri@gmail.com \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=willemb@google.com \
--cc=xujingjing@cmss.chinamobile.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.