]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selftests/bpf: Reject unsupported -k option in vmtest.sh
authorRoman Kvasnytskyi <roman@kvasnytskyi.net>
Sat, 16 May 2026 12:06:25 +0000 (14:06 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 19 May 2026 02:03:22 +0000 (19:03 -0700)
vmtest.sh does not document a -k option and does not handle it in the
getopts case statement. However, the getopts optstring includes k, which
causes the script to accept -k silently instead of reporting it as an
invalid option.

Remove k from the optstring so unsupported options are rejected through
the existing invalid-option path.

Fixes: c9709f52386d ("bpf: Helper script for running BPF presubmit tests")
Signed-off-by: Roman Kvasnytskyi <roman@kvasnytskyi.net>
Acked-by: Paul Chaignon <paul.chaignon@gmail.com>
Link: https://lore.kernel.org/r/20260516120625.80839-1-roman@kvasnytskyi.net
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/vmtest.sh

index 2f869daf8a06b775e12d434e96b4673cd50e2bc4..9ca8022853933a388a0c9128155c449841ac3930 100755 (executable)
@@ -382,7 +382,7 @@ main()
        local exit_command="poweroff -f"
        local debug_shell="no"
 
-       while getopts ':hskl:id:j:' opt; do
+       while getopts ':hsl:id:j:' opt; do
                case ${opt} in
                l)
                        LOCAL_ROOTFS_IMAGE="$OPTARG"