selftests/powerpc: Fix exit status of pkey tests
PATCH 1/1 selftests/powerpc: Fix exit status of pkey tests
Since main() does not return a value explicitly, the return values from FAIL_IF() conditions are ignored and the tests can still pass irrespective of failures. This makes sure that we always explicitly return the correct test exit status.
--- tools/testing/selftests/powerpc/mm/pkey_exec_prot.c | 2 +- tools/testing/selftests/powerpc/mm/pkey_siginfo.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/powerpc/mm/pkey_exec_prot.c +1 -1
@@ -290,5 +290,5 @@ static int test(void)int main (void ) { -test_harness (test,"pkey_exec_prot" ); +return test_harness (test,"pkey_exec_prot" ); }
tools/testing/selftests/powerpc/mm/pkey_siginfo.c +1 -1
@@ -329,5 +329,5 @@ static int test(void)int main (void ) { -test_harness (test,"pkey_siginfo" ); +return test_harness (test,"pkey_siginfo" ); }
Signature · 1 line
2.25.1
Quoted 6 lines · Sandipan Das
Since
main()does not return a value explicitly, the return values fromFAIL_IF()conditions are ignored and the tests can still pass irrespective of failures. This makes sure that we always explicitly return the correct test exit status.
Quoted 33 lines
Reported-by Eirik Fuller <[email protected]>Fixes 1addb6444791 ("selftests/powerpc: Add test for execute-disabled pkeys")Fixes c27f2fd1705a ("selftests/powerpc: Add test for pkey siginfo verification")Signed-off-by Sandipan Das <[email protected]>--- tools/testing/selftests/powerpc/mm/pkey_exec_prot.c | 2 +- tools/testing/selftests/powerpc/mm/pkey_siginfo.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)tools/testing/selftests/powerpc/mm/pkey_exec_prot.c +1
-1@@ -290,5 +290,5 @@ static int test(void)int main (void ) { -test_harness (test,"pkey_exec_prot" ); +return test_harness (test,"pkey_exec_prot" ); }tools/testing/selftests/powerpc/mm/pkey_siginfo.c +1
-1@@ -329,5 +329,5 @@ static int test(void)int main (void ) { -test_harness (test,"pkey_siginfo" ); +return test_harness (test,"pkey_siginfo" ); }Signature · 1 line
2.25.1
Michael Ellerman
AppliedQuoted 5 lines · Sandipan Das
Since
main()does not return a value explicitly, the return values fromFAIL_IF()conditions are ignored and the tests can still pass irrespective of failures. This makes sure that we always explicitly return the correct test exit status.
Applied to powerpc/fixes.
[1/1] selftests/powerpc: Fix exit status of pkey tests
https://git.kernel.org/powerpc/c/92a5e1fdb286851d5bd0eb966b8d075be27cf5ee
cheers