[X][SRU][PATCH 1/2] selftests: efivarfs: return Kselftest Skip code for skipped tests

Po-Hsu Lin po-hsu.lin at canonical.com
Fri Jan 3 10:52:41 UTC 2020


From: "Shuah Khan (Samsung OSG)" <shuah at kernel.org>

BugLink: https://bugs.launchpad.net/bugs/1809704

When efivarfs test is skipped because of unmet dependencies and/or
unsupported configuration, it returns 0 which is treated as a pass
by the Kselftest framework. This leads to false positive result even
when the test could not be run.

Change it to return kselftest skip code when a test gets skipped to
clearly report that the test could not be run.

Kselftest framework SKIP code is 4 and the framework prints appropriate
messages to indicate that the test is skipped.

Signed-off-by: Shuah Khan (Samsung OSG) <shuah at kernel.org>
(backported from commit 1f0ea95853bd55a1812f2903b2f776853069f21f)
[PHLin: return 0 as the framework can't handle ksft_skip]
Signed-off-by: Po-Hsu Lin <po-hsu.lin at canonical.com>
---
 tools/testing/selftests/efivarfs/efivarfs.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/testing/selftests/efivarfs/efivarfs.sh b/tools/testing/selftests/efivarfs/efivarfs.sh
index 0572784..6a9c443 100755
--- a/tools/testing/selftests/efivarfs/efivarfs.sh
+++ b/tools/testing/selftests/efivarfs/efivarfs.sh
@@ -3,6 +3,9 @@
 efivarfs_mount=/sys/firmware/efi/efivars
 test_guid=210be57c-9849-4fc7-a635-e6382d1aec27
 
+# Kselftest framework requirement - SKIP code is 4.
+ksft_skip=4
+
 check_prereqs()
 {
 	local msg="skip all tests:"
-- 
2.7.4




More information about the kernel-team mailing list