From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0661DC433F5 for ; Wed, 9 Feb 2022 10:13:10 +0000 (UTC) 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) 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-Google-Smtp-Source: ABdhPJxHV1PBrBTPnS8MQnBA0QuVPP7oQ3ZGUFF6YfLmatkBPI4S27ura6wOgMG1fyiLB46/72C80A== 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 Content-Transfer-Encoding: 8bit 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) -- 2.33.0