Skip to content

Commit 8c9eea7

Browse files
Muhammad Usama Anjumakpm00
authored andcommitted
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>
1 parent 9a21701 commit 8c9eea7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/testing/selftests/mm/compaction_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ int main(int argc, char **argv)
173173

174174
ksft_print_header();
175175

176-
if (prereq() != 0)
176+
if (prereq() || geteuid())
177177
return ksft_exit_pass();
178178

179179
ksft_set_plan(1);

0 commit comments

Comments
 (0)