linux/tools/testing/kunit
Mohammad Abu-Khader dea754ded9 kunit: tool: fix _list_tests filtering wrong variable when list has TAP prefix
`_list_tests()` runs the kernel to list tests, strips printk timestamp
lines via `extract_tap_lines()`, then drops the dummy TAP header from
the cleaned `lines`.  However the subsequent regex filter mistakenly
operates on the original `output` instead of the cleaned `lines`.  When
the kernel output includes timestamp prefixes (common with UML or slower
setups), e.g.:

  [    0.100000] suite.test1
  [    0.100000] suite.test2

the anchored regex `^[^\s.]+\.[^\s.]+$` rejects them and `--list_tests`
returns an empty list.

Filter `lines` instead of `output`, matching the behavior of the
adjacent `_list_tests_attr()` which already returns the cleaned list.

Add a regression test with timestamp-prefixed input to verify the fix.

Link: https://lore.kernel.org/r/20260803190059.36491-1-mohammad.abukhader@hotmail.com
Fixes: 723c8258c8 ("kunit: tool: Add command line interface to filter and report attributes")
Signed-off-by: Mohammad Abu-Khader <mohammad.abukhader@hotmail.com>
Reviewed-by: David Gow <david@davidgow.net>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2026-08-12 10:42:53 -06:00
..
configs kunit: configs: enable GPIO kunit test cases in all_tests.config 2026-07-14 08:40:48 -06:00
qemu_configs kunit: qemu_configs: Add or1k / openrisc configuration 2026-05-04 13:12:55 -06: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_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_junit.py kunit: tool: Add (primitive) support for outputting JUnit XML 2026-06-07 19:50:16 -06:00
kunit_kernel.py kunit: Fix spelling mistakes in comments and messages 2026-05-04 13:12:55 -06:00
kunit_parser.py kunit:tool: Don't write to stdout when it should be disabled 2026-06-07 20:10:30 -06:00
kunit_printer.py kunit: tool: Only print the summary 2024-11-19 14:52:17 -07:00
kunit_tool_test.py kunit: tool: fix _list_tests filtering wrong variable when list has TAP prefix 2026-08-12 10:42:53 -06:00
kunit-completion.sh kunit: add bash completion 2026-01-20 11:17:52 -07:00
kunit.py kunit: tool: fix _list_tests filtering wrong variable when list has TAP prefix 2026-08-12 10:42:53 -06: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