1 # SPDX-License-Identifier: GPL-2.0+
5 @pytest.mark.boardspec('sandbox')
6 @pytest.mark.buildconfigspec('cmd_button')
7 def test_button_exit_statuses(u_boot_console):
8 """Test that non-input button commands correctly return the command
9 success/failure status."""
11 expected_response = 'rc:0'
12 response = u_boot_console.run_command('button list; echo rc:$?')
13 assert(expected_response in response)
14 response = u_boot_console.run_command('button button1; echo rc:$?')
15 assert(expected_response in response)
17 expected_response = 'rc:1'
18 response = u_boot_console.run_command('button nonexistent-button; echo rc:$?')
19 assert(expected_response in response)