aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/vm/run_vmtests
diff options
context:
space:
mode:
authorShuah Khan (Samsung OSG) <shuah@kernel.org>2018-06-13 21:31:43 -0600
committerShuah Khan (Samsung OSG) <shuah@kernel.org>2018-06-18 09:11:10 -0600
commita4d7537789724985cafbc9260a31ca4f2b7cf123 (patch)
tree76e6ab57460e803874f61b93662e22f9e3b20261 /tools/testing/selftests/vm/run_vmtests
parentselftests: zram: return Kselftest Skip code for skipped tests (diff)
downloadlinux-dev-a4d7537789724985cafbc9260a31ca4f2b7cf123.tar.xz
linux-dev-a4d7537789724985cafbc9260a31ca4f2b7cf123.zip
selftests: vm: return Kselftest Skip code for skipped tests
When vm test is skipped because of unmet dependencies and/or unsupported configuration, it exits with error which 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> Acked-by: Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
Diffstat (limited to 'tools/testing/selftests/vm/run_vmtests')
-rwxr-xr-xtools/testing/selftests/vm/run_vmtests5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/testing/selftests/vm/run_vmtests b/tools/testing/selftests/vm/run_vmtests
index 22d564673830..88cbe5575f0c 100755
--- a/tools/testing/selftests/vm/run_vmtests
+++ b/tools/testing/selftests/vm/run_vmtests
@@ -2,6 +2,9 @@
# SPDX-License-Identifier: GPL-2.0
#please run as root
+# Kselftest framework requirement - SKIP code is 4.
+ksft_skip=4
+
mnt=./huge
exitcode=0
@@ -36,7 +39,7 @@ if [ -n "$freepgs" ] && [ -n "$hpgsize_KB" ]; then
echo $(( $lackpgs + $nr_hugepgs )) > /proc/sys/vm/nr_hugepages
if [ $? -ne 0 ]; then
echo "Please run this test as root"
- exit 1
+ exit $ksft_skip
fi
while read name size unit; do
if [ "$name" = "HugePages_Free:" ]; then