diff options
author | Shuah Khan (Samsung OSG) <shuah@kernel.org> | 2018-06-14 16:56:13 -0600 |
---|---|---|
committer | Shuah Khan (Samsung OSG) <shuah@kernel.org> | 2018-06-18 09:11:09 -0600 |
commit | 685814466bf8398192cf855415a0bb2cefc1930e (patch) | |
tree | 31e9547b2ef9809398f18d42ac129333a6e352a2 /tools/testing/selftests/zram/zram_lib.sh | |
parent | d7d5311d4aa9611fe1a5a851e6f75733237a668a (diff) | |
download | linux-685814466bf8398192cf855415a0bb2cefc1930e.tar.bz2 |
selftests: zram: return Kselftest Skip code for skipped tests
When zram 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>
Diffstat (limited to 'tools/testing/selftests/zram/zram_lib.sh')
-rwxr-xr-x | tools/testing/selftests/zram/zram_lib.sh | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/testing/selftests/zram/zram_lib.sh b/tools/testing/selftests/zram/zram_lib.sh index f6a9c73e7a44..9e73a4fb9b0a 100755 --- a/tools/testing/selftests/zram/zram_lib.sh +++ b/tools/testing/selftests/zram/zram_lib.sh @@ -18,6 +18,9 @@ MODULE=0 dev_makeswap=-1 dev_mounted=-1 +# Kselftest framework requirement - SKIP code is 4. +ksft_skip=4 + trap INT check_prereqs() @@ -27,7 +30,7 @@ check_prereqs() if [ $uid -ne 0 ]; then echo $msg must be run as root >&2 - exit 0 + exit $ksft_skip fi } |