Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0 |
Stephen Warren | f8826ef | 2016-01-15 11:15:25 -0700 | [diff] [blame] | 2 | # Copyright (c) 2015 Stephen Warren |
| 3 | # Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved. |
Stephen Warren | f8826ef | 2016-01-15 11:15:25 -0700 | [diff] [blame] | 4 | |
| 5 | import pytest |
| 6 | import signal |
| 7 | |
| 8 | @pytest.mark.boardspec('sandbox') |
Stephen Warren | 1686c9c | 2016-07-06 09:04:08 -0600 | [diff] [blame] | 9 | @pytest.mark.buildconfigspec('sysreset') |
Stephen Warren | f8826ef | 2016-01-15 11:15:25 -0700 | [diff] [blame] | 10 | def test_reset(u_boot_console): |
Stephen Warren | 75e731e | 2016-01-26 13:41:30 -0700 | [diff] [blame] | 11 | """Test that the "reset" command exits sandbox process.""" |
Stephen Warren | f8826ef | 2016-01-15 11:15:25 -0700 | [diff] [blame] | 12 | |
| 13 | u_boot_console.run_command('reset', wait_for_prompt=False) |
| 14 | assert(u_boot_console.validate_exited()) |
Stephen Warren | f8826ef | 2016-01-15 11:15:25 -0700 | [diff] [blame] | 15 | |
| 16 | @pytest.mark.boardspec('sandbox') |
| 17 | def test_ctrl_c(u_boot_console): |
Stephen Warren | 75e731e | 2016-01-26 13:41:30 -0700 | [diff] [blame] | 18 | """Test that sending SIGINT to sandbox causes it to exit.""" |
Stephen Warren | f8826ef | 2016-01-15 11:15:25 -0700 | [diff] [blame] | 19 | |
| 20 | u_boot_console.kill(signal.SIGINT) |
| 21 | assert(u_boot_console.validate_exited()) |