testing-devices.rst 1.6 KB

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