linux/tools/testing
Ricardo B. Marlière 16554d0244 ktest: Honor empty per-test option overrides
[ Upstream commit a2de57a3c8 ]

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: 22c37a9ac4 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-06-01 17:35:32 +02:00
..
fault-injection docs: fault-injection: convert docs to ReST and rename to *.rst 2019-06-14 14:21:07 -06:00
ktest ktest: Honor empty per-test option overrides 2026-06-01 17:35:32 +02:00
kunit kunit: tool: Import missing importlib.abc 2022-02-23 12:03:04 +01:00
nvdimm tools/testing/nvdimm: Use per-DIMM device handle 2026-01-19 13:09:52 +01:00
radix-tree idr: fix idr_alloc() returning an ID out of range 2026-01-19 13:10:02 +01:00
scatterlist Merge branch 'akpm' (patches from Andrew) 2021-09-03 10:08:28 -07:00
selftests selftest: memcg: skip memcg_sock test if address family not supported 2026-06-01 17:35:32 +02:00
vsock vsock/test: add a final full barrier after run all tests 2026-02-06 16:41:46 +01:00