SPDX: Convert all of our single license tags to Linux Kernel style
[oweals/u-boot.git] / test / py / tests / test_sandbox_exit.py
1 # SPDX-License-Identifier: GPL-2.0
2 # Copyright (c) 2015 Stephen Warren
3 # Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
4
5 import pytest
6 import signal
7
8 @pytest.mark.boardspec('sandbox')
9 @pytest.mark.buildconfigspec('sysreset')
10 def test_reset(u_boot_console):
11     """Test that the "reset" command exits sandbox process."""
12
13     u_boot_console.run_command('reset', wait_for_prompt=False)
14     assert(u_boot_console.validate_exited())
15
16 @pytest.mark.boardspec('sandbox')
17 def test_ctrl_c(u_boot_console):
18     """Test that sending SIGINT to sandbox causes it to exit."""
19
20     u_boot_console.kill(signal.SIGINT)
21     assert(u_boot_console.validate_exited())