lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9009f4df-ca7e-4961-97e4-446afc4e87d2@linuxfoundation.org>
Date: Tue, 23 Jul 2024 10:17:51 -0600
From: Shuah Khan <skhan@...uxfoundation.org>
To: Laura Nao <laura.nao@...labora.com>, shuah@...nel.org,
 nfraprado@...labora.com
Cc: gregkh@...uxfoundation.org, linux-kselftest@...r.kernel.org,
 linux-kernel@...r.kernel.org, kernel@...labora.com,
 Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [PATCH] selftests: ksft: Track skipped tests when finishing the
 test suite

On 7/22/24 09:43, Laura Nao wrote:
> Consider skipped tests in addition to passed tests when evaluating the
> overall result of the test suite in the finished() helper.
> 
> Signed-off-by: Laura Nao <laura.nao@...labora.com>
> ---
>   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:
>           exit_code = KSFT_PASS

Laura and NĂ­colas,

I saw both your emails explaining how this fixes the problem in
a previous patch.

However looks like you haven't see my response about the implications
of the exit_code = KSFT_PASS when tests are skipped.

if ksft_cnt["pass"] + ksft_cnt["skip"] == ksft_num_tests:
>           exit_code = KSFT_PASS

Let me reiterate in case you missed it:

There is a reason why you don't want to mark all tests passed
when there are several skips.Skips are an indication that
there are several tests and/or test cases that couldn't not
be run because of unmet dependencies. This condition needs
to be investigated to see if there are any config options
that could be enabled to get a better coverage.

Including skips to determine pass gives a false sense security
that all is well when it isn't.

So it is incorrect to set the exit code to KSFT_PASS when there
are skipped tests.

+    if ksft_cnt["pass"] + ksft_cnt["skip"] == ksft_num_tests:


>       else:
>           exit_code = KSFT_FAIL

The logic here seems to not take into account when you have a
conditions where you have a mixed results of passed tests,
skipped tests, and failed tests.

Please revisit and figure out how to address this and report
the status correctly.

thanks,
-- Shuah



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