xref: /openbmc/u-boot/test/py/tests/test_sandbox_exit.py (revision ca831f4933dc68d9ed1b6399cbda90068c520005)
1# Copyright (c) 2015 Stephen Warren
2# Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
3#
4# SPDX-License-Identifier: GPL-2.0
5
6import pytest
7import signal
8
9@pytest.mark.boardspec('sandbox')
10@pytest.mark.buildconfigspec('reset')
11def test_reset(u_boot_console):
12    '''Test that the "reset" command exits sandbox process.'''
13
14    u_boot_console.run_command('reset', wait_for_prompt=False)
15    assert(u_boot_console.validate_exited())
16    u_boot_console.ensure_spawned()
17
18@pytest.mark.boardspec('sandbox')
19def test_ctrl_c(u_boot_console):
20    '''Test that sending SIGINT to sandbox causes it to exit.'''
21
22    u_boot_console.kill(signal.SIGINT)
23    assert(u_boot_console.validate_exited())
24    u_boot_console.ensure_spawned()
25