aboutsummaryrefslogtreecommitdiff
path: root/test/py
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-04-20 14:33:53 -0400
committerTom Rini <trini@konsulko.com>2022-04-20 14:33:53 -0400
commite2743c2aa0390f9590c13197cfee288a11b88dc0 (patch)
tree127dc4d0079353e6f5cb7df708bfc5bc5f348bb5 /test/py
parent246e03476ba325051600017b552460d7f37c3191 (diff)
parentdd2b8c1155d016800cbbaa1bd70efdd81f9da493 (diff)
Merge branch '2022-04-20-assorted-improvements'
- Two TI K3 updates, update SYS_MALLOC_F_LEN default to be 0x2000 and move TI am33xx to use that as well, fix DT relocation with multiple DRAM banks, and add a gpio read sub-command.
Diffstat (limited to 'test/py')
-rw-r--r--test/py/tests/test_gpio.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/py/tests/test_gpio.py b/test/py/tests/test_gpio.py
index 109649e2c7..fa0af5f82b 100644
--- a/test/py/tests/test_gpio.py
+++ b/test/py/tests/test_gpio.py
@@ -46,6 +46,20 @@ def test_gpio_exit_statuses(u_boot_console):
response = u_boot_console.run_command('gpio input 200; echo rc:$?')
assert(expected_response in response)
+@pytest.mark.boardspec('sandbox')
+@pytest.mark.buildconfigspec('cmd_gpio')
+def test_gpio_read(u_boot_console):
+ """Test that gpio read correctly sets the variable to the value of a gpio pin."""
+
+ 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)
+ response = u_boot_console.run_command('gpio toggle 0; gpio read var 0; echo val:$var,rc:$?')
+ expected_response = 'val:1,rc:0'
+ assert(expected_response in response)
+ response = u_boot_console.run_command('setenv var; gpio read var nonexistent-gpio; echo val:$var,rc:$?')
+ expected_response = 'val:,rc:1'
+ assert(expected_response in response)
"""
Generic Tests for 'gpio' command on sandbox and real hardware.