From patchwork Wed Feb 9 10:10:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 541091 Delivered-To: patch@linaro.org Received: by 2002:ad5:420f:0:0:0:0:0 with SMTP id e15csp1208534imo; Wed, 9 Feb 2022 02:13:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJxdExV21+xUHNTS+AFFckqvdv0MMBmT5R1KxMVCtzhb8ni0ZXsqa3K2oYQlprNOrH/xIIBp X-Received: by 2002:a17:906:9742:: with SMTP id o2mr1230246ejy.126.1644401591457; Wed, 09 Feb 2022 02:13:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644401591; cv=none; d=google.com; s=arc-20160816; b=gOc1xsaTp6dnj4Qq6kLuCPw6vJwAU1nfO4vH9NxNf5KC4GFayu+PRjnDs7SdVEbkpb kcnN07EBl3I5SbU+QhP/SDoANmRSltWXWuSevXUyM2zCmQrSHtyp9t5PlEbSc+V1hL6i Rh3OEA+jIVq3pse4ueJ7G1b8ZIOwgKWhloJEsz+whyoQz0KdW0aPAnIZSrT5LE/5ykom X2mtqQrS30beH/O546AMMT1JjCxX7IwmHPkVJUWTlE90cWpCxw7FSZiaz9+Ii/gIowBo 1vdpckBb8dkLxvDazYlNBb6FGnOoSgekPWwl4elC3y034tW6hYOvyMRof5vnVAFNrC2l 5Uiw== 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=aIQpQSTsAvgKItV8lf5NMg7JD2hnbhR6m+OOEWycdOE9Se53kfjrwOBCH1UuvsNvSN 5AfNyXkDadyBj7nc/k+UoyoOMeez2+RluhbSQSvpDZgx0ctmPt3lWs21umcaw8EQJygu l+9JGwvPhh986CC1iJkSw6uG+1152bitONqo902cBVbwWjyUCBwSbiDbytGa1zX2UU5C wHzCPuQVZHmWt3vFeR2Er9Y6dvLH/9ZhYrqzTC873hHRNT5mHitig75kOJ5oP2d0jIJH vmt6iOATC3F8+W1OLCkAV7wz4IM/P+LBuT/mRJBBW0r3S/TWVo1bdmlg3IEUxRxCXo9D YkMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OlFp+ib7; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id k13si3321229eds.68.2022.02.09.02.13.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 02:13:11 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OlFp+ib7; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 1C21883E88; Wed, 9 Feb 2022 11:12:19 +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="OlFp+ib7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8F92D83E38; Wed, 9 Feb 2022 11:12:00 +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-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) (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 3484D83E1D for ; Wed, 9 Feb 2022 11:11:54 +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-x42d.google.com with SMTP id n23so3470500pfo.1 for ; Wed, 09 Feb 2022 02:11:54 -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=OlFp+ib7CvOVWG7DZrXJdYOKMgbG40jQYZ1d9UW4/bmDB/QGFXplWzsW3eGuCB79Do MRrqCZnPxnZ3smYMJAc0sW0KmIDcypBqQqz4LRmwNPY06zyCiFG3CRLWPR2k2L7kkhLx Gh5yY9kkODkVvWfYSMoDSMRxdJXfYDeG8b5fYy+IXKs0KWF7YTGQzKn5D6Tvss1LKl2G V3E2cbucfMVicBk/rV9rhaWxdAol7MfTq9NkiSTkhSxv2WY0mWH6a98lf0cU7uSlhEhi Ot/md5/IcchSw0lGv0UV6Q2ncS5xPKFyH6yxR73gkezHOmP2YI0gUf5visvzJ1kEUDhd cNhg== 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=sC5H+Xl6RUeH5q1LyRzkIGJ6ELQlcbCOYY+flUpwqeVQ9VuFNmYh/KP/x7S7+eBHqG jgyruRJCPcZTs/CdGn39jMsBJpkb4ufZy1LFpzbyoIvq7LaOfTi66AG8aOS8afD6lomc t6BXKN23ZJTCcvFi5MZcExfJpSdQ8U9pztF9jGBgbvztvXwSx8tc315xtOh/6aHH2qKn MKDRmUhiKMCvbmCA2aXEw+s0X1oDoACv31dNRjIN2qBX2NhOnhgiKRZcLr6iA30r+T1S 7K30E9Cocaw2TuRhZOSqd8B11FZT9J3FhPduT95O9HZLElojrUPygdenQ3hhfVyXAdZY uJ7g== X-Gm-Message-State: AOAM532eS5CiJZ7g7eAoc76Yt9kIoJ+p3ZMPCPL6VBHVGhjVOhh6dWz8 tU+SjNCFI5+8kMGP8ZB+Wn5r6g== X-Received: by 2002:a63:ed13:: with SMTP id d19mr1301178pgi.335.1644401512370; Wed, 09 Feb 2022 02:11:52 -0800 (PST) Received: from localhost.localdomain ([2400:4050:c3e1:100:d885:543e:bfe4:9eb5]) by smtp.gmail.com with ESMTPSA id mi18sm5143303pjb.35.2022.02.09.02.11.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 02:11:52 -0800 (PST) From: AKASHI Takahiro To: xypron.glpk@gmx.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 v11 9/9] test/py: efi_capsule: check the results in case of CAPSULE_AUTHENTICATE Date: Wed, 9 Feb 2022 19:10:42 +0900 Message-Id: <20220209101042.78036-10-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220209101042.78036-1-takahiro.akashi@linaro.org> References: <20220209101042.78036-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)