Skip to contentSkip to conversation

selftest/powerpc/alignment: Fix false failures for skipped tests

PATCH RESEND Applied Sachin Sant 2 participants 2 messages Feb 26, 2017 – Mar 8, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 selftest/powerpc/alignment: Fix false failures for skipped tests

Tests under alignment subdirectory are skipped when executed on previous generation hardware, but harness still marks them as failed.

test: test_copy_unaligned
tags: git_version:unknown
[SKIP] Test skipped on line 26
skip: test_copy_unaligned
selftests: copy_unaligned [FAIL]

The MAGIC_SKIP_RETURN_VALUE value assigned to rc variable is retained till the program exit which causes the test to be marked as failed.

This patch resets the value before returning to the main() routine. With this patch the test o/p is as follows:

test: test_copy_unaligned
tags: git_version:unknown
[SKIP] Test skipped on line 26
skip: test_copy_unaligned
selftests: copy_unaligned [PASS]

---

Resend the patch as previous email did not reach the kselftest mailing list.

---

tools/testing/selftests/powerpc/harness.c +4 -2
diff -Naurp a/tools/testing/selftests/powerpc/harness.c b/tools/testing/selftests/powerpc/harness.c
@@ -114,9 +114,11 @@ int test_harness(int (test_function)(voi
 
 	rc = run_test(test_function, name);
 
-	if (rc == MAGIC_SKIP_RETURN_VALUE)
+	if (rc == MAGIC_SKIP_RETURN_VALUE) {
 		test_skip(name);
-	else
+		/* so that skipped test is not marked as failed */
+		rc = 0;
+	} else
 		test_finish(name, rc);
 
 	return rc;
#1 lore raw
Quoted 15 lines · Sachin Sant

Tests under alignment subdirectory are skipped when executed on previous generation hardware, but harness still marks them as failed.

test: test_copy_unaligned
tags: git_version:unknown
[SKIP] Test skipped on line 26
skip: test_copy_unaligned
selftests: copy_unaligned [FAIL]

The MAGIC_SKIP_RETURN_VALUE value assigned to rc variable is retained till the program exit which causes the test to be marked as failed.

This patch resets the value before returning to the main() routine. With this patch the test o/p is as follows:

Quoted 7 lines

test: test_copy_unaligned
tags: git_version:unknown
[SKIP] Test skipped on line 26
skip: test_copy_unaligned
selftests: copy_unaligned [PASS]

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/a6d8a21596df041f36f4c2ccc260c4

cheers