aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/firmware/fw_lib.sh
diff options
context:
space:
mode:
authorShuah Khan (Samsung OSG) <shuah@kernel.org>2018-05-03 16:34:22 -0600
committerShuah Khan (Samsung OSG) <shuah@kernel.org>2018-05-30 15:21:52 -0600
commita6a9be9270c871b22725c34de35a21d918867672 (patch)
tree741482531745194d467871f7076da24f7dbf61f0 /tools/testing/selftests/firmware/fw_lib.sh
parentselftests: filesystems: return Kselftest Skip code for skipped tests (diff)
downloadlinux-dev-a6a9be9270c871b22725c34de35a21d918867672.tar.xz
linux-dev-a6a9be9270c871b22725c34de35a21d918867672.zip
selftests: firmware: return Kselftest Skip code for skipped tests
When firmware test(s) get 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@kernel.org> Reviewed-by: Luis R. Rodriguez <mcgrof@kernel.org> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
Diffstat (limited to 'tools/testing/selftests/firmware/fw_lib.sh')
-rwxr-xr-xtools/testing/selftests/firmware/fw_lib.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/testing/selftests/firmware/fw_lib.sh b/tools/testing/selftests/firmware/fw_lib.sh
index 962d7f4ac627..6c5f1b2ffb74 100755
--- a/tools/testing/selftests/firmware/fw_lib.sh
+++ b/tools/testing/selftests/firmware/fw_lib.sh
@@ -9,11 +9,14 @@ DIR=/sys/devices/virtual/misc/test_firmware
PROC_CONFIG="/proc/config.gz"
TEST_DIR=$(dirname $0)
+# Kselftest framework requirement - SKIP code is 4.
+ksft_skip=4
+
print_reqs_exit()
{
echo "You must have the following enabled in your kernel:" >&2
cat $TEST_DIR/config >&2
- exit 1
+ exit $ksft_skip
}
test_modprobe()
@@ -88,7 +91,7 @@ verify_reqs()
if [ "$TEST_REQS_FW_SYSFS_FALLBACK" = "yes" ]; then
if [ ! "$HAS_FW_LOADER_USER_HELPER" = "yes" ]; then
echo "usermode helper disabled so ignoring test"
- exit 0
+ exit $ksft_skip
fi
fi
}