| db0c35ca | 16-Jan-2026 |
Ryota Sakamoto <sakamo.ryota@gmail.com> |
kunit: add bash completion
Currently, kunit.py has many subcommands and options, making it difficult to remember them without checking the help message.
Add --list-cmds and --list-opts to kunit.py
kunit: add bash completion
Currently, kunit.py has many subcommands and options, making it difficult to remember them without checking the help message.
Add --list-cmds and --list-opts to kunit.py to get available commands and options, use those outputs in kunit-completion.sh to show completion.
This implementation is similar to perf and tools/perf/perf-completion.sh.
Example output: $ source tools/testing/kunit/kunit-completion.sh $ ./tools/testing/kunit/kunit.py [TAB][TAB] build config exec parse run $ ./tools/testing/kunit/kunit.py run --k[TAB][TAB] --kconfig_add --kernel_args --kunitconfig
Link: https://lore.kernel.org/r/20260117-kunit-completion-v2-1-cabd127d0801@gmail.com Reviewed-by: David Gow <davidgow@google.com> Signed-off-by: Ryota Sakamoto <sakamo.ryota@gmail.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|
| f126d688 | 07-Jan-2026 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
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
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>
show more ...
|
| 1cabad3a | 07-Jan-2026 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
kunit: tool: test: Rename test_data_path() to _test_data_path()
Running the KUnit testsuite through pytest fails, as the function test_data_path() is recognized as a test function. Its execution fai
kunit: tool: test: Rename test_data_path() to _test_data_path()
Running the KUnit testsuite through pytest fails, as the function test_data_path() is recognized as a test function. Its execution fails as pytest tries to resolve the 'path' argument as a fixture which does not exist.
Rename the function, so the helper function is not incorrectly recognized as a test function.
Link: https://lore.kernel.org/r/20260107015936.2316047-1-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>
show more ...
|
| ab150c2b | 02-Jan-2026 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
kunit: qemu_configs: Add 32-bit big endian ARM configuration
Add a basic config to run kunit tests on 32-bit big endian ARM.
Link: https://lore.kernel.org/r/20260102-kunit-armeb-v1-1-e8e5475d735c@l
kunit: qemu_configs: Add 32-bit big endian ARM configuration
Add a basic config to run kunit tests on 32-bit big endian ARM.
Link: https://lore.kernel.org/r/20260102-kunit-armeb-v1-1-e8e5475d735c@linutronix.de Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Reviewed-by: David Gow <davidgow@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|
| 85aff81b | 30-Dec-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
kunit: tool: Don't overwrite test status based on subtest counts
If a subtest itself reports success, but the outer testcase fails, the whole testcase should be reported as a failure. However the st
kunit: tool: Don't overwrite test status based on subtest counts
If a subtest itself reports success, but the outer testcase fails, the whole testcase should be reported as a failure. However the status is recalculated based on the test counts, overwriting the outer test result. Synthesize a failed test in this case to make sure the failure is not swallowed.
Link: https://lore.kernel.org/r/20251230-kunit-nested-failure-v1-2-98cfbeb87823@linutronix.de Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Reviewed-by: David Gow <davidgow@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|
| 0c5b86c6 | 30-Dec-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
kunit: tool: Add test for nested test result reporting
Currently there is a lack of tests validating the result reporting from nested tests. Add one, it will also be used to validate upcoming change
kunit: tool: Add test for nested test result reporting
Currently there is a lack of tests validating the result reporting from nested tests. Add one, it will also be used to validate upcoming changes to the nested test parsing.
Link: https://lore.kernel.org/r/20251230-kunit-nested-failure-v1-1-98cfbeb87823@linutronix.de Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Reviewed-by: Rae Moar <rmoar@google.com> Reviewed-by: David Gow <davidgow@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|
| f20e2642 | 08-Sep-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
kunit: qemu_configs: Add MIPS configurations
Add basic support to run various MIPS variants via kunit_tool using the virtualized malta platform.
Link: https://lore.kernel.org/r/20250908-kunit-mips-
kunit: qemu_configs: Add MIPS configurations
Add basic support to run various MIPS variants via kunit_tool using the virtualized malta platform.
Link: https://lore.kernel.org/r/20250908-kunit-mips-v5-1-d9f0632d1854@linutronix.de Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Reviewed-by: David Gow <davidgow@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|
| 031cdd3b | 08-Sep-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
kunit: Enable PCI on UML without triggering WARN()
Various KUnit tests require PCI infrastructure to work. All normal platforms enable PCI by default, but UML does not. Enabling PCI from .kunitconfi
kunit: Enable PCI on UML without triggering WARN()
Various KUnit tests require PCI infrastructure to work. All normal platforms enable PCI by default, but UML does not. Enabling PCI from .kunitconfig files is problematic as it would not be portable. So in commit 6fc3a8636a7b ("kunit: tool: Enable virtio/PCI by default on UML") PCI was enabled by way of CONFIG_UML_PCI_OVER_VIRTIO=y. However CONFIG_UML_PCI_OVER_VIRTIO requires additional configuration of CONFIG_UML_PCI_OVER_VIRTIO_DEVICE_ID or will otherwise trigger a WARN() in virtio_pcidev_init(). However there is no one correct value for UML_PCI_OVER_VIRTIO_DEVICE_ID which could be used by default.
This warning is confusing when debugging test failures.
On the other hand, the functionality of CONFIG_UML_PCI_OVER_VIRTIO is not used at all, given that it is completely non-functional as indicated by the WARN() in question. Instead it is only used as a way to enable CONFIG_UML_PCI which itself is not directly configurable.
Instead of going through CONFIG_UML_PCI_OVER_VIRTIO, introduce a custom configuration option which enables CONFIG_UML_PCI without triggering warnings or building dead code.
Link: https://lore.kernel.org/r/20250908-kunit-uml-pci-v2-1-d8eba5f73c9d@linutronix.de Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Reviewed-by: Johannes Berg <johannes@sipsolutions.net> Reviewed-by: David Gow <davidgow@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|
| 922d1dde | 30-Jul-2025 |
David Gow <davidgow@google.com> |
kunit: tool: Accept --raw_output=full as an alias of 'all'
I can never remember whether --raw_output takes 'all' or 'full'. No reason we can't support both.
For the record, 'all' is the recommended
kunit: tool: Accept --raw_output=full as an alias of 'all'
I can never remember whether --raw_output takes 'all' or 'full'. No reason we can't support both.
For the record, 'all' is the recommended, documented option.
Link: https://lore.kernel.org/r/20250730031624.1911689-1-davidgow@google.com Signed-off-by: David Gow <davidgow@google.com> Reviewed-by: Rae Moar <rmoar@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|
| ce7ff266 | 16-May-2025 |
Rae Moar <rmoar@google.com> |
kunit: tool: add test counts to JSON output
Add the test counts to the JSON output from kunit.py. For example:
... "git_branch": "kselftest", "misc": { "tests": 2, "passed": 1. "failed"
kunit: tool: add test counts to JSON output
Add the test counts to the JSON output from kunit.py. For example:
... "git_branch": "kselftest", "misc": { "tests": 2, "passed": 1. "failed": 1, "crashed": 0, "skipped": 0, "errors": 0, } ...
To output the JSON using the following command: ./tools/testing/kunit/kunit.py run example --json
This has been requested by KUnit users. The counts are in a "misc" field because the JSON output needs to be compliant with the KCIDB submission guide. There are no counts fields but there is a "misc" field in the guide.
Link: https://lore.kernel.org/r/20250516201615.1237037-1-rmoar@google.com Signed-off-by: Rae Moar <rmoar@google.com> Reviewed-by: David Gow <davidgow@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|
| 1d31d536 | 16-Apr-2025 |
David Gow <davidgow@google.com> |
kunit: qemu_configs: Disable faulting tests on 32-bit SPARC
The 32-bit sparc configuration (--arch sparc) crashes on the kunit_fault_test. It's known that some architectures don't handle deliberate
kunit: qemu_configs: Disable faulting tests on 32-bit SPARC
The 32-bit sparc configuration (--arch sparc) crashes on the kunit_fault_test. It's known that some architectures don't handle deliberate segfaults in kernel mode well, so there's a config switch to disable tests which rely upon it by default.
Use this for the sparc config, making sure the default config for it passes.
Link: https://lore.kernel.org/r/20250416093826.1550040-1-davidgow@google.com Fixes: 87c9c1631788 ("kunit: tool: add support for QEMU") Signed-off-by: David Gow <davidgow@google.com> Reviewed-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Tested-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|
| 8fe34da6 | 15-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
kunit: qemu_configs: Add 64-bit SPARC configuration
Add a basic config to run kunit tests on 64-bit SPARC.
Link: https://lore.kernel.org/r/20250415-kunit-qemu-sparc64-v1-2-253906f61102@linutronix.d
kunit: qemu_configs: Add 64-bit SPARC configuration
Add a basic config to run kunit tests on 64-bit SPARC.
Link: https://lore.kernel.org/r/20250415-kunit-qemu-sparc64-v1-2-253906f61102@linutronix.de Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Reviewed-by: David Gow <davidgow@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|
| d16b3d0f | 15-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
kunit: qemu_configs: sparc: Explicitly enable CONFIG_SPARC32=y
The configuration generated by kunit ends up with a 32bit configuration. A new kunit configuration for 64bit is to be added. To make th
kunit: qemu_configs: sparc: Explicitly enable CONFIG_SPARC32=y
The configuration generated by kunit ends up with a 32bit configuration. A new kunit configuration for 64bit is to be added. To make the difference clearer spell out the variant in the kunit reference config.
Link: https://lore.kernel.org/r/20250415-kunit-qemu-sparc64-v1-1-253906f61102@linutronix.de Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Reviewed-by: David Gow <davidgow@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|
| 9a99129f | 15-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
kunit: qemu_configs: Add PowerPC 32-bit BE and 64-bit LE
Add basic configs to run kunit tests on some more PowerPC variants.
Link: https://lore.kernel.org/r/20250415-kunit-ppc-v1-2-f5a170264147@lin
kunit: qemu_configs: Add PowerPC 32-bit BE and 64-bit LE
Add basic configs to run kunit tests on some more PowerPC variants.
Link: https://lore.kernel.org/r/20250415-kunit-ppc-v1-2-f5a170264147@linutronix.de Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Reviewed-by: David Gow <davidgow@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|
| 09ea90e5 | 15-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
kunit: qemu_configs: powerpc: Explicitly enable CONFIG_CPU_BIG_ENDIAN=y
The configuration generated by kunit ends up with big endian. A new kunit configuration for little endian is to be added. To m
kunit: qemu_configs: powerpc: Explicitly enable CONFIG_CPU_BIG_ENDIAN=y
The configuration generated by kunit ends up with big endian. A new kunit configuration for little endian is to be added. To make the difference clearer spell out the endianness in the kunit reference config.
Link: https://lore.kernel.org/r/20250415-kunit-ppc-v1-1-f5a170264147@linutronix.de Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Reviewed-by: David Gow <davidgow@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|
| 6cf6b0a6 | 15-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
kunit: tool: Implement listing of available architectures
To implement custom scripting around kunit.py it is useful to get a list of available architectures. While it is possible to manually inspec
kunit: tool: Implement listing of available architectures
To implement custom scripting around kunit.py it is useful to get a list of available architectures. While it is possible to manually inspect tools/testing/kunit/qemu_configs/, this is annoying to implement and introduces a dependency on a kunit.py implementation detail.
Introduce 'kunit.py run --arch help' which lists all known architectures in an easy to parse list. This is equivalent on how QEMU implements listing of possible argument values.
Link: https://lore.kernel.org/r/20250415-kunit-list-v2-1-aa452cd317ae@linutronix.de Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Reviewed-by: Rae Moar <rmoar@google.com> Reviewed-by: David Gow <davidgow@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|
| 9aa08e76 | 07-Apr-2025 |
Thomas Weißschuh <thomas.weissschuh@linutronix.de> |
kunit: qemu_configs: Add riscv32 config
Add a basic config to run kunit tests on riscv32.
Link: https://lore.kernel.org/r/20250407-kunit-qemu-riscv32-v1-1-7b9800034a35@linutronix.de Signed-off-by:
kunit: qemu_configs: Add riscv32 config
Add a basic config to run kunit tests on riscv32.
Link: https://lore.kernel.org/r/20250407-kunit-qemu-riscv32-v1-1-7b9800034a35@linutronix.de Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Reviewed-by: David Gow <davidgow@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|