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>
This commit is contained in:
Nícolas F. R. A. Prado 2024-10-01 11:43:23 -04:00 committed by Shuah Khan
parent 010b07d11e
commit edd435390c
2 changed files with 56 additions and 0 deletions

View file

@ -31,6 +31,15 @@ kselftest runs as a userspace process. Tests that can be written/run in
userspace may wish to use the `Test Harness`_. Tests that need to be userspace may wish to use the `Test Harness`_. Tests that need to be
run in kernel space may wish to use a `Test Module`_. run in kernel space may wish to use a `Test Module`_.
Documentation on the tests
==========================
For documentation on the kselftests themselves, see:
.. toctree::
testing-devices
Running the selftests (hotplug tests are run in limited mode) Running the selftests (hotplug tests are run in limited mode)
============================================================= =============================================================

View file

@ -0,0 +1,47 @@
.. SPDX-License-Identifier: GPL-2.0
.. Copyright (c) 2024 Collabora Ltd
=============================
Device testing with kselftest
=============================
There are a few different kselftests available for testing devices generically,
with some overlap in coverage and different requirements. This document aims to
give an overview of each one.
Note: Paths in this document are relative to the kselftest folder
(``tools/testing/selftests``).
Device oriented kselftests:
* Devicetree (``dt``)
* **Coverage**: Probe status for devices described in Devicetree
* **Requirements**: None
* Error logs (``devices/error_logs``)
* **Coverage**: Error (or more critical) log messages presence coming from any
device
* **Requirements**: None
* Discoverable bus (``devices/probe``)
* **Coverage**: Presence and probe status of USB or PCI devices that have been
described in the reference file
* **Requirements**: Manually describe the devices that should be tested in a
YAML reference file (see ``devices/probe/boards/google,spherion.yaml`` for
an example)
* Exist (``devices/exist``)
* **Coverage**: Presence of all devices
* **Requirements**: Generate the reference (see ``devices/exist/README.rst``
for details) on a known-good kernel
Therefore, the suggestion is to enable the error log and devicetree tests on all
(DT-based) platforms, since they don't have any requirements. Then to greatly
improve coverage, generate the reference for each platform and enable the exist
test. The discoverable bus test can be used to verify the probe status of
specific USB or PCI devices, but is probably not worth it for most cases.