From patchwork Fri Aug 7 21:11:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1342400 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.a=rsa-sha256 header.s=badeba3b8450 header.b=jsH5AICT; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BNdN22s6Wz9sRK for ; Sat, 8 Aug 2020 07:12:00 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D6EBF82190; Fri, 7 Aug 2020 23:11:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.b="jsH5AICT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 56A2782179; Fri, 7 Aug 2020 23:11:51 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (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 CC6B182179 for ; Fri, 7 Aug 2020 23:11:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1596834707; bh=M9Kp6PT2bJj04W+8ej2zfur9x+qJYZGIWxrAlYtzoUU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=jsH5AICTEuDMVuXr7tN7EuG+tGkNC2esos95Nq+//5mBkIPUL6/bqlXyrZZ3VdhGq jGRl2e4rkfa35WU7z19PNcF9aNUc84r5IxwdYiaGRzCUMeGvBAGUxO+J88D+O5eODe bREwzRS5rtH/vA451fH1f73Uw6NAlLNdXSRiaKTI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from LT02.fritz.box ([178.202.41.107]) by mail.gmx.com (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1Mel3n-1kbqJK07Yj-00aiEA; Fri, 07 Aug 2020 23:11:47 +0200 From: Heinrich Schuchardt To: Alexander Graf Cc: Tom Rini , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH 1/1] test/py: serial# cannot be overwritten on some devices Date: Fri, 7 Aug 2020 23:11:35 +0200 Message-Id: <20200807211135.131908-1-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:QkpF4/BMDOjwtqeq9n7MFKHUqbd0A2D1kOen4OccmG/ri9VbSWK KDOrlqK+D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OYtfuE6YITnBjM6eO9EP+l+7OmDaVM9add1S7 K9MSo8BS3tSpIvjDfVzcWeLMsviXb6Ny2YgOeXZHvfITRPWSkdnac3Fuf0m7KceqBCqWv8rm6 xSutaRCouPEFHijSVhz5CIO15+tFta8Fwqg3NZi0zcSCW4LqG9ouINcc+ppkq4cVdxyvj0HR7 aoi9hU0mJ6M3ZiFd7ksaW3y/ChNcAWNuFIURmqp+waZ/wS0fzQO6Jsi+Sp8wxZDjedd5EJ3/7 QNioLDWassy43gaO0h5h1s8EzAnwYy4RdxUyodcbTPRn76JFYBQr1vBk1nlxwjOdQTa7YgdqD zu2FtQSOqevs54gdLZBYd4Vrpwa8yc2eal+GLc58rsi10PfuktRZublZEayaEOrHEhAowWxLd owWzJNmIzPRfjJ2K+GAJHYhFeiZdrAZMpGdzcWg== X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean On some devices the environment variable serial# cannot be overwritten. Set the variable only if it is not set. For our unit test it is sufficient to test if any value for serial-number is set. Fixes: 8a5cdf601f8d ("test: efi_selftest: Do not force serial# setting") Signed-off-by: Heinrich Schuchardt --- test/py/tests/test_efi_selftest.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/test/py/tests/test_efi_selftest.py b/test/py/tests/test_efi_selftest.py index 9b520c2070..63218efbc2 100644 --- a/test/py/tests/test_efi_selftest.py +++ b/test/py/tests/test_efi_selftest.py @@ -23,6 +23,7 @@ def test_efi_selftest(u_boot_console): u_boot_console.restart_uboot() @pytest.mark.buildconfigspec('cmd_bootefi_selftest') +@pytest.mark.buildconfigspec('hush_parser') @pytest.mark.buildconfigspec('of_control') @pytest.mark.notbuildconfigspec('generate_acpi_table') def test_efi_selftest_device_tree(u_boot_console): @@ -36,9 +37,11 @@ def test_efi_selftest_device_tree(u_boot_console): output = u_boot_console.run_command('bootefi selftest') assert '\'device tree\'' in output u_boot_console.run_command(cmd='setenv efi_selftest device tree') - u_boot_console.run_command(cmd='setenv serial# Testing DT') + # Set serial# if it is not already set. + u_boot_console.run_command(cmd='setenv efi_test "${serial#}x"') + u_boot_console.run_command(cmd='test "${efi_test}" = x && setenv serial# 0') u_boot_console.run_command(cmd='bootefi selftest ${fdtcontroladdr}', wait_for_prompt=False) - m = u_boot_console.p.expect(['serial-number: Testing DT', 'U-Boot']) + m = u_boot_console.p.expect(['serial-number:', 'U-Boot']) if m != 0: raise Exception('serial-number missing in device tree') u_boot_console.restart_uboot()