From: Muhammad Usama Anjum <usama.anjum@collabora.com>
To: Shuah Khan <skhan@linuxfoundation.org>,
Shuah Khan <shuah@kernel.org>, Aleksa Sarai <cyphar@cyphar.com>
Cc: Muhammad Usama Anjum <usama.anjum@collabora.com>,
Al Viro <viro@zeniv.linux.org.uk>,
kernel@collabora.com, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests: openat2: don't print total number of tests and then skip
Date: Thu, 11 Jul 2024 11:39:23 +0500 [thread overview]
Message-ID: <bab6401b-56e0-4fb7-8ae7-90607c52c58d@collabora.com> (raw)
In-Reply-To: <6d82fa16-ed2e-41f1-a466-c752032b6f68@linuxfoundation.org>
On 7/10/24 9:18 PM, Shuah Khan wrote:
> On 7/10/24 03:33, Muhammad Usama Anjum wrote:
>> Hi Shuah,
>>
>> Can you take the patch as is or by removing following from this patch:
>>
>> - if (geteuid() != 0)
>> + if (geteuid())
>
> As Aleksa mentioned, geteuid() != 0 is preferred.
I can make the change after concluding the following discussion.
>
>>
>> On 7/2/24 12:02 PM, Muhammad Usama Anjum wrote:
>>> On 7/1/24 2:14 PM, Aleksa Sarai wrote:
>>>> On 2024-07-01, Muhammad Usama Anjum <usama.anjum@collabora.com> wrote:
>>>>> 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
This would return FAIL exit code to kselftest executor as the planned tests
were 88 while executed tests are only 1. Hence FAIL error code would be
returned. This is completely wrong.
>>>>>>
>>>>>> New and correct output:
>>>>>> TAP version 13
>>>>>> 1..0 # SKIP all tests require euid == 0
This would return SKIP exit code which is correct.
>
> I think having total number tell you how many tests are there.
> I don't this this is good change.
Having "1..88" misrepresents the number of executed tests. This is against
the TAP specs. The total number of tests must be printed after finding out
that initial conditions are fulfilled. From specs: [1]
> A plan line of 1..0 indicates that the test set was completely skipped;
> no tests are expected to follow, and none should have come before.
> Harnesses should report on 1..0 test runs similarly to their handling of
> SKIP Test Points, treating any comment in the Plan as the reason for
> skipping.
>
> 1..0 # WWW::Mechanize not installed
[1] https://testanything.org/tap-version-14-specification.html
>
> thanks,
> -- Shuah
>
--
BR,
Muhammad Usama Anjum
prev parent reply other threads:[~2024-07-11 6:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-22 21:46 [PATCH] selftests: openat2: don't print total number of tests and then skip Muhammad Usama Anjum
2024-07-01 8:34 ` Muhammad Usama Anjum
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 [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=bab6401b-56e0-4fb7-8ae7-90607c52c58d@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=skhan@linuxfoundation.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