Checking hardware with hwtest

This is a utility for checking hardware functionality on devices.

Currently  can check the following:


 * framebuffer access
 * drm/kms
 * camera image capture (uses ffmpeg and v4l-utils)
 * input devices (uses evtest)
 * Accelerometer/magnetometer/gyroscope
 * Temperature sensors
 * Light/Proximity sensors

Export and verify
Hwtest includes the  and   option. The export option generates a file with the test results, this file can later be used with the verify option to create a diff of working hardware.

This is mainly useful for testing if a kernel still works after rebasing on a newer upstream linux version.

The generated ini file:

After fixing the camera and running hwtest with the verify option:

Installation
(here, 0.6.0) is implicitly dependent on the minor version number of python, 3.x.

In case of a (seldom, but not unexpected) minor version upgrade to the python package (here, from 3.10 to 3.11), installation will succeed, but will refuse to run:

Usage: display (terminal) size
text output format is hardwired for terminal sizes typical on a desktop, e.g., 80x24. On-device terminals (e.g., gnome console) may be 44x18, and problematic. If an interactive on-device run terminates with an error such as, the formatter code is at fault, and must be modified. Since  is written in python, the edits are easily done on-device, per-device. An example patch to formatter.py is given below:

formatter-smallscreen.patch