linux/tools/testing/kunit
Shuvam Pandey 40804c4974 kunit: tool: copy caller args in run_kernel to prevent mutation
run_kernel() appended KUnit flags directly to the caller-provided args
list. When exec_tests() calls run_kernel() repeatedly (e.g. with
--run_isolated), each call mutated the same list, causing later runs
to inherit stale filter_glob values and duplicate kunit.enable flags.

Fix this by copying args at the start of run_kernel(). Add a regression
test that calls run_kernel() twice with the same list and verifies the
original remains unchanged.

Fixes: ff9e09a376 ("kunit: tool: support running each suite/test separately")
Signed-off-by: Shuvam Pandey <shuvampandey1@gmail.com>
Reviewed-by: David Gow <david@davidgow.net>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2026-03-02 10:02:06 -07:00
..
configs kunit: Enable PCI on UML without triggering WARN() 2025-09-15 10:29:59 -06:00
qemu_configs kunit: qemu_configs: Add 32-bit big endian ARM configuration 2026-01-05 15:40:32 -07:00
test_data kunit: tool: Don't overwrite test status based on subtest counts 2026-01-05 15:36:08 -07:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
kunit-completion.sh kunit: add bash completion 2026-01-20 11:17:52 -07:00
kunit.py kunit: add bash completion 2026-01-20 11:17:52 -07:00
kunit_config.py kunit: tool: fix pre-existing mypy --strict errors and update run_checks.py 2023-03-17 12:28:30 -06:00
kunit_json.py kunit: tool: add test counts to JSON output 2025-05-19 13:22:28 -06:00
kunit_kernel.py kunit: tool: copy caller args in run_kernel to prevent mutation 2026-03-02 10:02:06 -07:00
kunit_parser.py kunit: tool: Don't overwrite test status based on subtest counts 2026-01-05 15:36:08 -07:00
kunit_printer.py kunit: tool: Only print the summary 2024-11-19 14:52:17 -07:00
kunit_tool_test.py kunit: tool: copy caller args in run_kernel to prevent mutation 2026-03-02 10:02:06 -07:00
mypy.ini kunit: tool: undo type subscripts for subprocess.Popen 2023-05-08 08:39:41 -06:00
qemu_config.py kunit: tool: Add support for overriding the QEMU serial port 2023-04-05 12:51:06 -06:00
run_checks.py kunit: tool: undo type subscripts for subprocess.Popen 2023-05-08 08:39:41 -06:00