Stephen Warren | f8826ef | 2016-01-15 11:15:25 -0700 | [diff] [blame] | 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 | |
| 6 | import pytest |
| 7 | import signal |
| 8 | |
| 9 | @pytest.mark.boardspec('sandbox') |
Stephen Warren | 1686c9c | 2016-07-06 09:04:08 -0600 | [diff] [blame] | 10 | @pytest.mark.buildconfigspec('sysreset') |
Stephen Warren | f8826ef | 2016-01-15 11:15:25 -0700 | [diff] [blame] | 11 | def test_reset(u_boot_console): |
Stephen Warren | 75e731e | 2016-01-26 13:41:30 -0700 | [diff] [blame] | 12 | """Test that the "reset" command exits sandbox process.""" |
Stephen Warren | f8826ef | 2016-01-15 11:15:25 -0700 | [diff] [blame] | 13 | |
| 14 | u_boot_console.run_command('reset', wait_for_prompt=False) |
| 15 | assert(u_boot_console.validate_exited()) |
Stephen Warren | f8826ef | 2016-01-15 11:15:25 -0700 | [diff] [blame] | 16 | |
| 17 | @pytest.mark.boardspec('sandbox') |
| 18 | def test_ctrl_c(u_boot_console): |
Stephen Warren | 75e731e | 2016-01-26 13:41:30 -0700 | [diff] [blame] | 19 | """Test that sending SIGINT to sandbox causes it to exit.""" |
Stephen Warren | f8826ef | 2016-01-15 11:15:25 -0700 | [diff] [blame] | 20 | |
| 21 | u_boot_console.kill(signal.SIGINT) |
| 22 | assert(u_boot_console.validate_exited()) |