From patchwork Wed Dec 2 22:18:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Warren X-Patchwork-Id: 551803 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id D5CAF1402C4 for ; Thu, 3 Dec 2015 09:18:54 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CC7874B701; Wed, 2 Dec 2015 23:18:50 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cfsqPCHWr25U; Wed, 2 Dec 2015 23:18:50 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 352D04B69D; Wed, 2 Dec 2015 23:18:50 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8DF1D4B69D for ; Wed, 2 Dec 2015 23:18:47 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MvlDFvXh1sYS for ; Wed, 2 Dec 2015 23:18:47 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from avon.wwwdotorg.org (avon.wwwdotorg.org [70.85.31.133]) by theia.denx.de (Postfix) with ESMTPS id 3E3474B664 for ; Wed, 2 Dec 2015 23:18:44 +0100 (CET) Received: from severn.wwwdotorg.org (unknown [192.168.65.5]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by avon.wwwdotorg.org (Postfix) with ESMTPS id DB6D2622F; Wed, 2 Dec 2015 15:18:09 -0700 (MST) Received: from swarren-lx1.nvidia.com (localhost [127.0.0.1]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by severn.wwwdotorg.org (Postfix) with ESMTPSA id B4C48E462C; Wed, 2 Dec 2015 15:18:34 -0700 (MST) From: Stephen Warren To: Tom Rini , Simon Glass Date: Wed, 2 Dec 2015 15:18:23 -0700 Message-Id: <1449094708-14784-2-git-send-email-swarren@wwwdotorg.org> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1449094708-14784-1-git-send-email-swarren@wwwdotorg.org> References: <1449094708-14784-1-git-send-email-swarren@wwwdotorg.org> X-NVConfidentiality: public X-Virus-Scanned: clamav-milter 0.98.6 at avon.wwwdotorg.org X-Virus-Status: Clean Cc: u-boot@lists.denx.de, Stephen Warren Subject: [U-Boot] [PATCH V2 2/7] test/py: test that sandbox exits when asked X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 Signed-off-by: Stephen Warren Reviewed-by: Simon Glass Tested-by: Simon Glass --- 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 + +@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()