From patchwork Mon May 9 20:08:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1628795 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=F4gcXA+S; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Kxsgy3ccvz9sR4 for ; Tue, 10 May 2022 06:09:00 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5C62883F35; Mon, 9 May 2022 22:08:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.b="F4gcXA+S"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2E0E283F35; Mon, 9 May 2022 22:08:47 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from smtp-relay-canonical-1.canonical.com (smtp-relay-canonical-1.canonical.com [185.125.188.121]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DCC4383E14 for ; Mon, 9 May 2022 22:08:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heinrich.schuchardt@canonical.com Received: from LT2ubnt.fritz.box (ip-062-143-094-109.um16.pools.vodafone-ip.de [62.143.94.109]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id BFD703F1C4; Mon, 9 May 2022 20:08:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1652126919; bh=Z2gUk4hALbHT8JRGvVq8KIch/gvDaEKD7Nti4QbZl8o=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=F4gcXA+S4C3u1SbR7f9yu364xTxa4ffKhMxKUQ7j7TBEx6hs2Oa8YPJxZGIoKn8y+ vpTGEGbwjGktexZcFBTgFnXRyCJdG4UcmAF4kwP8yAbBLWoDgCeHKV9d9IOML0SbTc GZXolszOTztGSU4G89plwbPqr5p3N9rmkwAIfVf5jZTkku+WlEO6cQZMTqEzUi4NTO Iv2Q8LJz17QWSgcNW/BfJc//dP0GspnZfBn8BlUzYrZQfH5UDLK9nPYd0brVlvFbl6 4oDLE1734Npfsv4dtxYzRaZF9CPXX4DP6d40KqCCx1Z+58Y1rizZzSugh7q/M0wiqd XCdv/zPIWIXdw== From: Heinrich Schuchardt To: u-boot@lists.denx.de Cc: Masahisa Kojima , Heinrich Schuchardt Subject: [PATCH 1/2] test: restore timeout after bootmenu unit test Date: Mon, 9 May 2022 22:08:31 +0200 Message-Id: <20220509200831.176107-1-heinrich.schuchardt@canonical.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean In the bootmenu unit test the console timeout is set to 500 ms. Other tests rely on the original timeout. Ensure that the original value is restored. Signed-off-by: Heinrich Schuchardt --- test/py/tests/test_bootmenu.py | 66 +++++++++++++++++----------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/test/py/tests/test_bootmenu.py b/test/py/tests/test_bootmenu.py index b4baa534aa..70f51de699 100644 --- a/test/py/tests/test_bootmenu.py +++ b/test/py/tests/test_bootmenu.py @@ -11,36 +11,36 @@ def test_bootmenu(u_boot_console): u_boot_console -- U-Boot console """ - u_boot_console.p.timeout = 500 - u_boot_console.run_command('setenv bootmenu_default 1') - u_boot_console.run_command('setenv bootmenu_0 test 1=echo ok 1') - u_boot_console.run_command('setenv bootmenu_1 test 2=echo ok 2') - u_boot_console.run_command('setenv bootmenu_2 test 3=echo ok 3') - u_boot_console.run_command('bootmenu 2', wait_for_prompt=False) - for i in ('U-Boot Boot Menu', 'test 1', 'test 2', 'test 3', 'autoboot'): - u_boot_console.p.expect([i]) - # Press enter key to execute default entry - response = u_boot_console.run_command(cmd='\x0d', wait_for_echo=False, send_nl=False) - assert 'ok 2' in response - u_boot_console.run_command('bootmenu 2', wait_for_prompt=False) - u_boot_console.p.expect(['autoboot']) - # Press up key to select prior entry followed by the enter key - response = u_boot_console.run_command(cmd='\x1b\x5b\x41\x0d', wait_for_echo=False, - send_nl=False) - assert 'ok 1' in response - u_boot_console.run_command('bootmenu 2', wait_for_prompt=False) - u_boot_console.p.expect(['autoboot']) - # Press down key to select next entry followed by the enter key - response = u_boot_console.run_command(cmd='\x1b\x5b\x42\x0d', wait_for_echo=False, - send_nl=False) - assert 'ok 3' in response - u_boot_console.run_command('bootmenu 2; echo rc:$?', wait_for_prompt=False) - u_boot_console.p.expect(['autoboot']) - # Press the escape key - response = u_boot_console.run_command(cmd='\x1b', wait_for_echo=False, send_nl=False) - assert 'ok' not in response - assert 'rc:0' in response - u_boot_console.run_command('setenv bootmenu_default') - u_boot_console.run_command('setenv bootmenu_0') - u_boot_console.run_command('setenv bootmenu_1') - u_boot_console.run_command('setenv bootmenu_2') + with u_boot_console.temporary_timeout(500): + u_boot_console.run_command('setenv bootmenu_default 1') + u_boot_console.run_command('setenv bootmenu_0 test 1=echo ok 1') + u_boot_console.run_command('setenv bootmenu_1 test 2=echo ok 2') + u_boot_console.run_command('setenv bootmenu_2 test 3=echo ok 3') + u_boot_console.run_command('bootmenu 2', wait_for_prompt=False) + for i in ('U-Boot Boot Menu', 'test 1', 'test 2', 'test 3', 'autoboot'): + u_boot_console.p.expect([i]) + # Press enter key to execute default entry + response = u_boot_console.run_command(cmd='\x0d', wait_for_echo=False, send_nl=False) + assert 'ok 2' in response + u_boot_console.run_command('bootmenu 2', wait_for_prompt=False) + u_boot_console.p.expect(['autoboot']) + # Press up key to select prior entry followed by the enter key + response = u_boot_console.run_command(cmd='\x1b\x5b\x41\x0d', wait_for_echo=False, + send_nl=False) + assert 'ok 1' in response + u_boot_console.run_command('bootmenu 2', wait_for_prompt=False) + u_boot_console.p.expect(['autoboot']) + # Press down key to select next entry followed by the enter key + response = u_boot_console.run_command(cmd='\x1b\x5b\x42\x0d', wait_for_echo=False, + send_nl=False) + assert 'ok 3' in response + u_boot_console.run_command('bootmenu 2; echo rc:$?', wait_for_prompt=False) + u_boot_console.p.expect(['autoboot']) + # Press the escape key + response = u_boot_console.run_command(cmd='\x1b', wait_for_echo=False, send_nl=False) + assert 'ok' not in response + assert 'rc:0' in response + u_boot_console.run_command('setenv bootmenu_default') + u_boot_console.run_command('setenv bootmenu_0') + u_boot_console.run_command('setenv bootmenu_1') + u_boot_console.run_command('setenv bootmenu_2') From patchwork Mon May 9 20:15:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1628796 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=d/tempZE; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Kxsqf62sMz9sR4 for ; Tue, 10 May 2022 06:15:42 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5CDF2840A2; Mon, 9 May 2022 22:15:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.b="d/tempZE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 98E5683EB7; Mon, 9 May 2022 22:15:34 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from smtp-relay-canonical-0.canonical.com (smtp-relay-canonical-0.canonical.com [185.125.188.120]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2A67D84099 for ; Mon, 9 May 2022 22:15:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heinrich.schuchardt@canonical.com Received: from LT2ubnt.fritz.box (ip-062-143-094-109.um16.pools.vodafone-ip.de [62.143.94.109]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id A2D423F9DC; Mon, 9 May 2022 20:15:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1652127331; bh=fEEdde257km4r0/Qo7YQgEatJGayNXWgvpx8w+4N8gs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=d/tempZEVA5WGlaTORiSDoY0g0g8WddY9T32Ka6veMps50w7oP6B4RQZ/qKfcrwGU yEl1Z5QCN3Y/Ijd+q32rV0NgZpbW8Znz0FsHLtT508JH5X3hYj9joUSOYINUas9MbM xyBc+EO5CCjoZfFEJIw8pwjQNEuUloF2D8/YWSlh+E4NQDY/S/zixl4+VeW3uvQz0N idIvX3QTKQQpiW9Rm2q71Fk6fnP615WAUCKAvnR2MzkWOcIjbw8WzDWXJMrBCCXgnk MFxH7Et0csTCVaSVe+kMNkEmT2vpPtb6rzG5kDhIgg9JBjVr33PFwHdd5JOfmaSQhM HgbGNd97ikwDA== From: Heinrich Schuchardt To: u-boot@lists.denx.de Cc: Heinrich Schuchardt Subject: [PATCH 2/2] test: don't change console timeout in EFI selftest. Date: Mon, 9 May 2022 22:15:29 +0200 Message-Id: <20220509201529.176904-1-heinrich.schuchardt@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220509200831.176107-1-heinrich.schuchardt@canonical.com> References: <20220509200831.176107-1-heinrich.schuchardt@canonical.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Changing the console timeout to 500 ms without restoring the original value leads to failures in other tests. As the console timeout change is not necessary for the text input protocol tests remove it. Signed-off-by: Heinrich Schuchardt --- test/py/tests/test_efi_selftest.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/py/tests/test_efi_selftest.py b/test/py/tests/test_efi_selftest.py index 5257f7a433..e92d63cde6 100644 --- a/test/py/tests/test_efi_selftest.py +++ b/test/py/tests/test_efi_selftest.py @@ -73,7 +73,6 @@ def test_efi_selftest_text_input(u_boot_console): if u_boot_console.p.expect([r'To terminate type \'x\'']): raise Exception('No prompt for \'text input\' test') u_boot_console.drain_console() - u_boot_console.p.timeout = 500 # EOT u_boot_console.run_command(cmd=chr(4), wait_for_echo=False, send_nl=False, wait_for_prompt=False) @@ -129,7 +128,6 @@ def test_efi_selftest_text_input_ex(u_boot_console): if u_boot_console.p.expect([r'To terminate type \'CTRL\+x\'']): raise Exception('No prompt for \'text input\' test') u_boot_console.drain_console() - u_boot_console.p.timeout = 500 # EOT u_boot_console.run_command(cmd=chr(4), wait_for_echo=False, send_nl=False, wait_for_prompt=False)