mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Muhammad Usama Anjum <usama.anjum@collabora.com>
To: Al Viro <viro@zeniv.linux.org.uk>, Aleksa Sarai <cyphar@cyphar.com>
Cc: Muhammad Usama Anjum <usama.anjum@collabora.com>,
	kernel@collabora.com, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org, Shuah Khan <shuah@kernel.org>
Subject: Re: [PATCH] selftests: openat2: don't print total number of tests and then skip
Date: Mon, 1 Jul 2024 13:34:53 +0500	[thread overview]
Message-ID: <1fc06a15-f06e-4db1-ace5-b9d52250d0df@collabora.com> (raw)
In-Reply-To: <20240522214647.3568788-1-usama.anjum@collabora.com>

Adding more people for review

On 5/23/24 2:46 AM, Muhammad Usama Anjum wrote:
> Don't print that 88 sub-tests are going to be executed. But then skip.
> The error is printed that executed test was only 1 while 88 should have
> run:
> 
> Old output:
>   TAP version 13
>   1..88
>   ok 2 # SKIP all tests require euid == 0
>   # Planned tests != run tests (88 != 1)
>   # Totals: pass:0 fail:0 xfail:0 xpass:0 skip:1 error:0
> 
> New and correct output:
>   TAP version 13
>   1..0 # SKIP all tests require euid == 0
> 
> Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
> ---
>  tools/testing/selftests/openat2/resolve_test.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/openat2/resolve_test.c b/tools/testing/selftests/openat2/resolve_test.c
> index bbafad440893c..5472ec478d227 100644
> --- a/tools/testing/selftests/openat2/resolve_test.c
> +++ b/tools/testing/selftests/openat2/resolve_test.c
> @@ -508,12 +508,13 @@ void test_openat2_opath_tests(void)
>  int main(int argc, char **argv)
>  {
>  	ksft_print_header();
> -	ksft_set_plan(NUM_TESTS);
>  
>  	/* NOTE: We should be checking for CAP_SYS_ADMIN here... */
> -	if (geteuid() != 0)
> +	if (geteuid())
>  		ksft_exit_skip("all tests require euid == 0\n");
>  
> +	ksft_set_plan(NUM_TESTS);
> +
>  	test_openat2_opath_tests();
>  
>  	if (ksft_get_fail_cnt() + ksft_get_error_cnt() > 0)

-- 
BR,
Muhammad Usama Anjum

  reply	other threads:[~2024-07-01  8:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-22 21:46 Muhammad Usama Anjum
2024-07-01  8:34 ` Muhammad Usama Anjum [this message]
2024-07-01  9:14   ` Aleksa Sarai
2024-07-02  7:02     ` Muhammad Usama Anjum
2024-07-10  9:33       ` Muhammad Usama Anjum
2024-07-10 16:18         ` Shuah Khan
2024-07-11  6:39           ` 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=1fc06a15-f06e-4db1-ace5-b9d52250d0df@collabora.com \
    --to=usama.anjum@collabora.com \
    --cc=cyphar@cyphar.com \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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®