mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-08 06:04:34 +00:00
39916bb45f
Using different strings for the device tree node labels and the label property of buttons sharpens the button label unit test. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
19 lines
693 B
Python
19 lines
693 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 button1; 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)
|