From patchwork Mon Dec 20 05:02:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 526049 Delivered-To: patch@linaro.org Received: by 2002:a05:6e04:2287:0:0:0:0 with SMTP id bl7csp3768786imb; Sun, 19 Dec 2021 21:05:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJxGbjElHU3UDNzNu03x8YsYZlh9g2YdvbbfJsY+g4PmuWMtnNSbiS25oFrxi/i126GYdrSL X-Received: by 2002:a05:6402:34d1:: with SMTP id w17mr14100593edc.229.1639976737629; Sun, 19 Dec 2021 21:05:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639976737; cv=none; d=google.com; s=arc-20160816; b=a4YnSzcohLGoHgSmNYFW+ZhuMegGEUrHguZLz9pkOYFCUrmsSo5xB46yr7rsAemGoH Mv8x8Ntgl3hX7/5HlqNR2ENTMcjo4c9QXHYDhMYwna4H3gYQcYr8QCNmjLf3SYacziJP kagrCgPkiw5Is81Zvt1Z7rV3FICO/4nHQDWH/L94F3KdwZup0qXEj3hcuZOUIyNmT47i ZU9lrHMcl0N+4eMlSsACUh4r6gT+wclXftDNh0HGxbEIDvnUyrXYtt/uH62xBLcMvLzl /cRESlNgUI7YlajaAC0m8h5/01Sewuz3cNFLk24VuCqm8lWFVyCu+ZblOZ7FsQQBAWtL HSNQ== 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=ebePL5WkKxzWugQri72HNMhQYcr9lDLpLugjY2uDBhxyZp1MlxA+aGtETMr4zaJrFL KCrIgvt1l/Q3dJN9imZ3I9cAwMJK7QVh997pRxBFkFZO3Uxs0uWgsbJOopocHWkYPSO/ OpfnmK1hA8HjzCiASONP0jthEjQbSzlbTCFd74sjXtGUFtU6yAa5rbl6pvMjAs2m3SfG cRrZG8EFg1uGI0lGFfpqHiDNkspuuyOhj99IFEeYHDykYPiQeOekbsTwjj9qpCz30zEV YInGR1/CxSHZpZBSDd0XOPxr8IzazCG8Lx7IFsUAFAua9AKpHg23U+tpvEAhk/K6vUHC Fsjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="fraJ3n/K"; 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 m19si8408471edq.451.2021.12.19.21.05.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Dec 2021 21:05:37 -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="fraJ3n/K"; 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 CA6AC834CF; Mon, 20 Dec 2021 06:04:37 +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="fraJ3n/K"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 752A28307B; Mon, 20 Dec 2021 06:04:17 +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-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) (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 9EADE830D9 for ; Mon, 20 Dec 2021 06:04:12 +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-pg1-x535.google.com with SMTP id v25so3231446pge.2 for ; Sun, 19 Dec 2021 21:04:12 -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=fraJ3n/KWDGl0+oEcgIsEboq5X8zCx1OZzixsdPdSmsA9U6S6taimZs+LxL15Za6Kf YkY97CYTWKDA5Dgfkb1TfxtL4/Oe69FS8WxTMwQYNVIWJOk4a53Lhlv9J92IGk8Vdo+s ta6m5eK0bMblAVUUoRLOUkZN7mz70lnjmeGDX0ZtYBH8CG+pV3SpUECQq19ymzHimERk nIgrwzAM+MrVqC8gEloFwPAL1PP78lYnxHolMgFiRhuVknBfO5hUiTduURxc8qB9FNns x6ZAeemwyKPYvIkUeDrMO5vRypXreNW+CUTNOQqs+9Frf85vvoRV4pqEOpxEJGvbDo4n xc3A== 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=W3t7cKCRYFymD1I7lPFoiRwfFO5Csd0+Krh4GI/6ohlZLTpIzS2/crVLGHc/dKH4Ip nPKTLApUAwmaIdr7Nr00ojmWwquZg+GZSMdXLuYC4E2kGSR+VvbDsQtP3SZXFzVVSEOD WRG67st5yQkDhreFTcYXt4OcLpRvLb+YtC+Gq15x6kLZIwSiG+cNBb8bbs0wIoAnvru8 2LWMMLRahwiU07ksa1RZ9pT1511+KTyyosqPxHz2GM6/AcsARYENeWoO8lwlgI45Q8sH 7y9/3Jz1bKq+2FpkScQaRyBSUcXNf5/CvOqXdPx3QV/9biZhRTRBCsM35Etyuear2axB Jugw== X-Gm-Message-State: AOAM532haPF20gl0zybNdVt9RkdQ0qn9iEAz0QF1ct00ITMkwVEl9/I6 jG73pe2fhmSSQl4M8h/OIwB3jw== X-Received: by 2002:a62:7a58:0:b0:4ba:6ddd:814d with SMTP id v85-20020a627a58000000b004ba6ddd814dmr14443562pfc.43.1639976651043; Sun, 19 Dec 2021 21:04:11 -0800 (PST) Received: from localhost.localdomain ([2400:4050:c3e1:100:89bf:be4:468d:12c2]) by smtp.gmail.com with ESMTPSA id mu2sm4581163pjb.43.2021.12.19.21.04.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Dec 2021 21:04:10 -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 v8 10/12] test/py: efi_capsule: check the results in case of CAPSULE_AUTHENTICATE Date: Mon, 20 Dec 2021 14:02:51 +0900 Message-Id: <20211220050253.31163-11-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211220050253.31163-1-takahiro.akashi@linaro.org> References: <20211220050253.31163-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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)