| 1 | |
| 2 | |
| 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.
|