mbox series

[0/2] selftests: Replace "Bail out" with "Error" in ksft_exit_fail_msg()

Message ID 20240405131748.1582646-1-usama.anjum@collabora.com (mailing list archive)
Headers show
Series selftests: Replace "Bail out" with "Error" in ksft_exit_fail_msg() | expand

Message

Muhammad Usama Anjum April 5, 2024, 1:17 p.m. UTC
"Bail out! " is not descriptive. It rather should be: "Failed: " and
then this added prefix doesn't need to be added everywhere. Usually in
the logs, we are searching for "Failed" or "Error" instead of "Bail
out" so it must be replace.

Remove Error/Failed prefixes from all usages as well.

Muhammad Usama Anjum (2):
  selftests: Replace "Bail out" with "Error"
  selftests: Remove Error/Failed prefix from ksft_exit_fail*() usages

 tools/testing/selftests/exec/load_address.c   |   8 +-
 .../testing/selftests/exec/recursion-depth.c  |  10 +-
 tools/testing/selftests/kselftest.h           |   2 +-
 .../selftests/mm/map_fixed_noreplace.c        |  24 +--
 tools/testing/selftests/mm/map_populate.c     |   2 +-
 tools/testing/selftests/mm/mremap_dontunmap.c |   2 +-
 tools/testing/selftests/mm/pagemap_ioctl.c    | 166 +++++++++---------
 .../selftests/mm/split_huge_page_test.c       |   2 +-
 8 files changed, 108 insertions(+), 108 deletions(-)

Comments

Shuah Khan April 5, 2024, 2:56 p.m. UTC | #1
On 4/5/24 07:17, Muhammad Usama Anjum wrote:
> "Bail out! " is not descriptive. It rather should be: "Failed: " and
> then this added prefix doesn't need to be added everywhere. Usually in
> the logs, we are searching for "Failed" or "Error" instead of "Bail
> out" so it must be replace.
> 
> Remove Error/Failed prefixes from all usages as well.
> 
> Muhammad Usama Anjum (2):
>    selftests: Replace "Bail out" with "Error"
>    selftests: Remove Error/Failed prefix from ksft_exit_fail*() usages
> 
>   tools/testing/selftests/exec/load_address.c   |   8 +-
>   .../testing/selftests/exec/recursion-depth.c  |  10 +-
>   tools/testing/selftests/kselftest.h           |   2 +-
>   .../selftests/mm/map_fixed_noreplace.c        |  24 +--
>   tools/testing/selftests/mm/map_populate.c     |   2 +-
>   tools/testing/selftests/mm/mremap_dontunmap.c |   2 +-
>   tools/testing/selftests/mm/pagemap_ioctl.c    | 166 +++++++++---------
>   .../selftests/mm/split_huge_page_test.c       |   2 +-
>   8 files changed, 108 insertions(+), 108 deletions(-)
> 

Andrew, Kees,

I will apply these to linux-kselftest next as a series since these
changes depend on change to tools/testing/selftests/kselftest.h
and need to go together.

Are you okay with that?

thanks,
-- Shuah
Kees Cook April 5, 2024, 3:32 p.m. UTC | #2
On Fri, Apr 05, 2024 at 08:56:31AM -0600, Shuah Khan wrote:
> On 4/5/24 07:17, Muhammad Usama Anjum wrote:
> > "Bail out! " is not descriptive. It rather should be: "Failed: " and
> > then this added prefix doesn't need to be added everywhere. Usually in
> > the logs, we are searching for "Failed" or "Error" instead of "Bail
> > out" so it must be replace.
> > 
> > Remove Error/Failed prefixes from all usages as well.
> > 
> > Muhammad Usama Anjum (2):
> >    selftests: Replace "Bail out" with "Error"
> >    selftests: Remove Error/Failed prefix from ksft_exit_fail*() usages
> > 
> >   tools/testing/selftests/exec/load_address.c   |   8 +-
> >   .../testing/selftests/exec/recursion-depth.c  |  10 +-
> >   tools/testing/selftests/kselftest.h           |   2 +-
> >   .../selftests/mm/map_fixed_noreplace.c        |  24 +--
> >   tools/testing/selftests/mm/map_populate.c     |   2 +-
> >   tools/testing/selftests/mm/mremap_dontunmap.c |   2 +-
> >   tools/testing/selftests/mm/pagemap_ioctl.c    | 166 +++++++++---------
> >   .../selftests/mm/split_huge_page_test.c       |   2 +-
> >   8 files changed, 108 insertions(+), 108 deletions(-)
> > 
> 
> Andrew, Kees,
> 
> I will apply these to linux-kselftest next as a series since these
> changes depend on change to tools/testing/selftests/kselftest.h
> and need to go together.
> 
> Are you okay with that?

