summaryrefslogtreecommitdiff
path: root/test/py
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2020-07-29 21:16:08 -0400
committerTom Rini <[email protected]>2020-07-29 21:16:08 -0400
commit719f42190d5f0238cb01ef2ffba8af2285f7bc7a (patch)
treec789716a82ab552e0d0c1a9242fda7c41b04c238 /test/py
parent7cb2060b4e63a89c50739dc8a9fcd5d73f86f0be (diff)
parentb9390ce51cb46f4b4acda320e7ea8e0bd120e4b8 (diff)
Merge tag 'dm-pull-28jul20' of git://git.denx.de/u-boot-dm
Use binman instead of one of the Rockchip build scripts Refactor to allow any arch to create SPI-flash images New button uclass
Diffstat (limited to 'test/py')
-rw-r--r--test/py/tests/test_button.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/py/tests/test_button.py b/test/py/tests/test_button.py
new file mode 100644
index 00000000000..98067a98f28
--- /dev/null
+++ b/test/py/tests/test_button.py
@@ -0,0 +1,19 @@
+# SPDX-License-Identifier: GPL-2.0+
+
+import pytest
+
[email protected]('cmd_button')
+def test_button_exit_statuses(u_boot_console):
+ """Test that non-input button commands correctly return the command
+ success/failure status."""
+
+ expected_response = 'rc:0'
+ response = u_boot_console.run_command('button list; echo rc:$?')
+ assert(expected_response in response)
+ response = u_boot_console.run_command('button summer; echo rc:$?')
+ assert(expected_response in response)
+
+ expected_response = 'rc:1'
+ response = u_boot_console.run_command('button nonexistent-button; echo rc:$?')
+ assert(expected_response in response)