diff options
author | Shuah Khan (Samsung OSG) <shuah@kernel.org> | 2018-05-04 23:26:10 +0300 |
---|---|---|
committer | Shuah Khan (Samsung OSG) <shuah@kernel.org> | 2018-05-31 00:29:06 +0300 |
commit | e6ee6ae4a170335d685571f38510505dd62cc6a4 (patch) | |
tree | b36dc2e7b58228e2acecbcf2fe204144db579e39 /tools/testing/selftests/mqueue/mq_perf_tests.c | |
parent | e1890c502ca7f0bb13a7372dc8945f5e06832346 (diff) | |
download | linux-e6ee6ae4a170335d685571f38510505dd62cc6a4.tar.xz |
selftests: mqueue: return Kselftest Skip code for skipped tests
When mqueue 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.
Change it to use ksft_exit_skip() when the test is skipped.
Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
Diffstat (limited to 'tools/testing/selftests/mqueue/mq_perf_tests.c')
-rw-r--r-- | tools/testing/selftests/mqueue/mq_perf_tests.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/testing/selftests/mqueue/mq_perf_tests.c b/tools/testing/selftests/mqueue/mq_perf_tests.c index 8188f72de93c..b019e0b8221c 100644 --- a/tools/testing/selftests/mqueue/mq_perf_tests.c +++ b/tools/testing/selftests/mqueue/mq_perf_tests.c @@ -39,6 +39,8 @@ #include <popt.h> #include <error.h> +#include "../kselftest.h" + static char *usage = "Usage:\n" " %s [-c #[,#..] -f] path\n" @@ -626,12 +628,10 @@ int main(int argc, char *argv[]) cpus_to_pin[0] = cpus_online - 1; } - if (getuid() != 0) { - fprintf(stderr, "Not running as root, but almost all tests " + if (getuid() != 0) + ksft_exit_skip("Not running as root, but almost all tests " "require root in order to modify\nsystem settings. " "Exiting.\n"); - exit(1); - } max_msgs = fopen(MAX_MSGS, "r+"); max_msgsize = fopen(MAX_MSGSIZE, "r+"); |