aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMuhammad Usama Anjum2024-01-01 13:36:13 +0500
committerAndrew Morton2024-01-05 10:17:48 -0800
commit8c9eea721a9837b227abcc9374862f4cefc71530 (patch)
treee02a23ba05261e4acba56de51c4ea9cd99754baf /tools
parent9a21701edc41465de56f97914741bfb7bfc2517d (diff)
selftests/mm: skip test if application doesn't has root privileges
The test depends on writing to nr_hugepages which isn't possible without root privileges. So skip the test in this case. Link: https://lkml.kernel.org/r/20240101083614.1076768-2-usama.anjum@collabora.com Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com> Cc: Shuah Khan <shuah@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/mm/compaction_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/mm/compaction_test.c b/tools/testing/selftests/mm/compaction_test.c
index 707b0809b717..656afba02dbc 100644
--- a/tools/testing/selftests/mm/compaction_test.c
+++ b/tools/testing/selftests/mm/compaction_test.c
@@ -173,7 +173,7 @@ int main(int argc, char **argv)
ksft_print_header();
- if (prereq() != 0)
+ if (prereq() || geteuid())
return ksft_exit_pass();
ksft_set_plan(1);