Re: [PATCH RESEND] selftests/mm: Exit on invalid command-line options

From: David Hildenbrand (Arm)

Date: Mon Sep 07 2026 - 08:05:02 EST


On 9/6/26 15:54, Tianyi Chen wrote:
> getopts reports unknown options and missing option arguments, but
> run_vmtests.sh ignores its error result and continues running tests.
> For example, passing -z or omitting the argument to -t can run the
> default test selection instead of rejecting the command.
>
> Exit with failure when getopts reports an error, before any tests or
> their setup run. Keep the diagnostic provided by getopts.
>
> Verified that -z, -t and -t mmap -z exit with status 1, while -h still
> exits with status 0. The mmap category's three test programs pass in
> a VM running the kernel built from the same source tree.

I wonder whether we also bail out on wrong/missing categories?

It's also interesting that we do the /proc/sys/kernel/yama/ptrace_scope stuff
even when not actually running the memfd_secret test.

--
Cheers,

David