mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Muhammad Usama Anjum <usama.anjum@collabora.com>
To: Laura Nao <laura.nao@collabora.com>, shuah@kernel.org
Cc: Muhammad Usama Anjum <usama.anjum@collabora.com>,
	gregkh@linuxfoundation.org, nfraprado@collabora.com,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel@collabora.com
Subject: Re: [PATCH v2] selftests: ksft: Fix finished() helper exit code on skipped tests
Date: Wed, 31 Jul 2024 18:05:53 +0500	[thread overview]
Message-ID: <ffea6ae8-a5e3-47f9-8d01-efe5e58ab2c8@collabora.com> (raw)
In-Reply-To: <20240730102928.33182-1-laura.nao@collabora.com>

On 7/30/24 3:29 PM, Laura Nao wrote:
> The Python finished() helper currently exits with KSFT_FAIL when there
> are only passed and skipped tests. Fix the logic to exit with KSFT_PASS
> instead, making it consistent with its C and bash counterparts
> (ksft_finished() and ktap_finished() respectively).
> 
> Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
> Fixes: dacf1d7a78bf ("kselftest: Add test to verify probe of devices from discoverable buses")
> Signed-off-by: Laura Nao <laura.nao@collabora.com>
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>

> ---
> This is a revised version of the patch initially submitted as "[PATCH]
> selftests: ksft: Track skipped tests when finishing the test suite":
> https://lore.kernel.org/all/20240722154319.619944-1-laura.nao@collabora.com/
> 
> Depends on "[PATCH v2 2/3] kselftest: Move ksft helper module to common
> directory":
> https://lore.kernel.org/all/20240705-dev-err-log-selftest-v2-2-163b9cd7b3c1@collabora.com/
> (picked through the usb tree, queued for 6.11-rc1)
> 
> Changes in v2:
> - Reworded the commit title and message to more accurately describe the
> incorrect behavior of the finished() helper addressed by the patch.
> ---
>  tools/testing/selftests/kselftest/ksft.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/kselftest/ksft.py b/tools/testing/selftests/kselftest/ksft.py
> index cd89fb2bc10e..bf215790a89d 100644
> --- a/tools/testing/selftests/kselftest/ksft.py
> +++ b/tools/testing/selftests/kselftest/ksft.py
> @@ -70,7 +70,7 @@ def test_result(condition, description=""):
>  
>  
>  def finished():
> -    if ksft_cnt["pass"] == ksft_num_tests:
> +    if ksft_cnt["pass"] + ksft_cnt["skip"] == ksft_num_tests:
LGTM

>          exit_code = KSFT_PASS
>      else:
>          exit_code = KSFT_FAIL

-- 
BR,
Muhammad Usama Anjum

  reply	other threads:[~2024-07-31 13:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-30 10:29 Laura Nao
2024-07-31 13:05 ` Muhammad Usama Anjum [this message]
2024-07-31 17:47   ` Shuah Khan

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=ffea6ae8-a5e3-47f9-8d01-efe5e58ab2c8@collabora.com \
    --to=usama.anjum@collabora.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@collabora.com \
    --cc=laura.nao@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=nfraprado@collabora.com \
    --cc=shuah@kernel.org \
    /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®