]> git.ipfire.org Git - thirdparty/linux.git/commit
kunit: tool: test: Don't rely on implicit working directory change
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>
Wed, 7 Jan 2026 01:59:34 +0000 (09:59 +0800)
committerShuah Khan <skhan@linuxfoundation.org>
Wed, 7 Jan 2026 17:00:47 +0000 (10:00 -0700)
commitf126d688193b4dd6d0044c19771469724c03f8f8
tree608db2bbe105767745477db2a7d9c63c7d607fa3
parent1cabad3a00ab2e3d6bf19c5ab8fc9212d0b81e18
kunit: tool: test: Don't rely on implicit working directory change

If no kunitconfig_paths are passed to LinuxSourceTree() it falls back to
DEFAULT_KUNITCONFIG_PATH. This resolution only works when the current
working directory is the root of the source tree. This works by chance
when running the full testsuite through the default unittest runner, as
some tests will change the current working directory as a side-effect of
'kunit.main()'. When running a single testcase or using pytest, which
resets the working directory for each test, this assumption breaks.

Explicitly specify an empty kunitconfig for the affected tests.

Link: https://lore.kernel.org/r/20260107015936.2316047-2-davidgow@google.com
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/kunit/kunit_tool_test.py