]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ktest: Honor empty per-test option overrides
authorRicardo B. Marlière <rbm@suse.com>
Sat, 7 Mar 2026 22:07:59 +0000 (19:07 -0300)
committerSteven Rostedt <rostedt@goodmis.org>
Mon, 9 Mar 2026 14:32:07 +0000 (10:32 -0400)
commita2de57a3c8192dcd67cccaff6c341b93748d799b
treee3d474b0e63aad381ff284396c161081842e95ec
parenta2706c6c4ab5f74366740576b4d06b17392f0086
ktest: Honor empty per-test option overrides

A per-test override can clear an inherited default option by assigning an
empty value, but __set_test_option() still used option_defined() to decide
whether a per-test key existed. That turned an empty per-test assignment
back into "fall back to the default", so tests still could not clear
inherited settings.

For example:

  DEFAULTS
  (...)
  LOG_FILE = /tmp/ktest-empty-override.log
  CLEAR_LOG = 1
  ADD_CONFIG = /tmp/.config

  TEST_START
  TEST_TYPE = build
  BUILD_TYPE = nobuild
  ADD_CONFIG =

This would run the test with ADD_CONFIG[1] = /tmp/.config

Fix by checking whether the per-test key exists before falling back. If it
does exist but is empty, treat it as unset for that test and stop the
fallback chain there.

Cc: John Hawley <warthog9@eaglescrag.net>
Cc: Andrea Righi <arighi@nvidia.com>
Cc: Marcos Paulo de Souza <mpdesouza@suse.com>
Cc: Matthieu Baerts <matttbe@kernel.org>
Cc: Fernando Fernandez Mancera <fmancera@suse.de>
Cc: Pedro Falcato <pfalcato@suse.de>
Link: https://patch.msgid.link/20260307-ktest-fixes-v1-4-565d412f4925@suse.com
Fixes: 22c37a9ac49d ("ktest: Allow tests to undefine default options")
Signed-off-by: Ricardo B. Marlière <rbm@suse.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
tools/testing/ktest/ktest.pl