mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-10-06 11:30:47 +09:00
a6c6f0f0c8
Adds tests for the button commands. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
20 lines
692 B
Python
20 lines
692 B
Python
# 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)
|