mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Muhammad Usama Anjum <usama.anjum@collabora.com>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
	"Andy Lutomirski" <luto@kernel.org>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Vincenzo Frascino" <vincenzo.frascino@arm.com>,
	"Shuah Khan" <shuah@kernel.org>,
	"Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: usama.anjum@collabora.com, Shuah Khan <skhan@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH 1/7] selftests: vDSO: chacha: Correctly skip test if necessary
Date: Fri, 2 May 2025 18:42:55 +0500	[thread overview]
Message-ID: <c01d8c7e-bac7-4d4d-872d-14f0ac0c6ec2@collabora.com> (raw)
In-Reply-To: <20250502-selftests-vdso-fixes-v1-1-fb5d640a4f78@linutronix.de>

On 5/2/25 5:40 PM, Thomas Weißschuh wrote:
> According to kselftest.h ksft_exit_skip() is not meant to be called when
> a plan has already been printed.
Agreed

> 
> Use the recommended function ksft_test_result_skip().
> 
> This fixes a bug, where the TAP output would be invalid when skipping:
> 
> 	TAP version 13
> 	1..1
> 	ok 2 # SKIP Not implemented on architecture
> 
> The SKIP line should start with "ok 1" as the plan only contains one test.
> 
> Fixes: 3b5992eaf730 ("selftests: vDSO: unconditionally build chacha test")
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>

> 
> ---
> I'm not sure if this is not a general bug in ksft_exit_skip().
> First ksft_xskip is incremented then read back through ksft_test_num() and
> then that result is incremented again.
> 
> In any case, using the correct function is better.
> ---
>  tools/testing/selftests/vDSO/vdso_test_chacha.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/vDSO/vdso_test_chacha.c b/tools/testing/selftests/vDSO/vdso_test_chacha.c
> index 8757f738b0b1a76a48c83c5e5df79925a30c1bc7..0aad682b12c8836efabb49a65a47cf87466891a3 100644
> --- a/tools/testing/selftests/vDSO/vdso_test_chacha.c
> +++ b/tools/testing/selftests/vDSO/vdso_test_chacha.c
> @@ -76,7 +76,8 @@ static void reference_chacha20_blocks(uint8_t *dst_bytes, const uint32_t *key, u
>  
>  void __weak __arch_chacha20_blocks_nostack(uint8_t *dst_bytes, const uint32_t *key, uint32_t *counter, size_t nblocks)
>  {
> -	ksft_exit_skip("Not implemented on architecture\n");
> +	ksft_test_result_skip("Not implemented on architecture\n");
> +	ksft_finished();
>  }
>  
>  int main(int argc, char *argv[])
> 


-- 
Regards,
Usama

  reply	other threads:[~2025-05-02 13:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-02 12:40 [PATCH 0/7] selftests: vDSO: Some cleanups and fixes Thomas Weißschuh
2025-05-02 12:40 ` [PATCH 1/7] selftests: vDSO: chacha: Correctly skip test if necessary Thomas Weißschuh
2025-05-02 13:42   ` Muhammad Usama Anjum [this message]
2025-05-02 12:40 ` [PATCH 2/7] selftests: vDSO: clock_getres: Drop unused include of err.h Thomas Weißschuh
2025-05-02 13:43   ` Muhammad Usama Anjum
2025-05-02 12:40 ` [PATCH 3/7] selftests: vDSO: vdso_test_correctness: Fix -Wold-style-definitions Thomas Weißschuh
2025-05-02 13:44   ` Muhammad Usama Anjum
2025-05-02 12:40 ` [PATCH 4/7] selftests: vDSO: vdso_test_getrandom: Drop unused include of linux/compiler.h Thomas Weißschuh
2025-05-02 12:40 ` [PATCH 5/7] selftests: vDSO: vdso_test_getrandom: Drop some dead code Thomas Weißschuh
2025-05-02 13:46   ` Muhammad Usama Anjum
2025-05-02 12:40 ` [PATCH 6/7] selftests: vDSO: vdso_test_getrandom: Always print TAP header Thomas Weißschuh
2025-05-02 13:48   ` Muhammad Usama Anjum
2025-05-02 12:40 ` [PATCH 7/7] selftests: vDSO: vdso_config: Avoid -Wunused-variables Thomas Weißschuh
2025-05-02 13:49   ` Muhammad Usama Anjum

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=c01d8c7e-bac7-4d4d-872d-14f0ac0c6ec2@collabora.com \
    --to=usama.anjum@collabora.com \
    --cc=Jason@zx2c4.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=tglx@linutronix.de \
    --cc=thomas.weissschuh@linutronix.de \
    --cc=vincenzo.frascino@arm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®