From patchwork Tue Nov 2 00:55:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 516608 Delivered-To: patch@linaro.org Received: by 2002:ad5:5208:0:0:0:0:0 with SMTP id p8csp3917403iml; Mon, 1 Nov 2021 17:58:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzr2n75U0yM6YReVycTwNhicKy2j0l0UTr8e440yx8UPaBlr3RKfJ0lLFRQbst4gHzZGIam X-Received: by 2002:aa7:cf8d:: with SMTP id z13mr11121527edx.5.1635814685856; Mon, 01 Nov 2021 17:58:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635814685; cv=none; d=google.com; s=arc-20160816; b=VAFvU04YrJge82QX88BO4hqn5gItDN1erDrDbUttsCU5DxykzivEA2p2yUH2X27IAl tZPHDBCoTer6UKSz5S/9yosw/6X+MamlhwCOmL0QrYXoDRZU9CB8iiPdfRTvy+bWeHWC jPr6NSoVWcFUAdrfut4MfPRS44xGqZy0xQq56+JqjqU+SNKME7TwmYigih04mw0DmoGv 8XwYRG7ZEc0alDs/ZvSJzhn7LiFBuMToPpvnHbvyhYzp1KhK/itDIH6XrLvG/i/Yf0Rq eSSC/DRo1T9e0OOeJ8+ROrOOVR268HV6JRGy//nvRonBEV58C3aWOvjB05MD4pxncr9v tBZA== 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=cKodfHrn3bFXlghVQ9of8BIc8y1xcIrgpj4uzdGOZHo=; b=dRU0uNb3GAzo20S0WgAyu1qMrljjJKLVDLK2+duFt5V+Gyh/cnPUp8/aX1KEcjpHXk t7nmYCkXu/aXjB+lMx0CsumQT3nBm39gbfiGtHIs7SOs3C6sASmovdxwtowi84qVeF6g Y5m1/HBYAqvxk/gwMPYhsnzcXedX1pbB09+6bMB++qAv3rDZHYeawNffaQjSM1AX8WL3 tv1KxlzEp4Splk95KO4uqjSjA7OxzLmCyyvi0JxTtCT7KKO/BCyY7LvjkYSKRXe1Lzny 2ZRyeD1ldHkVhOkCU7FH7blhA5Ey1t9prxZ1L8uP4qLzC3Qx0QLK8+AUZDb7Pta03iXV lwCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CGeR34uM; 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 bl4si26435191ejb.277.2021.11.01.17.58.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Nov 2021 17:58:05 -0700 (PDT) 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=CGeR34uM; 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 548E18362C; Tue, 2 Nov 2021 01:57:42 +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="CGeR34uM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EA81A835FC; Tue, 2 Nov 2021 01:56:45 +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-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) (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 4BBD08360F for ; Tue, 2 Nov 2021 01:56: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=takahiro.akashi@linaro.org Received: by mail-pf1-x42c.google.com with SMTP id u33so5937485pfg.8 for ; Mon, 01 Nov 2021 17:56:17 -0700 (PDT) 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=cKodfHrn3bFXlghVQ9of8BIc8y1xcIrgpj4uzdGOZHo=; b=CGeR34uMG2IeBrgLFkaGl0AcGaRX5ATmVuGOlzsRaJqHDn5+tC3G8xmqyyGmrrOhKT jOvwXj0gq5r13lKQC22wpm0lYHiYuz61zL7g4/H9tWHIjooeB+WtwtPQp9uabbvInYF8 1moBEiAEESJeSf3qBKroMqYFeN5MrIZIz5qwJZ8idkYTpVGht9DCVeNtACcerzFu63fC VWxge1XJg7lvASFvpTJ1vN9P5fWAH/ndhVCEAye87Yb0eOCkgJYXceEgJrrz6Fqd3mUC Z6FsT7aKiytkKCbviZIf7MIMgTuDb6Ye+kBrTgRr0wdTluEqPV3aHtqgR67KEisjk+aQ N6kg== 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=cKodfHrn3bFXlghVQ9of8BIc8y1xcIrgpj4uzdGOZHo=; b=JwTcjMCOisFVfVNb8B+92vCsaTvUlf/kqU+xJ2ogCKpRsxIehpm+P4OLmjSfPg61K0 9L/QpFnDjVZ6VfLbFbmKxIQrdnprTPHWv2gkfy6GyTuiP2sYXrkDcIer+HbW4zFro+XJ eK/Lwdk88dyyNcQtkumVqOgO5fybZzrAfFRlfIeFXD/Doxat3SjFoNReF8YinEz1i8nf THu1CRTFRqz/eTl5Lrgzf75yXTgbgFt8PpKM3b2aMKSNcVyeOWjqGs1vcF0O+MK7IHsp IsMR+O2zJPc10SR2S4RxzVZIsNsgqhsheLkA43LSmWl7xtDDMHo6GBiInUc43eySHQqm v46A== X-Gm-Message-State: AOAM530vbqfRCdRedvLJg4yL0lgEAnm96mW0BIvNtQ+GtkJbycL3WY0F Sxis7T2spsDXqGUPcnptmKvluw== X-Received: by 2002:a65:4942:: with SMTP id q2mr22114538pgs.405.1635814575603; Mon, 01 Nov 2021 17:56:15 -0700 (PDT) Received: from localhost.localdomain ([2400:4050:c3e1:100:a475:65cc:d4b7:aaf5]) by smtp.gmail.com with ESMTPSA id n29sm12305596pfv.29.2021.11.01.17.56.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Nov 2021 17:56:15 -0700 (PDT) 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, u-boot@lists.denx.de, AKASHI Takahiro Subject: [PATCH v6 10/12] test/py: efi_capsule: check the results in case of CAPSULE_AUTHENTICATE Date: Tue, 2 Nov 2021 09:55:10 +0900 Message-Id: <20211102005512.96019-11-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102005512.96019-1-takahiro.akashi@linaro.org> References: <20211102005512.96019-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 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.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(-) -- 2.33.0 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)