]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests: memfd: return Kselftest Skip code for skipped tests
authorShuah Khan (Samsung OSG) <shuah@kernel.org>
Fri, 4 May 2018 19:33:37 +0000 (13:33 -0600)
committerShuah Khan (Samsung OSG) <shuah@kernel.org>
Wed, 30 May 2018 21:29:06 +0000 (15:29 -0600)
commitb27f0259e8cea74c627327c063742a83613dd460
treebe6111540155415ad3c37f73f9ae51e552d4bb52
parent39d69997e4060bdd6fd7df4219ab3a2cb0669276
selftests: memfd: return Kselftest Skip code for skipped tests

When memfd test is skipped because of unmet dependencies and/or unsupported
configuration, it returns non-zero value 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.

Added an explicit check for root user at the start of memfd hugetlbfs test
and return skip code if a non-root user attempts to run it.

In addition, return skip code when not enough huge pages are available to
run the test.

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: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
tools/testing/selftests/memfd/run_tests.sh