blob: 2d242ae0f6f895aa4d61202b5b0f8aee118e257d [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001# SPDX-License-Identifier: GPL-2.0
Stephen Warrenf8826ef2016-01-15 11:15:25 -07002# Copyright (c) 2015 Stephen Warren
3# Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
Stephen Warrenf8826ef2016-01-15 11:15:25 -07004
5import pytest
6import signal
7
8@pytest.mark.boardspec('sandbox')
Heinrich Schuchardt5cf0f3b2020-10-27 20:29:23 +01009@pytest.mark.buildconfigspec('sysreset_cmd_poweroff')
10def test_poweroff(u_boot_console):
11 """Test that the "poweroff" command exits sandbox process."""
Stephen Warrenf8826ef2016-01-15 11:15:25 -070012
Heinrich Schuchardt5cf0f3b2020-10-27 20:29:23 +010013 u_boot_console.run_command('poweroff', wait_for_prompt=False)
Stephen Warrenf8826ef2016-01-15 11:15:25 -070014 assert(u_boot_console.validate_exited())
Stephen Warrenf8826ef2016-01-15 11:15:25 -070015
16@pytest.mark.boardspec('sandbox')
17def test_ctrl_c(u_boot_console):
Stephen Warren75e731e2016-01-26 13:41:30 -070018 """Test that sending SIGINT to sandbox causes it to exit."""
Stephen Warrenf8826ef2016-01-15 11:15:25 -070019
20 u_boot_console.kill(signal.SIGINT)
21 assert(u_boot_console.validate_exited())