test_sandbox_exit.py 666 B

123456789101112131415161718192021
  1. # SPDX-License-Identifier: GPL-2.0
  2. # Copyright (c) 2015 Stephen Warren
  3. # Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
  4. import pytest
  5. import signal
  6. @pytest.mark.boardspec('sandbox')
  7. @pytest.mark.buildconfigspec('sysreset')
  8. def test_reset(u_boot_console):
  9. """Test that the "reset" command exits sandbox process."""
  10. u_boot_console.run_command('reset', wait_for_prompt=False)
  11. assert(u_boot_console.validate_exited())
  12. @pytest.mark.boardspec('sandbox')
  13. def test_ctrl_c(u_boot_console):
  14. """Test that sending SIGINT to sandbox causes it to exit."""
  15. u_boot_console.kill(signal.SIGINT)
  16. assert(u_boot_console.validate_exited())