summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/lib/prime_numbers.sh
diff options
context:
space:
mode:
authorShuah Khan (Samsung OSG) <shuah@kernel.org>2018-05-04 19:11:52 +0300
committerShuah Khan (Samsung OSG) <shuah@kernel.org>2018-05-31 00:29:06 +0300
commitb26862450d74b2a17e22c5d7cdec1707d03b82b6 (patch)
tree947a5a6c1916f6e66a3dc147c66ae1db02b6ef2b /tools/testing/selftests/lib/prime_numbers.sh
parent9b8f8e7f33b290ae49c04c4ee5be7d1d603cc31f (diff)
downloadlinux-b26862450d74b2a17e22c5d7cdec1707d03b82b6.tar.xz
selftests: lib: return Kselftest Skip code for skipped tests
When lib test(s) is skipped because of unmet dependencies and/or unsupported configuration, it returns non-zero value hich is treated as a fail by the Kselftest framework. This leads to false negative 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>
Diffstat (limited to 'tools/testing/selftests/lib/prime_numbers.sh')
-rwxr-xr-xtools/testing/selftests/lib/prime_numbers.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/testing/selftests/lib/prime_numbers.sh b/tools/testing/selftests/lib/prime_numbers.sh
index b363994e5e11..76602d4b050f 100755
--- a/tools/testing/selftests/lib/prime_numbers.sh
+++ b/tools/testing/selftests/lib/prime_numbers.sh
@@ -2,9 +2,12 @@
# SPDX-License-Identifier: GPL-2.0
# Checks fast/slow prime_number generation for inconsistencies
+# Kselftest framework requirement - SKIP code is 4.
+ksft_skip=4
+
if ! /sbin/modprobe -q -r prime_numbers; then
- echo "prime_numbers: [SKIP]"
- exit 77
+ echo "prime_numbers: module prime_numbers is not found [SKIP]"
+ exit $ksft_skip
fi
if /sbin/modprobe -q prime_numbers selftest=65536; then