Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Zenghui Yu <zenghui.yu@linux.dev>,
	linux-mm@kvack.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: akpm@linux-foundation.org, ljs@kernel.org, liam@infradead.org,
	vbabka@kernel.org, rppt@kernel.org, surenb@google.com,
	mhocko@suse.com, shuah@kernel.org
Subject: Re: [PATCH] selftests/mm: fix incorrect skip output in pkey_sighandler_tests
Date: Tue, 25 Aug 2026 16:21:32 +0200	[thread overview]
Message-ID: <bb515cb2-6695-4fa0-aa80-b04d4bc4304f@kernel.org> (raw)
In-Reply-To: <20260825123023.64418-1-zenghui.yu@linux.dev>

On 8/25/26 14:30, Zenghui Yu wrote:
> From: "Zenghui Yu (Huawei)" <zenghui.yu@linux.dev>
> 
> When pkeys is not supported, ksft_exit_skip() runs with ksft_plan already
> set, which takes the "ok N # SKIP" branch intended for skipping a single
> test case.  The result is a TAP plan of 5 but only one result line.
> 
>  $ ./pkey_sighandler_tests
>  TAP version 13
>  1..5
>  ok 1 # SKIP pkeys not supported
>  # 1 skipped test(s) detected. Consider enabling relevant config options to improve coverage.
>  # Planned tests != run tests (5 != 1)
>  # Totals: pass:0 fail:0 xfail:0 xpass:0 skip:1 error:0
> 
> Move ksft_set_plan() after the skip check so ksft_exit_skip() takes
> the "1..0 # SKIP" branch, the correct TAP representation for
> skipping an entire test file.
> 
>  $ ./pkey_sighandler_tests
>  TAP version 13
>  1..0 # SKIP pkeys not supported
> 
> Signed-off-by: Zenghui Yu (Huawei) <zenghui.yu@linux.dev>
> ---
>  tools/testing/selftests/mm/pkey_sighandler_tests.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/mm/pkey_sighandler_tests.c b/tools/testing/selftests/mm/pkey_sighandler_tests.c
> index c218d0510a2a..74bf79a5399d 100644
> --- a/tools/testing/selftests/mm/pkey_sighandler_tests.c
> +++ b/tools/testing/selftests/mm/pkey_sighandler_tests.c
> @@ -543,11 +543,12 @@ static void (*pkey_tests[])(void) = {
>  int main(int argc, char *argv[])
>  {
>  	ksft_print_header();
> -	ksft_set_plan(ARRAY_SIZE(pkey_tests));
>  
>  	if (!is_pkeys_supported())
>  		ksft_exit_skip("pkeys not supported\n");
>  
> +	ksft_set_plan(ARRAY_SIZE(pkey_tests));
> +
>  	for (test_nr = 0; test_nr < ARRAY_SIZE(pkey_tests); test_nr++) {
>  		tracing_on();
>  		(*pkey_tests[test_nr])();

We also handle it like that in soft-dirty.c, so why not

Acked-by: David Hildenbrand (Arm) <david@kernel.org>


-- 
Cheers,

David

      reply	other threads:[~2026-08-25 14:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-25 12:30 [PATCH] selftests/mm: fix incorrect skip output in pkey_sighandler_tests Zenghui Yu
2026-08-25 14:21 ` David Hildenbrand (Arm) [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=bb515cb2-6695-4fa0-aa80-b04d4bc4304f@kernel.org \
    --to=david@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=rppt@kernel.org \
    --cc=shuah@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    --cc=zenghui.yu@linux.dev \
    /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