From: Jakub Kicinski <kuba@kernel.org>
To: Hangbin Liu <hangbin.liu@linux.dev>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
Shuah Khan <shuah@kernel.org>, David Ahern <dsahern@kernel.org>,
Ido Schimmel <idosch@nvidia.com>,
Andrea Mayer <andrea.mayer@uniroma2.it>,
netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org, Hangbin Liu <liuhangbin@kylinos.cn>
Subject: Re: [PATCH net-next v2] selftests: net: move log_test to lib file and remove duplicate code
Date: Mon, 31 Aug 2026 08:03:21 -0700 [thread overview]
Message-ID: <20260831080321.59cc6af1@kernel.org> (raw)
In-Reply-To: <20260831-self_log_test-v2-1-eda2e8490cf9@kylinos.cn>
On Mon, 31 Aug 2026 17:21:28 +0800 Hangbin Liu wrote:
> Many test scripts under tools/testing/selftests/net/ each define their own
> log_test() function with near-identical logic for comparing a return
> code against an expected value and printing OK/FAIL. Add a shared
> log_test_expected() to lib.sh and replace each local definition with a
> thin wrapper that delegates to it.
>
> The function is named log_test_expected() rather than log_test() because
> lib.sh already exports log_test() with a different signature used by
> the forwarding tests.
>
> Two tests required special handling:
>
> - icmp_redirect.sh passed a fourth "xfail" argument to log_test(). The
> underlying issue has been fixed and the argument is always absent now,
> so it is simply dropped.
>
> - fib_nexthops.sh checked for ksft_skip (exit code 4) inside log_test(),
> but no test in the file produces that code. The check is removed,
> callers that need to report a skip should use log_test_skip() instead.
> Two callers compared against exit code 2 are left as-is since code 2
> correctly counts as a failure in the previous log_test().
still breaks fib_tests.sh
next prev parent reply other threads:[~2026-08-31 15:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-31 9:21 [PATCH net-next v2] selftests: net: move log_test to lib file and remove duplicate code Hangbin Liu
2026-08-31 15:03 ` Jakub Kicinski [this message]
2026-09-01 6:26 ` Hangbin Liu
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=20260831080321.59cc6af1@kernel.org \
--to=kuba@kernel.org \
--cc=andrea.mayer@uniroma2.it \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=hangbin.liu@linux.dev \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=liuhangbin@kylinos.cn \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox