mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
test/py: add tests for the button commands
Adds tests for the button commands. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
This commit is contained in:
parent
5f9228691c
commit
a6c6f0f0c8
2 changed files with 33 additions and 0 deletions
19
test/py/tests/test_button.py
Normal file
19
test/py/tests/test_button.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
# SPDX-License-Identifier: GPL-2.0+
|
||||
|
||||
import pytest
|
||||
|
||||
@pytest.mark.boardspec('sandbox')
|
||||
@pytest.mark.buildconfigspec('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)
|
Loading…
Add table
Add a link
Reference in a new issue