From: Shuah Khan <skhan@linuxfoundation.org>
To: Hangbin Liu <liuhangbin@gmail.com>, linux-kselftest@vger.kernel.org
Cc: Shuah Khan <shuah@kernel.org>,
Brendan Jackman <jackmanb@google.com>,
netdev@vger.kernel.org, Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCHv3] selftests: Use ktap helpers for runner.sh
Date: Tue, 31 Mar 2026 14:51:48 -0600 [thread overview]
Message-ID: <014b54f0-c4a6-40f2-afd0-0ea3e2f796e4@linuxfoundation.org> (raw)
In-Reply-To: <20260225010833.11301-1-liuhangbin@gmail.com>
On 2/24/26 18:08, Hangbin Liu wrote:
> Instead of manually writing ktap messages, we should use the formal
> ktap helpers in runner.sh. Brendan did some work in d9e6269e3303
> ("selftests/run_kselftest.sh: exit with error if tests fail") to make
> run_kselftest.sh exit with the correct return value. However, the output
> does not include the total results, such as how many tests passed or failed.
>
> Let’s convert all manually printed messages in runner.sh to use the
> formal ktap helpers. Here are what I changed:
>
> 1. Move TAP header from runner.sh to run_kselftest.sh, since run_kselftest.sh
> is the only caller of run_many().
> 2. In run_kselftest.sh, call run_many() in main process to count the
> pass/fail numbers.
> 3. In run_kselftest.sh, do not generate kselftest_failures_file. Just
> use ktap_print_totals to report the result.
> 4. In runner.sh run_one(), get the return value and use ktap helpers for
> all pass/fail reporting. This allows counting pass/fail numbers in the
> main process.
> 5. In runner.sh run_in_netns(), also return the correct rc, so we can
> count results during wait.
>
> After the change, the printed result looks like:
>
> not ok 4 4 selftests: clone3: clone3_cap_checkpoint_restore # exit=1
> # Totals: pass:3 fail:1 xfail:0 xpass:0 skip:0 error:0
>
> ]# echo $?
> 1
>
> Tested-by: Brendan Jackman <jackmanb@google.com>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---
>
Applied to linux-kselftest next for Linux 7.1-rc1
I had to fix commit description and long lines in change log.
In the future make sure to run checkpatch to catch errors
related to commit descriptions.
thanks,
-- Shuah
next prev parent reply other threads:[~2026-03-31 20:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-25 1:08 [PATCHv3] selftests: Use ktap helpers for runner.sh Hangbin Liu
2026-02-25 13:06 ` Brendan Jackman
2026-03-05 1:56 ` Hangbin Liu
2026-03-11 2:17 ` Hangbin Liu
2026-03-31 20:51 ` Shuah Khan [this message]
2026-04-01 1:05 ` 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=014b54f0-c4a6-40f2-afd0-0ea3e2f796e4@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=jackmanb@google.com \
--cc=linux-kselftest@vger.kernel.org \
--cc=liuhangbin@gmail.com \
--cc=netdev@vger.kernel.org \
--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