From: Bartosz Golaszewski Date: Wed, 7 Aug 2019 07:46:41 +0000 (+0200) Subject: tools: tests: fix the gpiomon test case with --active-low switch X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=47c6c4b1ab73ca6ffea8880e72360275033b90aa;p=qemu-gpiodev%2Flibgpiod.git tools: tests: fix the gpiomon test case with --active-low switch 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 --- diff --git a/tools/gpio-tools-test b/tools/gpio-tools-test index f12f9ec..6b93655 100755 --- a/tools/gpio-tools-test +++ b/tools/gpio-tools-test @@ -7,7 +7,7 @@ # Copyright (C) 2019 Bartosz Golaszewski # -MIN_KERNEL_VERSION="5.1.0" +MIN_KERNEL_VERSION="5.2.7" BATS_SCRIPT="gpio-tools-test.bats" SOURCE_DIR="$(dirname ${BASH_SOURCE[0]})" diff --git a/tools/gpio-tools-test.bats b/tools/gpio-tools-test.bats index f36d4d4..9e5f2a8 100644 --- a/tools/gpio-tools-test.bats +++ b/tools/gpio-tools-test.bats @@ -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