From patchwork Thu Oct 28 06:23:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 516363 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp1371487imj; Wed, 27 Oct 2021 23:26:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAxlk0Iy26nAQ6GUc9BuSstCwaAwJfgYLNRrLCssIXd76VvJ1Pnw35zuU4YEcGi6lYkbAs X-Received: by 2002:a17:906:4f95:: with SMTP id o21mr2989901eju.61.1635402399132; Wed, 27 Oct 2021 23:26:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635402399; cv=none; d=google.com; s=arc-20160816; b=M7TlNFSVUMKkr2oYrRADMPBWC7xC4IEuzQ7Un4BuBDltFAyqElwVt+6DSWrmFOyQlh jaGobjm7oF1RZ5uJyOzFtQrahc3DK8P5y2wqrF11fMOZ5zCKgfGktuKGguTIhNccXojo 6DUls6Icjb4ihrryYf5LSCzDz7C6m1+2FGpF8zPjw77NpqfGlIc+m73VpMPW9je9M1lG Iy84Djtf/YpT6rAxfOyebjHMxHYtXH0vAPljzIhlkq5TBXBQF+mo6UxcqgG27j2WOOu1 cYkKce8xIko5sl0rvtIEqddoFaP8Rfbmnw04eCRhffDEpi3ONh1BUK4ao85W8YrD2bMs YCvw== 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=NRvsSIiF4w56qMrqeTRm5at9mB3OWRodN5v0Mx1IWDgYJaOPAheMNIm7hV9v3R2bF/ XlxNieSq5X7z/U3arD0F67JtF93ZN7ADOn+5zbc6gH41wuHH9FuBYjdNXywlsCyB3Mso ajTuJLFLzRMUsys2KtNS+TAHSsRb5brbd4sD6d/aVrH0kuVvZxq4Dcz23qnIImUr39A1 e7mUMw6gCVdrCOvg1lm0fPvUeLMMopDdWrUIerINGpP6mEajDYkFT+0UDq6qdWtkPg3k tlR8xib9t/foHY8NFvCuJcEwgS1vwAn4nRfd6O2M/dGgsfC0x9U3RwFWA5LWncC5rFo2 7PYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=izwCzCfv; 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 g2si4228800ejt.760.2021.10.27.23.26.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Oct 2021 23:26:39 -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=izwCzCfv; 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 C4C6883576; Thu, 28 Oct 2021 08:26:07 +0200 (CEST) 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="izwCzCfv"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3352582F33; Thu, 28 Oct 2021 08:25:37 +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=-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-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) (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 B52ED83172 for ; Thu, 28 Oct 2021 08:25:22 +0200 (CEST) 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-pj1-x1029.google.com with SMTP id np13so3892621pjb.4 for ; Wed, 27 Oct 2021 23:25:22 -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=izwCzCfvpUW9WVWnqdUWb8tVupTIhVHM0+ZmOChO5ZzRNH0LNokQADCGkelUh/Qh5g eWeIZkNzuoOm1OdCZ8y5ewCgR+6kYwSwscMx6S0dZq2omQI1iLyuiKEKFidTz2Tdtcit XxSxKUE+kOvJoLYxo9z+mSOCAD/kW0MUYsedrnvqLblQCD6YoJdLyL190h/1Psgu4jyS KL+KcphAA2EnvrrlO3WrRLzOxeI9diveAMkKEaeqrzyrAEOxGCETg8V7SbHAl6hE250I s85EcqcIzpoID2ElewNt0T+gD/OP86oN5tXz5Yvy0aIB2wwmwkAt9SlonnrgI8/HgQyK NF8A== 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=V3QH/zbywIyGSvNkHK2HzSM9wPK9e52kIS5CTKbTHqWCVVaaY7qzZcI3nNVhPE8FPQ RwABVQPstOzn4HIwpTReIenJnFwVl7B8hxXOQvduEBgmcER99CjBGqUFWr9HWTUUufvS elehNSdf/In4DBrraIKF0K42ymubS3h5XaY9fQcK/2ZKvj4xutFmvhAJYgHe/LAAl9J/ cwMCBrvxDOVQ5JiOU1SKeqlQVgKOPZTKXqCPXVzh1Hcb7oH9ZxU10i7Pks4FQWkdVOLA 3sDTIbn314oy6qNeOe/Q5qAZunhV4TU+elcVHkan7zfEEOGf4PTH/bbNtY8JUZkuRfc1 AvCQ== X-Gm-Message-State: AOAM531J5qOaimulSAgbiwcdA8k1YwBboXkUqz9MToRc6N9LGL8WSXbI icz+tOyYsCV/ZR0mLH0gNRR49g== X-Received: by 2002:a17:90b:3ecb:: with SMTP id rm11mr10903339pjb.110.1635402321093; Wed, 27 Oct 2021 23:25:21 -0700 (PDT) Received: from localhost.localdomain ([2400:4050:c3e1:100:394a:97ee:bbbb:462e]) by smtp.gmail.com with ESMTPSA id p16sm1582018pgd.78.2021.10.27.23.25.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Oct 2021 23:25:20 -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 v5 09/11] test/py: efi_capsule: check the results in case of CAPSULE_AUTHENTICATE Date: Thu, 28 Oct 2021 15:23:54 +0900 Message-Id: <20211028062356.98224-10-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211028062356.98224-1-takahiro.akashi@linaro.org> References: <20211028062356.98224-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 --- .../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)