public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Hangbin Liu <liuhangbin@gmail.com>
To: Shuah Khan <skhan@linuxfoundation.org>
Cc: linux-kselftest@vger.kernel.org, Shuah Khan <shuah@kernel.org>,
	Brendan Jackman <jackmanb@google.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCHv3] selftests: Use ktap helpers for runner.sh
Date: Wed, 1 Apr 2026 01:05:04 +0000	[thread overview]
Message-ID: <acxvQJsySH0NBmB1@fedora> (raw)
In-Reply-To: <014b54f0-c4a6-40f2-afd0-0ea3e2f796e4@linuxfoundation.org>

On Tue, Mar 31, 2026 at 02:51:48PM -0600, Shuah Khan wrote:
> 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, I will take care of this.

Hangbin
> 
> thanks,
> -- Shuah

      reply	other threads:[~2026-04-01  1:05 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
2026-04-01  1:05   ` Hangbin Liu [this message]

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=acxvQJsySH0NBmB1@fedora \
    --to=liuhangbin@gmail.com \
    --cc=jackmanb@google.com \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.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