Sounds good!
Shuah Khan April 5, 2024, 6:50 p.m. UTC | #3
On 4/5/24 09:32, Kees Cook wrote:
> On Fri, Apr 05, 2024 at 08:56:31AM -0600, Shuah Khan wrote:
>> On 4/5/24 07:17, Muhammad Usama Anjum wrote:
>>> "Bail out! " is not descriptive. It rather should be: "Failed: " and
>>> then this added prefix doesn't need to be added everywhere. Usually in
>>> the logs, we are searching for "Failed" or "Error" instead of "Bail
>>> out" so it must be replace.
>>>
>>> Remove Error/Failed prefixes from all usages as well.
>>>
>>> Muhammad Usama Anjum (2):
>>>     selftests: Replace "Bail out" with "Error"
>>>     selftests: Remove Error/Failed prefix from ksft_exit_fail*() usages
>>>
>>>    tools/testing/selftests/exec/load_address.c   |   8 +-
>>>    .../testing/selftests/exec/recursion-depth.c  |  10 +-
>>>    tools/testing/selftests/kselftest.h           |   2 +-
>>>    .../selftests/mm/map_fixed_noreplace.c        |  24 +--
>>>    tools/testing/selftests/mm/map_populate.c     |   2 +-
>>>    tools/testing/selftests/mm/mremap_dontunmap.c |   2 +-
>>>    tools/testing/selftests/mm/pagemap_ioctl.c    | 166 +++++++++---------
>>>    .../selftests/mm/split_huge_page_test.c       |   2 +-
>>>    8 files changed, 108 insertions(+), 108 deletions(-)
>>>
>>

Usama,

Please generate separate patches for each test (one for exec and
one for mm) when you do this kind of work across tests in the
future. I applied them this time.

>> Andrew, Kees,
>>
>> I will apply these to linux-kselftest next as a series since these
>> changes depend on change to tools/testing/selftests/kselftest.h
>> and need to go together.
>>
>> Are you okay with that?
> 
> Sounds good!
> 

Thank you. Applied to linux-kselftest next for Linux 6.10-rc1.

thanks,
-- Shuah
Bird, Tim April 5, 2024, 7:36 p.m. UTC | #4
Sorry I didn't catch this on the original submission.

> -----Original Message-----
> From: Shuah Khan <skhan@linuxfoundation.org>
> 
> On 4/5/24 07: 17, Muhammad Usama Anjum wrote: > "Bail out! " is not descriptive. It rather should be: "Failed: " and > then this added prefix
> doesn't need to be added everywhere. Usually in > the logs, we are searching for "Failed"
> ZjQcmQRYFpfptBannerStart
> Caution : This email originated from outside of Sony.
> Do not click links or open any attachments unless you recognize the sender and know the content is safe. Please report phishing if unsure.
> 
> ZjQcmQRYFpfptBannerEnd
> On 4/5/24 07:17, Muhammad Usama Anjum wrote:
> > "Bail out! " is not descriptive. It rather should be: "Failed: " and
> > then this added prefix doesn't need to be added everywhere. Usually in
> > the logs, we are searching for "Failed" or "Error" instead of "Bail
> > out" so it must be replace.

Bail out! is the wording in the original TAP spec.  We should not change
it unless we plan to abandon compatibility with that spec. (which I
would advise against).

See https://testanything.org/tap-specification.html

The reason "Bail out!" is preferred (IMO) is that it is less likely to be emitted
in other test output, and is more 'grepable'.

This would get a NAK from me.
 -- Tim

> >
> > Remove Error/Failed prefixes from all usages as well.
> >
> > Muhammad Usama Anjum (2):
> >    selftests: Replace "Bail out" with "Error"
> >    selftests: Remove Error/Failed prefix from ksft_exit_fail*() usages
> >
> >   tools/testing/selftests/exec/load_address.c   |   8 +-
> >   .../testing/selftests/exec/recursion-depth.c  |  10 +-
> >   tools/testing/selftests/kselftest.h           |   2 +-
> >   .../selftests/mm/map_fixed_noreplace.c        |  24 +--
> >   tools/testing/selftests/mm/map_populate.c     |   2 +-
> >   tools/testing/selftests/mm/mremap_dontunmap.c |   2 +-
> >   tools/testing/selftests/mm/pagemap_ioctl.c    | 166 +++++++++---------
> >   .../selftests/mm/split_huge_page_test.c       |   2 +-
> >   8 files changed, 108 insertions(+), 108 deletions(-)
> >
> 
> Andrew, Kees,
> 
> I will apply these to linux-kselftest next as a series since these
> changes depend on change to tools/testing/selftests/kselftest.h
> and need to go together.
> 
> Are you okay with that?
> 
> thanks,
> -- Shuah
>
Muhammad Usama Anjum April 5, 2024, 8:38 p.m. UTC | #5
Hi Tim,

