From patchwork Tue Jan 18 04:39:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 532863 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3353012imp; Mon, 17 Jan 2022 20:42:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJw+bSHmgJ/lAKlpySx9ssBlht0bu+zj3Nv/fXAjJDQv8EzweUS1curyG9pXgrRhyuiakIjM X-Received: by 2002:a17:906:69c8:: with SMTP id g8mr4913163ejs.356.1642480940050; Mon, 17 Jan 2022 20:42:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642480940; cv=none; d=google.com; s=arc-20160816; b=e7boIVmqIcAt5a6HdeILZsmxJzQLDiMo+J6kCY65bw8+Ez8Mn72k9+ieDtlas0/wL/ xSY4Zb6/H9TVowxpMu+Pyl6Y9eJva6I+leyYLXCMrpr8DFae0dIeF9S+OSYsSFhnjNZn penlPeiFJSi0lk6CjLHc762Qffw3PG1/lPoCyrlxvHueovr2DG50T4Rjn/or1VssYwNx mrhSdiXEa4hihkoL5Vrv4R0O2IaMG7t70PTOn77xtxpaNISUpB+VFKhSeECHrW7rHYG+ Z9ddhDHOfGuJkjKxJlMClyeohMvrRe+nXNJt+sA+OWulDs2UGgLZCn1Or0I7tfztuh1H 7gUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IWerVfIYQG4PYlCT6/iZD5GfRSLOO0VoGD6nCIjvwMk=; b=cIOskSIdr8J3n/0J7MhP6/gDrcShoB1Y/j9+vf2Yfe05B1U8sLwGcn5/1iqULE61yq ZryVdEwiW9k5dLA/kiK1L2HKYVfdVh+bCjsgjqGICai4SnQYk2EbwObc5eHxEbEl+ESb +8+iP4gM/srEvcKZlNxmC67UF6NV+VaCIGWMfkX54gBSAnVqeQ3QYQnYXPMkEfWKI4/s axbtrPUmuYhy6c/DV1Hr4Wc/aaqbQ/wQUGlbZ7Ej08pTKb7LHUoIXr1gZaU/KZtiRR8F +6P+bis/LIbRqe3S6szDscCr9t2dAjj29+jb7KAu5P1gABgKgKRHQ2sEJctKFRajwRHU gViQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fiJ5fDcK; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id ga29si3123386ejc.832.2022.01.17.20.42.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jan 2022 20:42:20 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fiJ5fDcK; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F13D883826; Tue, 18 Jan 2022 05:41:17 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="fiJ5fDcK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6180C83563; Tue, 18 Jan 2022 05:40:58 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8E997831E9 for ; Tue, 18 Jan 2022 05:40:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pl1-x62c.google.com with SMTP id c3so23303410pls.5 for ; Mon, 17 Jan 2022 20:40:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IWerVfIYQG4PYlCT6/iZD5GfRSLOO0VoGD6nCIjvwMk=; b=fiJ5fDcKCZBVeHW5Uw9+zL4packFJgoDdDFrLtBhN0K5rREik2bEYxUaB5CYad1+/F Tn3sT3Ksue6Mwb238RNgfuDfskTGcGsiz4O+snis76cT9BuCTzrtoULMkBfXyTEs9M3m Yqs9LMPVGNOsbmdlMXj4l8AQbh3Hax3hz0P8T2rzESUz3YBR85HNkSeEgZ8oIDY7uwOG o/SlQOKYmESH067a5FkLCEJtvOcSPLIEAHIxjdRIsZL8tqd83ivWO6oX7LiYDpmsrlIL SYu/tt56VICoNr+0m45ILbji9uqYx2QNsnuZheqxdXMfhx2VmRNHzejKleewGKboeqIo Z4qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IWerVfIYQG4PYlCT6/iZD5GfRSLOO0VoGD6nCIjvwMk=; b=UzV0moP+7VLghynY4bUthP5sJPG4+ScXX8rCHdj5VeeKuIye6+wmJz3oYLV+oVDDrA 9SgNh/iVd2mdfhPRy1sPXZOpr/AvhhkXm9eFYH8eVFLq/bZNrV1Z4u3rnJ25jTsZ2gsm zardt1q5HqzweqCX4VKUNhnu0Yo3UmUz3FeDmS4XmNhvcMGR7SGMFAperG/cbSYt7utN vuYF/FBytRNHhnW8mxnUa3+WxSrFuIDpymvnIuLF+du3opYmYBnIktfNSdnaHXZpn6+O PztuCyU1i1oUejMkXadpEcVgOMWahGkwwk3NKo3GtKHxTz666q3gOqy/TzMILmwY90kn m7Gw== X-Gm-Message-State: AOAM532qBdtXa8+sj6k3jQYrHFAO+sCLN5K7cR9StBglXzOVuhqu7xsg V+WXz+1/EfrxPzkB2BaOZ8mnCg== X-Received: by 2002:a17:902:e0c4:b0:14a:9ad7:9a02 with SMTP id e4-20020a170902e0c400b0014a9ad79a02mr1698875pla.109.1642480850998; Mon, 17 Jan 2022 20:40:50 -0800 (PST) Received: from localhost.localdomain ([2400:4050:c3e1:100:bc1a:291e:ac91:be98]) by smtp.gmail.com with ESMTPSA id y69sm15670770pfg.171.2022.01.17.20.40.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jan 2022 20:40:50 -0800 (PST) From: AKASHI Takahiro To: xypron.glpk@gmx.de, agraf@csgraf.de, sjg@chromium.org Cc: ilias.apalodimas@linaro.org, sughosh.ganu@linaro.org, masami.hiramatsu@linaro.org, mark.kettenis@xs4all.nl, u-boot@lists.denx.de, AKASHI Takahiro Subject: [PATCH v9 11/11] test/py: efi_capsule: check the results in case of CAPSULE_AUTHENTICATE Date: Tue, 18 Jan 2022 13:39:54 +0900 Message-Id: <20220118043954.55940-12-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220118043954.55940-1-takahiro.akashi@linaro.org> References: <20220118043954.55940-1-takahiro.akashi@linaro.org> 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.2 at phobos.denx.de X-Virus-Status: Clean Before the capsule authentication is supported, this test script works correctly, but with the feature enabled, most tests will fail due to unsigned capsules. So check the results depending on CAPSULE_AUTHENTICATE or not. Signed-off-by: AKASHI Takahiro Reviewed-by: Simon Glass --- .../test_efi_capsule/test_capsule_firmware.py | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/test/py/tests/test_efi_capsule/test_capsule_firmware.py b/test/py/tests/test_efi_capsule/test_capsule_firmware.py index 9cc973560fa1..6e803f699f2f 100644 --- a/test/py/tests/test_efi_capsule/test_capsule_firmware.py +++ b/test/py/tests/test_efi_capsule/test_capsule_firmware.py @@ -148,6 +148,8 @@ class TestEfiCapsuleFirmwareFit(object): capsule_early = u_boot_config.buildconfig.get( 'config_efi_capsule_on_disk_early') + capsule_auth = u_boot_config.buildconfig.get( + 'config_efi_capsule_authenticate') with u_boot_console.log.section('Test Case 2-b, after reboot'): if not capsule_early: # make sure that dfu_alt_info exists even persistent variables @@ -171,12 +173,18 @@ class TestEfiCapsuleFirmwareFit(object): 'sf probe 0:0', 'sf read 4000000 100000 10', 'md.b 4000000 10']) - assert 'u-boot:New' in ''.join(output) + if capsule_auth: + assert 'u-boot:Old' in ''.join(output) + else: + assert 'u-boot:New' in ''.join(output) output = u_boot_console.run_command_list([ 'sf read 4000000 150000 10', 'md.b 4000000 10']) - assert 'u-boot-env:New' in ''.join(output) + if capsule_auth: + assert 'u-boot-env:Old' in ''.join(output) + else: + assert 'u-boot-env:New' in ''.join(output) def test_efi_capsule_fw3( self, u_boot_config, u_boot_console, efi_capsule_data): @@ -215,6 +223,8 @@ class TestEfiCapsuleFirmwareFit(object): capsule_early = u_boot_config.buildconfig.get( 'config_efi_capsule_on_disk_early') + capsule_auth = u_boot_config.buildconfig.get( + 'config_efi_capsule_authenticate') with u_boot_console.log.section('Test Case 3-b, after reboot'): if not capsule_early: # make sure that dfu_alt_info exists even persistent variables @@ -246,7 +256,10 @@ class TestEfiCapsuleFirmwareFit(object): 'sf probe 0:0', 'sf read 4000000 100000 10', 'md.b 4000000 10']) - assert 'u-boot:New' in ''.join(output) + if capsule_auth: + assert 'u-boot:Old' in ''.join(output) + else: + assert 'u-boot:New' in ''.join(output) def test_efi_capsule_fw4( self, u_boot_config, u_boot_console, efi_capsule_data): @@ -285,6 +298,8 @@ class TestEfiCapsuleFirmwareFit(object): capsule_early = u_boot_config.buildconfig.get( 'config_efi_capsule_on_disk_early') + capsule_auth = u_boot_config.buildconfig.get( + 'config_efi_capsule_authenticate') with u_boot_console.log.section('Test Case 4-b, after reboot'): if not capsule_early: # make sure that dfu_alt_info exists even persistent variables @@ -313,4 +328,7 @@ class TestEfiCapsuleFirmwareFit(object): 'sf probe 0:0', 'sf read 4000000 100000 10', 'md.b 4000000 10']) - assert 'u-boot:New' in ''.join(output) + if capsule_auth: + assert 'u-boot:Old' in ''.join(output) + else: + assert 'u-boot:New' in ''.join(output)