From patchwork Tue Feb 1 01:27:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 538938 Delivered-To: patch@linaro.org Received: by 2002:ac0:f7d2:0:0:0:0:0 with SMTP id i18csp466040imr; Mon, 31 Jan 2022 17:33:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJwtl/rXB2ucS00TXnxJUsPZhP9R2CYBHYzhp5sgUk7BZ0Dh5b0t7G7IFdnWHOcLg5VV100w X-Received: by 2002:a17:906:d54e:: with SMTP id cr14mr19680400ejc.692.1643679201254; Mon, 31 Jan 2022 17:33:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643679201; cv=none; d=google.com; s=arc-20160816; b=tuV1odz+sdoY+LbB0B561h5mt+Yao/pRFhRBMEiue1Zn7qlGi3q/i76uEUYHkRzWWZ qAnTwdGnEF1+AbrVfqa2vpSFxkAHRHe2Lxu05hX+hdqs+diGdWGn/Cfoklb/Z+SlC2qS kFC6BjUL88YPXTnEkYF2MraGWX6HhSpOK79QYmpYnPxzY4y1WcudAfWt2mw4Dwv2J3Ax INV+LA+AAhXYl2yXryBGT4FLFFPef7OKpanSRXOpadCdX0q9KUjcXIYPeub0LFo8XQlC Gj3npxpkbLlnAiu/lPSalEai490A3P83TAXNys0bJo1p5oRlgUGxW3SjAWoHk4higg9A UbJA== 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=PK5rDXC//Ww/kTNFg+jXG3Nd/6Vwy6Xjiahbb1Squ3cvnPRVPZKf1ZRcZ/FBavqA/2 GsKE+poSaWW4PAMokaqE3JesK10uSxcVTj0is29hrZJy5D0kCHcWQfCpGGaiInjUTDub lfzVL2J7fAbmaxw+EdOE1y9SiONGP7pDOmsAHHQTGtLY+mhjjFlTkWiC/kYgiVWk0ccU qh8ginsPGoqR5X6PdcJ8waKtUcu6wIw7O8HNxg35LvRHOHx5ysa4mbpJ6/HU4oAbV/Jj uLj1+fzqUf2fG7mpnp8PbPPAxBkZoEOMwVuzgTOY++19cNfztnAJmyTcTilUjrLXLJLs ho1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g1g8cO8D; 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 g13si9039890edz.310.2022.01.31.17.33.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 17:33:21 -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=g1g8cO8D; 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 EEB5C834E5; Tue, 1 Feb 2022 02:32:21 +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="g1g8cO8D"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8F191836AB; Tue, 1 Feb 2022 02:32:18 +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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) (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 1F533837C5 for ; Tue, 1 Feb 2022 02:32:14 +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-pf1-x434.google.com with SMTP id c194so1928541pfb.12 for ; Mon, 31 Jan 2022 17:32:14 -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=g1g8cO8DzZ9K2uruoU8OfOpLgvaOPS8eJCafHc+2Qv86EzV4mwVBI7/A7Fo/yNX9Vi CUNw13z5IAs06jP0fXt3jVc6CX1EjEoV4FgpmzWZQhcBn/CffHJmdBxfQIioIUHusS10 EHzbm2mTW4bdBtEGOvmnonIAqoIhpUvomFr4/z0j4nI+u4XCA5yuBK1wSWp7KKeAAKTB o6Li4Yrg1YaIY4DPqyQBgTcHe2NVHhNk15Y4gbYj6rlCCh1q4QDnQTCjW32dqVuXpWLO lpP3m+Hv1SCZxq+WbB/xBekbKWDLGZ6UyL+bbBrEKCGgcH8I6yyhwzCmHn5TwKNMLN1j OoGw== 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=SJ/qlpc2V5xNJ/jVZmX/zpLFu1ZmvTvAjTb3lU0nX8AdfCLTVy8bu9DOzyo4YUe3pG +3/rmEA3JQ6YINYEHbwokBTjhqCyVOYwChi/S5oVpC37hF6J6v9i5xmSiTfewtoqeU5/ fL9p4/MS+KOKrtHvJHW5Z5ukRsgEkobu1ZakHqwfFeXx0cHyfIlU5b+1WYzyL8I60VHE aRiw4kXnfMd2DqPIin5X0G/X43iPcW3E0TfGg3B8EHQvl5NptNx5qB9k9C2a+B2nuidy 49dKYkQ5/a77e8QYgty8mNt86d18NyuYXaOCxxP0xQdpEGCvn5xStdRPO+MXVzXNCIYK lsoQ== X-Gm-Message-State: AOAM531wB/xJOtXgFlI/DpBA14yOAJZz6NjUSvMSqJMsJDsAO2M0UI0N 1rRpESoor5/0Y9bgv2VeY5BxPg== X-Received: by 2002:a63:8543:: with SMTP id u64mr19091247pgd.600.1643679132422; Mon, 31 Jan 2022 17:32:12 -0800 (PST) Received: from localhost.localdomain ([2400:4050:c3e1:100:a8:b825:f6dd:417]) by smtp.gmail.com with ESMTPSA id u18sm20733784pfi.185.2022.01.31.17.32.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 17:32:12 -0800 (PST) From: AKASHI Takahiro To: xypron.glpk@gmx.de, agraf@csgraf.de Cc: sjg@chromium.org, 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 v10 9/9] test/py: efi_capsule: check the results in case of CAPSULE_AUTHENTICATE Date: Tue, 1 Feb 2022 10:27:40 +0900 Message-Id: <20220201012740.63070-10-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220201012740.63070-1-takahiro.akashi@linaro.org> References: <20220201012740.63070-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.5 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)