[U-Boot] [PATCH V2 2/7] test/py: test that sandbox exits when asked

Stephen Warren swarren at wwwdotorg.org
Wed Dec 2 23:18:23 CET 2015


Test the sandbox port's implementation of the reset command and SIGHUP
handling. These should both cause the U-Boot process to exit gracefully.

Signed-off-by: Stephen Warren <swarren at wwwdotorg.org>
Signed-off-by: Stephen Warren <swarren at nvidia.com>
---
 test/py/test_sandbox_exit.py | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 test/py/test_sandbox_exit.py

diff --git a/test/py/test_sandbox_exit.py b/test/py/test_sandbox_exit.py
new file mode 100644
index 000000000000..7359a73715cd
--- /dev/null
+++ b/test/py/test_sandbox_exit.py
@@ -0,0 +1,20 @@
+# Copyright (c) 2015 Stephen Warren
+# Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved.
+#
+# SPDX-License-Identifier: GPL-2.0
+
+import pytest
+import signal
+
+ at pytest.mark.boardspec("sandbox")
+ at pytest.mark.buildconfigspec("reset")
+def test_reset(uboot_console):
+    uboot_console.run_command("reset", wait_for_prompt=False)
+    assert(uboot_console.validate_exited())
+    uboot_console.ensure_spawned()
+
+ at pytest.mark.boardspec("sandbox")
+def test_ctrlc(uboot_console):
+    uboot_console.kill(signal.SIGINT)
+    assert(uboot_console.validate_exited())
+    uboot_console.ensure_spawned()
-- 
2.6.3



More information about the U-Boot mailing list