Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

docs: dev-tools: Add documentation for the device focused kselftests

Add documentation for the kselftests focused on testing devices and
point to it from the kselftest documentation. There are multiple tests
in this category so the aim of this page is to make it clear when to run
each test.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Nícolas F. R. A. Prado and committed by
Shuah Khan
c9949b51 d70d4218

+56
+9
Documentation/dev-tools/kselftest.rst
··· 31 31 userspace may wish to use the `Test Harness`_. Tests that need to be 32 32 run in kernel space may wish to use a `Test Module`_. 33 33 34 + Documentation on the tests 35 + ========================== 36 + 37 + For documentation on the kselftests themselves, see: 38 + 39 + .. toctree:: 40 + 41 + testing-devices 42 + 34 43 Running the selftests (hotplug tests are run in limited mode) 35 44 ============================================================= 36 45
+47
Documentation/dev-tools/testing-devices.rst
··· 1 + .. SPDX-License-Identifier: GPL-2.0 2 + .. Copyright (c) 2024 Collabora Ltd 3 + 4 + ============================= 5 + Device testing with kselftest 6 + ============================= 7 + 8 + 9 + There are a few different kselftests available for testing devices generically, 10 + with some overlap in coverage and different requirements. This document aims to 11 + give an overview of each one. 12 + 13 + Note: Paths in this document are relative to the kselftest folder 14 + (``tools/testing/selftests``). 15 + 16 + Device oriented kselftests: 17 + 18 + * Devicetree (``dt``) 19 + 20 + * **Coverage**: Probe status for devices described in Devicetree 21 + * **Requirements**: None 22 + 23 + * Error logs (``devices/error_logs``) 24 + 25 + * **Coverage**: Error (or more critical) log messages presence coming from any 26 + device 27 + * **Requirements**: None 28 + 29 + * Discoverable bus (``devices/probe``) 30 + 31 + * **Coverage**: Presence and probe status of USB or PCI devices that have been 32 + described in the reference file 33 + * **Requirements**: Manually describe the devices that should be tested in a 34 + YAML reference file (see ``devices/probe/boards/google,spherion.yaml`` for 35 + an example) 36 + 37 + * Exist (``devices/exist``) 38 + 39 + * **Coverage**: Presence of all devices 40 + * **Requirements**: Generate the reference (see ``devices/exist/README.rst`` 41 + for details) on a known-good kernel 42 + 43 + Therefore, the suggestion is to enable the error log and devicetree tests on all 44 + (DT-based) platforms, since they don't have any requirements. Then to greatly 45 + improve coverage, generate the reference for each platform and enable the exist 46 + test. The discoverable bus test can be used to verify the probe status of 47 + specific USB or PCI devices, but is probably not worth it for most cases.