aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSimon Glass2022-08-06 17:51:54 -0600
committerTom Rini2022-09-12 18:06:36 -0400
commitb681669aa533346b648995ae8c4bd9d257ea920a (patch)
tree4adbfb5ea384041bf9fffea143a8327d3ff92428 /test
parentd401187fecc16d68e816832d0cace53e872c6afe (diff)
test: Make test_gpio_read() independent
This assumes that the GPIO starts as 0 but it does not if test_gpio_input() ran first and test_gpio_exit_statuses() was skipped. This can happen when running tests in parallel. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test')
-rw-r--r--test/py/tests/test_gpio.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/py/tests/test_gpio.py b/test/py/tests/test_gpio.py
index fa0af5f82b2..0af186f2360 100644
--- a/test/py/tests/test_gpio.py
+++ b/test/py/tests/test_gpio.py
@@ -51,6 +51,7 @@ def test_gpio_exit_statuses(u_boot_console):
def test_gpio_read(u_boot_console):
"""Test that gpio read correctly sets the variable to the value of a gpio pin."""
+ u_boot_console.run_command('gpio clear 0')
response = u_boot_console.run_command('gpio read var 0; echo val:$var,rc:$?')
expected_response = 'val:0,rc:0'
assert(expected_response in response)