]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests/mm: fix assumption that sudo is present
authorBrendan Jackman <jackmanb@google.com>
Fri, 21 Feb 2025 18:25:41 +0000 (18:25 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 28 Feb 2025 01:00:26 +0000 (17:00 -0800)
commitef5a5b91dbda9841c5a4b8c6b4304894b589e67d
treec4955b6ac46e7c2b6e3401bb780247dd79176dc5
parentf652d56e2a584dc4f3181bcab1f79b1fb72772a8
selftests/mm: fix assumption that sudo is present

If we are root, sudo isn't needed.  If we are not root, we need sudo, so
skip the test if it isn't present.

We already do this for on-fault-limit, but this uses separate
infrastructure since that is specifically for sudo-ing to the nobody user.

Note this ptrace_skip configuration still fails if that file doesn't
exist, but in that case the test is still fine, so this just prints an
error but doesn't break anything.  I suspect that's probably deliberate.

Link: https://lkml.kernel.org/r/20250221-mm-selftests-v2-2-28c4d66383c5@google.com
Signed-off-by: Brendan Jackman <jackmanb@google.com>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Mateusz Guzik <mjguzik@gmail.com>
Cc: Shuah Khan (Samsung OSG) <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/mm/run_vmtests.sh