diff mbox series

[6/6] kselftest/arm64: Fix check_user_mem test

Message ID 20201026121248.2340-7-vincenzo.frascino@arm.com (mailing list archive)
State New, archived
Headers show
Series kselftest/arm64: MTE fixes | expand

Commit Message

Vincenzo Frascino Oct. 26, 2020, 12:12 p.m. UTC
The check_user_mem test reports the error below because the test
plan is not declared correctly:

  # Planned tests != run tests (0 != 4)

Fix the test adding the correct test plan declaration.

Fixes: 4dafc08d0ba4 ("kselftest/arm64: Check mte tagged user address in kernel")
Cc: Shuah Khan <shuah@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Gabor Kertesz <gabor.kertesz@arm.com>
Cc: Amit Daniel Kachhap <amit.kachhap@arm.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
---
 tools/testing/selftests/arm64/mte/check_user_mem.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Amit Daniel Kachhap Oct. 27, 2020, 10:34 a.m. UTC | #1
On 10/26/20 5:42 PM, Vincenzo Frascino wrote:
> The check_user_mem test reports the error below because the test
> plan is not declared correctly:
> 
>    # Planned tests != run tests (0 != 4)
> 
> Fix the test adding the correct test plan declaration.

This change looks fine and got missed earlier.
Acked by: Amit Daniel Kachhap <amit.kachhap@arm.com>

> 
> Fixes: 4dafc08d0ba4 ("kselftest/arm64: Check mte tagged user address in kernel")
> Cc: Shuah Khan <shuah@kernel.org>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Gabor Kertesz <gabor.kertesz@arm.com>
> Cc: Amit Daniel Kachhap <amit.kachhap@arm.com>
> Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
> ---
>   tools/testing/selftests/arm64/mte/check_user_mem.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/tools/testing/selftests/arm64/mte/check_user_mem.c b/tools/testing/selftests/arm64/mte/check_user_mem.c
> index 594e98e76880..4bfa80f2a8c3 100644
> --- a/tools/testing/selftests/arm64/mte/check_user_mem.c
> +++ b/tools/testing/selftests/arm64/mte/check_user_mem.c
> @@ -92,9 +92,13 @@ int main(int argc, char *argv[])
>   	err = mte_default_setup();
>   	if (err)
>   		return err;
> +
>   	/* Register signal handlers */
>   	mte_register_signal(SIGSEGV, mte_default_handler);
>   
> +	/* Set test plan */
> +	ksft_set_plan(4);
> +
>   	evaluate_test(check_usermem_access_fault(USE_MMAP, MTE_SYNC_ERR, MAP_PRIVATE),
>   		"Check memory access from kernel in sync mode, private mapping and mmap memory\n");
>   	evaluate_test(check_usermem_access_fault(USE_MMAP, MTE_SYNC_ERR, MAP_SHARED),
>
diff mbox series

Patch

diff --git a/tools/testing/selftests/arm64/mte/check_user_mem.c b/tools/testing/selftests/arm64/mte/check_user_mem.c
index 594e98e76880..4bfa80f2a8c3 100644
--- a/tools/testing/selftests/arm64/mte/check_user_mem.c
+++ b/tools/testing/selftests/arm64/mte/check_user_mem.c
@@ -92,9 +92,13 @@  int main(int argc, char *argv[])
 	err = mte_default_setup();
 	if (err)
 		return err;
+
 	/* Register signal handlers */
 	mte_register_signal(SIGSEGV, mte_default_handler);
 
+	/* Set test plan */
+	ksft_set_plan(4);
+
 	evaluate_test(check_usermem_access_fault(USE_MMAP, MTE_SYNC_ERR, MAP_PRIVATE),
 		"Check memory access from kernel in sync mode, private mapping and mmap memory\n");
 	evaluate_test(check_usermem_access_fault(USE_MMAP, MTE_SYNC_ERR, MAP_SHARED),