diff mbox

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

Message ID 1449094708-14784-2-git-send-email-swarren@wwwdotorg.org
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Stephen Warren Dec. 2, 2015, 10:18 p.m. UTC
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@wwwdotorg.org>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 test/py/test_sandbox_exit.py | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 test/py/test_sandbox_exit.py

Comments

Simon Glass Dec. 19, 2015, 10:24 p.m. UTC | #1
On 2 December 2015 at 15:18, Stephen Warren <swarren@wwwdotorg.org> wrote:
> 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@wwwdotorg.org>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
>  test/py/test_sandbox_exit.py | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>  create mode 100644 test/py/test_sandbox_exit.py

Reviewed-by: Simon Glass <sjg@chromium.org>
Tested on chromebook_link, sandbox
Tested-by: Simon Glass <sjg@chromium.org>
diff mbox

Patch

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
+
+@pytest.mark.boardspec("sandbox")
+@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()
+
+@pytest.mark.boardspec("sandbox")
+def test_ctrlc(uboot_console):
+    uboot_console.kill(signal.SIGINT)
+    assert(uboot_console.validate_exited())
+    uboot_console.ensure_spawned()