selftests: sysctl: return Kselftest Skip code for skipped tests
authorShuah Khan (Samsung OSG) <shuah@kernel.org>
Wed, 13 Jun 2018 00:11:37 +0000 (18:11 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Aug 2018 11:08:57 +0000 (13:08 +0200)
commitd5f9d1d350bc452c1fb5f4a184ccc6dd74a2946d
tree6495636c2ec74b5bac04ed2634f01e53e48439df
parentbc5e458a9ee234b5454e91ee56dc1fb870f9437f
selftests: sysctl: return Kselftest Skip code for skipped tests

[ Upstream commit c7db6ffb831fd36a03485a0d88b1e505378975ad ]

When sysctl 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.

Changed return code to kselftest skip code in skip error legs that check
requirements and module probe test error leg.

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: Kees Cook <keescook@chromium.org>
Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/sysctl/sysctl.sh