mbox series

[v3,0/2] selftests: pidfd: prefer ksft_test_result_skip to ksft_exit_*

Message ID 20200707101936.12052-1-pbonzini@redhat.com (mailing list archive)
Headers show
Series selftests: pidfd: prefer ksft_test_result_skip to ksft_exit_* | expand

Message

Paolo Bonzini July 7, 2020, 10:19 a.m. UTC
Calling ksft_exit_* results in executing fewer tests than planned, which
is wrong for ksft_exit_skip or suboptimal (because it results in a bail
out) for ksft_exit_fail_msg.

Using ksft_test_result_skip instead skips only one test and lets the
test plan proceed as promised by ksft_set_plan.

Paolo

Paolo Bonzini (2):
  selftests: pidfd: do not use ksft_exit_skip after ksft_set_plan
  selftests: pidfd: skip test if unshare fails with EPERM

 tools/testing/selftests/pidfd/pidfd_test.c | 55 ++++++++++++++++++----
 1 file changed, 46 insertions(+), 9 deletions(-)

Comments

Christian Brauner July 7, 2020, 1:52 p.m. UTC | #1
On Tue, Jul 07, 2020 at 06:19:34AM -0400, Paolo Bonzini wrote:
> Calling ksft_exit_* results in executing fewer tests than planned, which
> is wrong for ksft_exit_skip or suboptimal (because it results in a bail
> out) for ksft_exit_fail_msg.
> 
> Using ksft_test_result_skip instead skips only one test and lets the
> test plan proceed as promised by ksft_set_plan.
> 
> Paolo

Thanks for fixing this, Paolo!
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>

Shuah, want me to take it or do you want to take it?
Shuah Khan July 7, 2020, 2:47 p.m. UTC | #2
On 7/7/20 7:52 AM, Christian Brauner wrote:
> On Tue, Jul 07, 2020 at 06:19:34AM -0400, Paolo Bonzini wrote:
>> Calling ksft_exit_* results in executing fewer tests than planned, which
>> is wrong for ksft_exit_skip or suboptimal (because it results in a bail
>> out) for ksft_exit_fail_msg.
>>
>> Using ksft_test_result_skip instead skips only one test and lets the
>> test plan proceed as promised by ksft_set_plan.
>>
>> Paolo
> 
> Thanks for fixing this, Paolo!
> Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
> 
> Shuah, want me to take it or do you want to take it?
> 

I will apply it to my tree with Paolo's other patches in this series.

thanks,
-- Shuah