tests: add enable_debounce_then_edge_detection
authorKent Gibson <warthog618@gmail.com>
Mon, 13 May 2024 16:00:31 +0000 (00:00 +0800)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 15 May 2024 08:59:52 +0000 (10:59 +0200)
commit0a552e7908896b7b96fd502052fa7289af9f6e7b
tree600b65b6a3f983afc7227845cbe7603ed447ca09
parent4caa127fe5f132d88a2f80b5c9790753876659e3
tests: add enable_debounce_then_edge_detection

A bug was recently discovered in the kernel that can result in the edge
event fifo not being correctly initialised and stack contents being
returned in edge events. The trigger for the bug is requesting a line with
debounce, but not edge detection, and then reconfiguring the line to
enable edge detection.

Add a test case that triggers the bug.  This will fail on kernels that
do not contain the fix for the bug.  The test is located in a new test
file, tests-kernel-uapi.c, intended to contain tests specifically
testing some aspect of the kernel uAPI, not libgpiod itself.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
Link: https://lore.kernel.org/r/20240513160031.309139-1-warthog618@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
tests/Makefile.am
tests/tests-kernel-uapi.c [new file with mode: 0644]