BPF List
 help / color / mirror / Atom feed
* [PATCH bpf] selftests/bpf: Reject unsupported -k option in vmtest.sh
@ 2026-05-16 12:06 Roman Kvasnytskyi
  2026-05-18 11:30 ` Paul Chaignon
  2026-05-19  2:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Roman Kvasnytskyi @ 2026-05-16 12:06 UTC (permalink / raw)
  To: bpf
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau, Eduard Zingerman, Kumar Kartikeya Dwivedi,
	Song Liu, Yonghong Song, Jiri Olsa, Shuah Khan, KP Singh,
	linux-kselftest, linux-kernel, Roman Kvasnytskyi

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>
---
 tools/testing/selftests/bpf/vmtest.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/vmtest.sh b/tools/testing/selftests/bpf/vmtest.sh
index 2f869daf8a06..9ca802285393 100755
--- a/tools/testing/selftests/bpf/vmtest.sh
+++ b/tools/testing/selftests/bpf/vmtest.sh
@@ -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"

base-commit: a828abbb897657451d96ad7bf20f1893ac983bb9
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf] selftests/bpf: Reject unsupported -k option in vmtest.sh
  2026-05-16 12:06 [PATCH bpf] selftests/bpf: Reject unsupported -k option in vmtest.sh Roman Kvasnytskyi
@ 2026-05-18 11:30 ` Paul Chaignon
  2026-05-19  2:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Chaignon @ 2026-05-18 11:30 UTC (permalink / raw)
  To: Roman Kvasnytskyi
  Cc: bpf, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau, Eduard Zingerman, Kumar Kartikeya Dwivedi,
	Song Liu, Yonghong Song, Jiri Olsa, Shuah Khan, KP Singh,
	linux-kselftest, linux-kernel

On Sat, May 16, 2026 at 02:06:25PM +0200, Roman Kvasnytskyi wrote:
> 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>

I'm unsure this needs to go through the bpf tree, but it currently
applies cleanly to both bpf-next and bpf anyway.

Acked-by: Paul Chaignon <paul.chaignon@gmail.com>

> ---
>  tools/testing/selftests/bpf/vmtest.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/bpf/vmtest.sh b/tools/testing/selftests/bpf/vmtest.sh
> index 2f869daf8a06..9ca802285393 100755
> --- a/tools/testing/selftests/bpf/vmtest.sh
> +++ b/tools/testing/selftests/bpf/vmtest.sh
> @@ -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"
> 
> base-commit: a828abbb897657451d96ad7bf20f1893ac983bb9
> -- 
> 2.54.0
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf] selftests/bpf: Reject unsupported -k option in vmtest.sh
  2026-05-16 12:06 [PATCH bpf] selftests/bpf: Reject unsupported -k option in vmtest.sh Roman Kvasnytskyi
  2026-05-18 11:30 ` Paul Chaignon
@ 2026-05-19  2:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-05-19  2:10 UTC (permalink / raw)
  To: Roman Kvasnytskyi
  Cc: bpf, ast, daniel, andrii, martin.lau, eddyz87, memxor, song,
	yonghong.song, jolsa, shuah, kpsingh, linux-kselftest,
	linux-kernel

Hello:

This patch was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@kernel.org>:

On Sat, 16 May 2026 14:06:25 +0200 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [bpf] selftests/bpf: Reject unsupported -k option in vmtest.sh
    https://git.kernel.org/bpf/bpf-next/c/6df582112aa9

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-19  2:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-16 12:06 [PATCH bpf] selftests/bpf: Reject unsupported -k option in vmtest.sh Roman Kvasnytskyi
2026-05-18 11:30 ` Paul Chaignon
2026-05-19  2:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox