<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/tools/testing/ktest, branch master</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=master</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-03-18T20:00:54+00:00</updated>
<entry>
<title>ktest: Store failure logs also in fatal paths</title>
<updated>2026-03-18T20:00:54+00:00</updated>
<author>
<name>Ricardo B. Marlière</name>
<email>rbm@suse.com</email>
</author>
<published>2026-03-18T19:00:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=81fca7087466bd81fff7100d824b2c788edf7a97'/>
<id>urn:sha1:81fca7087466bd81fff7100d824b2c788edf7a97</id>
<content type='text'>
STORE_FAILURES was only saved from fail(), so paths that reached dodie()
could exit without preserving failure logs.

That includes fatal hook paths such as:

  POST_BUILD_DIE = 1

and ordinary failures when:

  DIE_ON_FAILURE = 1

Call save_logs("fail", ...) from dodie() too so fatal failures keep the
same STORE_FAILURES artifacts as non-fatal fail() paths.

Cc: John Hawley &lt;warthog9@eaglescrag.net&gt;
Link: https://patch.msgid.link/20260318-ktest-fixes-v1-1-9dd94d46d84c@suse.com
Signed-off-by: Ricardo B. Marlière &lt;rbm@suse.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ktest: Add a --dry-run mode</title>
<updated>2026-03-09T15:03:00+00:00</updated>
<author>
<name>Ricardo B. Marlière</name>
<email>rbm@suse.com</email>
</author>
<published>2026-03-07T22:08:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=229517449879b3ca8ca5588593cbea6a67ba0ad2'/>
<id>urn:sha1:229517449879b3ca8ca5588593cbea6a67ba0ad2</id>
<content type='text'>
When working on a ktest configuration, it is often useful to inspect the
final option values after includes, defaults, per-test overrides, and
variable expansion have been applied, without actually starting a test run.

Add a --dry-run option that reads the configuration, prints the test
preamble using resolved option values, and exits before opening LOG_FILE or
executing any test logic.

This is useful for debugging ktest configurations and for scripts that need
to validate the final resolved settings without triggering side effects.

Cc: John Hawley &lt;warthog9@eaglescrag.net&gt;
Cc: Andrea Righi &lt;arighi@nvidia.com&gt;
Cc: Marcos Paulo de Souza &lt;mpdesouza@suse.com&gt;
Cc: Matthieu Baerts &lt;matttbe@kernel.org&gt;
Cc: Fernando Fernandez Mancera &lt;fmancera@suse.de&gt;
Cc: Pedro Falcato &lt;pfalcato@suse.de&gt;
Link: https://patch.msgid.link/20260307-ktest-fixes-v1-9-565d412f4925@suse.com
Signed-off-by: Ricardo B. Marlière &lt;rbm@suse.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ktest: Run POST_KTEST hooks on failure and cancellation</title>
<updated>2026-03-09T15:02:18+00:00</updated>
<author>
<name>Ricardo B. Marlière</name>
<email>rbm@suse.com</email>
</author>
<published>2026-03-07T22:08:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bc6e165a452da909cef0efbc286e6695624db372'/>
<id>urn:sha1:bc6e165a452da909cef0efbc286e6695624db372</id>
<content type='text'>
PRE_KTEST can be useful for setting up the environment and POST_KTEST to
tear it down, however POST_KTEST only runs on the normal end-of-run path.
It is skipped when ktest exits through dodie() or cancel_test(). Final
cleanup hooks are skipped.

Factor the final hook execution into run_post_ktest(), call it from the
normal exit path and from the early exit paths, and guard it so the hook
runs at most once.

Cc: John Hawley &lt;warthog9@eaglescrag.net&gt;
Cc: Andrea Righi &lt;arighi@nvidia.com&gt;
Cc: Marcos Paulo de Souza &lt;mpdesouza@suse.com&gt;
Cc: Matthieu Baerts &lt;matttbe@kernel.org&gt;
Cc: Fernando Fernandez Mancera &lt;fmancera@suse.de&gt;
Cc: Pedro Falcato &lt;pfalcato@suse.de&gt;
Link: https://patch.msgid.link/20260307-ktest-fixes-v1-8-565d412f4925@suse.com
Fixes: 921ed4c7208e ("ktest: Add PRE/POST_KTEST and TEST options")
Signed-off-by: Ricardo B. Marlière &lt;rbm@suse.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ktest: Add PRE_KTEST_DIE for PRE_KTEST failures</title>
<updated>2026-03-09T14:32:08+00:00</updated>
<author>
<name>Ricardo B. Marlière</name>
<email>rbm@suse.com</email>
</author>
<published>2026-03-07T22:08:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=972816d21bb1c4eb2e5095aee34eb4b109f4c2e3'/>
<id>urn:sha1:972816d21bb1c4eb2e5095aee34eb4b109f4c2e3</id>
<content type='text'>
PRE_KTEST runs before the first test, but its return status is currently
ignored. A failing setup hook can leave the rest of the run executing in a
partially initialized environment.

Add PRE_KTEST_DIE so PRE_KTEST can fail the run in the same way
PRE_BUILD_DIE and PRE_TEST_DIE already can. Keep the default behavior
unchanged when the new option is not set.

Cc: John Hawley &lt;warthog9@eaglescrag.net&gt;
Cc: Andrea Righi &lt;arighi@nvidia.com&gt;
Cc: Marcos Paulo de Souza &lt;mpdesouza@suse.com&gt;
Cc: Matthieu Baerts &lt;matttbe@kernel.org&gt;
Cc: Fernando Fernandez Mancera &lt;fmancera@suse.de&gt;
Cc: Pedro Falcato &lt;pfalcato@suse.de&gt;
Link: https://patch.msgid.link/20260307-ktest-fixes-v1-7-565d412f4925@suse.com
Signed-off-by: Ricardo B. Marlière &lt;rbm@suse.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ktest: Stop dropping console output during power-cycle reboot</title>
<updated>2026-03-09T14:32:07+00:00</updated>
<author>
<name>Ricardo B. Marlière</name>
<email>rbm@suse.com</email>
</author>
<published>2026-03-07T22:08:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=eae247f65dece5018c83d25d165ddecd45f93dfb'/>
<id>urn:sha1:eae247f65dece5018c83d25d165ddecd45f93dfb</id>
<content type='text'>
The POWER_CYCLE fallback added to reboot() flushes monitor output at the
wrong time. In the untimed reboot path, flushing immediately after
start_monitor() can consume the first output from the new boot before
monitor() begins reading it. In the timed path, flushing after POWER_CYCLE
can eat the "Linux version" banner or REBOOT_SUCCESS_LINE from the new
kernel.

That makes ktest miss the boot it is waiting for and can trigger an
unnecessary second power cycle.

Start the monitor before POWER_CYCLE so the reference counting stays
balanced, but only flush when reboot() was asked to wait for a timed
reboot. Perform that flush before issuing POWER_CYCLE so it drains stale
output from the old kernel instead of consuming the next boot.

Cc: John Hawley &lt;warthog9@eaglescrag.net&gt;
Cc: Andrea Righi &lt;arighi@nvidia.com&gt;
Cc: Marcos Paulo de Souza &lt;mpdesouza@suse.com&gt;
Cc: Matthieu Baerts &lt;matttbe@kernel.org&gt;
Cc: Fernando Fernandez Mancera &lt;fmancera@suse.de&gt;
Cc: Pedro Falcato &lt;pfalcato@suse.de&gt;
Link: https://patch.msgid.link/20260307-ktest-fixes-v1-6-565d412f4925@suse.com
Signed-off-by: Ricardo B. Marlière &lt;rbm@suse.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ktest: Run commands through list-form shell open</title>
<updated>2026-03-09T14:32:07+00:00</updated>
<author>
<name>Ricardo B. Marlière</name>
<email>rbm@suse.com</email>
</author>
<published>2026-03-07T22:08:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fcfc25725a19e7e41f788380df82cab42226de5a'/>
<id>urn:sha1:fcfc25725a19e7e41f788380df82cab42226de5a</id>
<content type='text'>
run_command() currently uses string-form open():

  open(CMD, "$command 2&gt;&amp;1 |")

That delegates parsing to the shell but also mixes the stderr redirection
into the command string. Switch to list-form open() with an explicit sh -c
wrapper so shell syntax errors are captured in the same output stream as
command output. Otherwise, important errors can not be retrieved from the
ktest LOG_FILE.

Cc: John Hawley &lt;warthog9@eaglescrag.net&gt;
Cc: Andrea Righi &lt;arighi@nvidia.com&gt;
Cc: Marcos Paulo de Souza &lt;mpdesouza@suse.com&gt;
Cc: Matthieu Baerts &lt;matttbe@kernel.org&gt;
Cc: Fernando Fernandez Mancera &lt;fmancera@suse.de&gt;
Cc: Pedro Falcato &lt;pfalcato@suse.de&gt;
Link: https://patch.msgid.link/20260307-ktest-fixes-v1-5-565d412f4925@suse.com
Signed-off-by: Ricardo B. Marlière &lt;rbm@suse.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ktest: Honor empty per-test option overrides</title>
<updated>2026-03-09T14:32:07+00:00</updated>
<author>
<name>Ricardo B. Marlière</name>
<email>rbm@suse.com</email>
</author>
<published>2026-03-07T22:07:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a2de57a3c8192dcd67cccaff6c341b93748d799b'/>
<id>urn:sha1:a2de57a3c8192dcd67cccaff6c341b93748d799b</id>
<content type='text'>
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 &lt;warthog9@eaglescrag.net&gt;
Cc: Andrea Righi &lt;arighi@nvidia.com&gt;
Cc: Marcos Paulo de Souza &lt;mpdesouza@suse.com&gt;
Cc: Matthieu Baerts &lt;matttbe@kernel.org&gt;
Cc: Fernando Fernandez Mancera &lt;fmancera@suse.de&gt;
Cc: Pedro Falcato &lt;pfalcato@suse.de&gt;
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 &lt;rbm@suse.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ktest: Treat undefined self-reference as empty</title>
<updated>2026-03-09T14:32:07+00:00</updated>
<author>
<name>Ricardo B. Marlière</name>
<email>rbm@suse.com</email>
</author>
<published>2026-03-07T22:07:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a2706c6c4ab5f74366740576b4d06b17392f0086'/>
<id>urn:sha1:a2706c6c4ab5f74366740576b4d06b17392f0086</id>
<content type='text'>
Config variables are expanded when they are assigned. A first-time append
such as:

  VAR := ${VAR} foo

leaves the literal ${VAR} in the stored value because VAR has not been
defined yet. Later expansions then carry the self-reference forward instead
of behaving like an empty prefix.

Drop an unescaped self-reference when the variable has no current value,
and trim the outer whitespace left behind. Keep escaped \${VAR} references
unchanged so literal text still works.

Cc: John Hawley &lt;warthog9@eaglescrag.net&gt;
Cc: Andrea Righi &lt;arighi@nvidia.com&gt;
Cc: Marcos Paulo de Souza &lt;mpdesouza@suse.com&gt;
Cc: Matthieu Baerts &lt;matttbe@kernel.org&gt;
Cc: Fernando Fernandez Mancera &lt;fmancera@suse.de&gt;
Cc: Pedro Falcato &lt;pfalcato@suse.de&gt;
Link: https://patch.msgid.link/20260307-ktest-fixes-v1-3-565d412f4925@suse.com
Signed-off-by: Ricardo B. Marlière &lt;rbm@suse.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ktest: Resolve LOG_FILE in test option context</title>
<updated>2026-03-09T14:32:07+00:00</updated>
<author>
<name>Ricardo B. Marlière</name>
<email>rbm@suse.com</email>
</author>
<published>2026-03-07T22:07:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=eb30942e4ed7365116c2eb9b2a25995520744620'/>
<id>urn:sha1:eb30942e4ed7365116c2eb9b2a25995520744620</id>
<content type='text'>
LOG_FILE is expanded immediately after the config file is parsed with
eval_option(..., -1). That uses the default context, not the same option
resolution path used for tests. If LOG_FILE depends on options that are
finalized per test, it can be resolved from stale values before the first
test starts.

Resolve LOG_FILE through set_test_option("LOG_FILE", 1) instead so it uses
the same expansion rules as the rest of the test options.

Cc: John Hawley &lt;warthog9@eaglescrag.net&gt;
Cc: Andrea Righi &lt;arighi@nvidia.com&gt;
Cc: Marcos Paulo de Souza &lt;mpdesouza@suse.com&gt;
Cc: Matthieu Baerts &lt;matttbe@kernel.org&gt;
Cc: Fernando Fernandez Mancera &lt;fmancera@suse.de&gt;
Cc: Pedro Falcato &lt;pfalcato@suse.de&gt;
Link: https://patch.msgid.link/20260307-ktest-fixes-v1-2-565d412f4925@suse.com
Signed-off-by: Ricardo B. Marlière &lt;rbm@suse.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ktest: Avoid undef warning when WARNINGS_FILE is unset</title>
<updated>2026-03-09T14:32:06+00:00</updated>
<author>
<name>Ricardo B. Marlière</name>
<email>rbm@suse.com</email>
</author>
<published>2026-03-07T22:07:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=057854f8a595160656fe77ed7bf0d2403724b915'/>
<id>urn:sha1:057854f8a595160656fe77ed7bf0d2403724b915</id>
<content type='text'>
check_buildlog() probes $warnings_file with -f even when WARNINGS_FILE is
not configured. Perl warns about the uninitialized value and adds noise to
the test log, which can hide the output we actually care about.

Check that WARNINGS_FILE is defined before testing whether the file exists.

Cc: John Hawley &lt;warthog9@eaglescrag.net&gt;
Cc: Andrea Righi &lt;arighi@nvidia.com&gt;
Cc: Marcos Paulo de Souza &lt;mpdesouza@suse.com&gt;
Cc: Matthieu Baerts &lt;matttbe@kernel.org&gt;
Cc: Fernando Fernandez Mancera &lt;fmancera@suse.de&gt;
Cc: Pedro Falcato &lt;pfalcato@suse.de&gt;
Link: https://patch.msgid.link/20260307-ktest-fixes-v1-1-565d412f4925@suse.com
Fixes: 4283b169abfb ("ktest: Add make_warnings_file and process full warnings")
Signed-off-by: Ricardo B. Marlière &lt;rbm@suse.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
</feed>