On 4/6/24 12:36 AM, Bird, Tim wrote:
> Sorry I didn't catch this on the original submission.
> 
>> -----Original Message-----
>> From: Shuah Khan <skhan@linuxfoundation.org>
>>
>> On 4/5/24 07: 17, Muhammad Usama Anjum wrote: > "Bail out! " is not descriptive. It rather should be: "Failed: " and > then this added prefix
>> doesn't need to be added everywhere. Usually in > the logs, we are searching for "Failed"
>> ZjQcmQRYFpfptBannerStart
>> Caution : This email originated from outside of Sony.
>> Do not click links or open any attachments unless you recognize the sender and know the content is safe. Please report phishing if unsure.
>>
>> ZjQcmQRYFpfptBannerEnd
>> On 4/5/24 07:17, Muhammad Usama Anjum wrote:
>>> "Bail out! " is not descriptive. It rather should be: "Failed: " and
>>> then this added prefix doesn't need to be added everywhere. Usually in
>>> the logs, we are searching for "Failed" or "Error" instead of "Bail
>>> out" so it must be replace.
> 
> Bail out! is the wording in the original TAP spec.  We should not change
> it unless we plan to abandon compatibility with that spec. (which I
> would advise against).
> 
> See https://testanything.org/tap-specification.html
I didn't know that exact words are coming from TAP. Thank you for catching
it. We don't intend to move away from the spec.

> 
> The reason "Bail out!" is preferred (IMO) is that it is less likely to be emitted
> in other test output, and is more 'grepable'.
Makes sense.

> 
> This would get a NAK from me.
Let's drop this series.

>  -- Tim
> 
>>>
>>> Remove Error/Failed prefixes from all usages as well.
>>>
>>> Muhammad Usama Anjum (2):
>>>    selftests: Replace "Bail out" with "Error"
>>>    selftests: Remove Error/Failed prefix from ksft_exit_fail*() usages
>>>
>>>   tools/testing/selftests/exec/load_address.c   |   8 +-
>>>   .../testing/selftests/exec/recursion-depth.c  |  10 +-
>>>   tools/testing/selftests/kselftest.h           |   2 +-
>>>   .../selftests/mm/map_fixed_noreplace.c        |  24 +--
>>>   tools/testing/selftests/mm/map_populate.c     |   2 +-
>>>   tools/testing/selftests/mm/mremap_dontunmap.c |   2 +-
>>>   tools/testing/selftests/mm/pagemap_ioctl.c    | 166 +++++++++---------
>>>   .../selftests/mm/split_huge_page_test.c       |   2 +-
>>>   8 files changed, 108 insertions(+), 108 deletions(-)
>>>
>>
>> Andrew, Kees,
>>
>> I will apply these to linux-kselftest next as a series since these
>> changes depend on change to tools/testing/selftests/kselftest.h
>> and need to go together.
>>
>> Are you okay with that?
>>
>> thanks,
>> -- Shuah
>>
>
Shuah Khan April 5, 2024, 9:07 p.m. UTC | #6
On 4/5/24 14:38, Muhammad Usama Anjum wrote:
> Hi Tim,
> 
> On 4/6/24 12:36 AM, Bird, Tim wrote:
>> Sorry I didn't catch this on the original submission.
>>
>>> -----Original Message-----
>>> From: Shuah Khan <skhan@linuxfoundation.org>
>>>
>>> On 4/5/24 07: 17, Muhammad Usama Anjum wrote: > "Bail out! " is not descriptive. It rather should be: "Failed: " and > then this added prefix
>>> doesn't need to be added everywhere. Usually in > the logs, we are searching for "Failed"
>>> ZjQcmQRYFpfptBannerStart
>>> Caution : This email originated from outside of Sony.
>>> Do not click links or open any attachments unless you recognize the sender and know the content is safe. Please report phishing if unsure.
>>>
>>> ZjQcmQRYFpfptBannerEnd
>>> On 4/5/24 07:17, Muhammad Usama Anjum wrote:
>>>> "Bail out! " is not descriptive. It rather should be: "Failed: " and
>>>> then this added prefix doesn't need to be added everywhere. Usually in
>>>> the logs, we are searching for "Failed" or "Error" instead of "Bail
>>>> out" so it must be replace.
>>
>> Bail out! is the wording in the original TAP spec.  We should not change
>> it unless we plan to abandon compatibility with that spec. (which I
>> would advise against).
>>
>> See https://testanything.org/tap-specification.html
> I didn't know that exact words are coming from TAP. Thank you for catching
> it. We don't intend to move away from the spec.
> 
>>
>> The reason "Bail out!" is preferred (IMO) is that it is less likely to be emitted
>> in other test output, and is more 'grepable'.
> Makes sense.
> 
>>
>> This would get a NAK from me.
> Let's drop this series.
> 

Thank you. Dropped now.

thanks,
-- Shuah