tools: tests: fix the gpiomon test case with --active-low switch
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Wed, 7 Aug 2019 07:46:41 +0000 (09:46 +0200)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Wed, 7 Aug 2019 08:00:58 +0000 (10:00 +0200)
Kernel commit 223ecaf140b1 ("gpiolib: fix incorrect IRQ requesting of
an active-low lineevent") fixed an issue with line events not being
inverted with the GPIOHANDLE_REQUEST_ACTIVE_LOW flag. This change has
now been released in linux v5.2.7 and the relevant test case for
gpiomon needs to be adjusted.

Since the line going down will now be interpreted as a rising edge
event, set the pull to 1 before running gpiomon and then set it to 0
after starting it to trigger a rising edge event.

The minimum kernel version to run tests must be set to v5.2.7.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
tools/gpio-tools-test
tools/gpio-tools-test.bats

index f12f9eced366d6c6c3c53cfcf16071ff8b28ee05..6b9365525cba18d86d79e078e900ff2d4abb51a0 100755 (executable)
@@ -7,7 +7,7 @@
 # Copyright (C) 2019 Bartosz Golaszewski <bgolaszewski@baylibre.com>
 #
 
-MIN_KERNEL_VERSION="5.1.0"
+MIN_KERNEL_VERSION="5.2.7"
 BATS_SCRIPT="gpio-tools-test.bats"
 SOURCE_DIR="$(dirname ${BASH_SOURCE[0]})"
 
index f36d4d495304214b61192c5f5e4bfc8a82359dc3..9e5f2a846ca41b11dec73e4e506ada290bebb780 100644 (file)
@@ -578,9 +578,11 @@ teardown() {
 @test "gpiomon: single rising edge event (active-low)" {
        gpio_mockup_probe 8 8
 
+       gpio_mockup_set_pull 1 4 1
+
        coproc_run_tool gpiomon --rising-edge --active-low "$(gpio_mockup_chip_name 1)" 4
 
-       gpio_mockup_set_pull 1 4 1
+       gpio_mockup_set_pull 1 4 0
        sleep 0.2
 
        coproc_tool_kill