Re: [PATCH 3/3] kselftest: make callers of ksft_exit_skip() output the reason for skipping

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/15/2017 09:54 AM, Paul Elder wrote:
> Make the three tests that did use the old ksft_ext_skip()
> (breakpoints/breakpoint_test_arm64, breakpoints/step_after_suspend_test,
> and membarrier_test) use the new one, with an output for the
> reason for skipping all the tests.
> 
> Signed-off-by: Paul Elder <paul.elder@xxxxxxxx>
> ---
>  tools/testing/selftests/breakpoints/breakpoint_test_arm64.c   | 3 +--
>  tools/testing/selftests/breakpoints/step_after_suspend_test.c | 4 ++--
>  tools/testing/selftests/membarrier/membarrier_test.c          | 7 +++----
>  3 files changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c b/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c
> index 3897e996541e..fa6d57af5217 100644
> --- a/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c
> +++ b/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c
> @@ -101,9 +101,8 @@ static bool set_watchpoint(pid_t pid, int size, int wp)
>  		return true;
>  
>  	if (errno == EIO) {
> -		printf("ptrace(PTRACE_SETREGSET, NT_ARM_HW_WATCH) "
> +		ksft_exit_skip("ptrace(PTRACE_SETREGSET, NT_ARM_HW_WATCH) "
>  			"not supported on this hardware\n");
> -		ksft_exit_skip();
>  	}
>  	perror("ptrace(PTRACE_SETREGSET, NT_ARM_HW_WATCH) failed");
>  	return false;
> diff --git a/tools/testing/selftests/breakpoints/step_after_suspend_test.c b/tools/testing/selftests/breakpoints/step_after_suspend_test.c
> index bf37c1087f25..c60c2effb6bc 100644
> --- a/tools/testing/selftests/breakpoints/step_after_suspend_test.c
> +++ b/tools/testing/selftests/breakpoints/step_after_suspend_test.c
> @@ -83,8 +83,8 @@ bool run_test(int cpu)
>  
>  	if (ptrace(PTRACE_SINGLESTEP, pid, NULL, NULL) < 0) {
>  		if (errno == EIO) {
> -			printf("ptrace(PTRACE_SINGLESTEP) not supported on this architecture\n");
> -			ksft_exit_skip();
> +			ksft_exit_skip("ptrace(PTRACE_SINGLESTEP) "
> +				"not supported on this architecture");
>  		}
>  		perror("ptrace(PTRACE_SINGLESTEP) failed");
>  		return false;
> diff --git a/tools/testing/selftests/membarrier/membarrier_test.c b/tools/testing/selftests/membarrier/membarrier_test.c
> index 7925fcf9262b..74a712eab2e6 100644
> --- a/tools/testing/selftests/membarrier/membarrier_test.c
> +++ b/tools/testing/selftests/membarrier/membarrier_test.c
> @@ -87,8 +87,7 @@ static enum test_membarrier_status test_membarrier_query(void)
>  			 * It is valid to build a kernel with
>  			 * CONFIG_MEMBARRIER=n. However, this skips the tests.
>  			 */
> -			ksft_test_result_skip("CONFIG_MEMBARRIER is not enabled\n");
> -			return ksft_exit_skip();
> +			ksft_exit_skip("CONFIG_MEMBARRIER is not enabled\n");
>  		}
>  		ksft_test_result_fail("sys_membarrier() failed\n");
>  		return TEST_MEMBARRIER_FAIL;
> @@ -108,13 +107,13 @@ int main(int argc, char **argv)
>  	case TEST_MEMBARRIER_FAIL:
>  		return ksft_exit_fail();
>  	case TEST_MEMBARRIER_SKIP:
> -		return ksft_exit_skip();
> +		return ksft_exit_skip(NULL);
>  	}
>  	switch (test_membarrier()) {
>  	case TEST_MEMBARRIER_FAIL:
>  		return ksft_exit_fail();
>  	case TEST_MEMBARRIER_SKIP:
> -		return ksft_exit_skip();
> +		return ksft_exit_skip(NULL);
>  	}
>  
>  	return ksft_exit_pass();
> 

Applied this one to linux-kselftest next for 4.13-rc1

thanks,
-- Shuah
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux