From patchwork Tue Nov 16 04:32:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 519172 Delivered-To: patch@linaro.org Received: by 2002:ac0:c605:0:0:0:0:0 with SMTP id p5csp6619836imj; Mon, 15 Nov 2021 20:35:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJwlMXYEC1q9OL9YH+Czr4ERiOr7riW8jpdgfWFL7cKXLgf2Ng2rMxUFPJLu9fuiNUjsBD5o X-Received: by 2002:a05:6402:d05:: with SMTP id eb5mr5148291edb.345.1637037323866; Mon, 15 Nov 2021 20:35:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637037323; cv=none; d=google.com; s=arc-20160816; b=PV89B78e7bsMwUqf7FTEshkZVHX51depHaZ4R3GGx7FixvNRUtajyylEdejdmnfI5V 8BzKgZuqcvJYR7NwRhFy0LkQiMP6bzxrYYhP8SJF93XvjX6UK8pCjdLxE8w+Ju1jEUal Ej1KbKmPIVJ4vQnyhjCkzGhpcZOIlRln4u2TOQrjUea8jfDkWCRXh46VRtA7JPjO8MQu Wg8M1Nq/8R+0gcoWv1YAvq0dhF5/R7BPuLYgjeIRNGHX9lPv8GKKmRDFB7jWyhQn5tHt ZyhQnRoWp5DHU8mQnJYhy1/tdlzC3RkcQtKYYlpB8hyJHjSXDhX3+wr0jgen21zVapCC bFxg== 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=Bg685LRpSHO6EkdvSIv64ke+uwZ3CQOKsj3dGRr4HdLuOXiUEoplcRRciVdZFrj75S ckBcUyLiK7aUYi0a0It/6DLJZFHZYqXoiVYk3t+ZXo+KOdtLU+hg+/6bhRhUuO9v3/eZ 9VhxllTKZdXFuDadI8CIAzE3AcH7r+LAOdOs0I7NZS6Z2MDntKUkv5hz78hSj8nYlevW gG23NKPJij2+6vl79Ejzzg8ruhmZdDO4O6XAaGzNcQmptMnsMvAgdgWG2mYqq0iiDZQy sSsfGL50sNMbhkywVcTB91Z4kF+J9EdY6g7VN963FpuUlIWaMRbDxu8n2dZN6MDrYuh4 gGUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="W1W/uDw8"; 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 h19si35170008edt.391.2021.11.15.20.35.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Nov 2021 20:35:23 -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="W1W/uDw8"; 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 3D8158381D; Tue, 16 Nov 2021 05:35:04 +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="W1W/uDw8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 96B8F8364A; Tue, 16 Nov 2021 05:33:58 +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-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) (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 F30CA837D9 for ; Tue, 16 Nov 2021 05:33:47 +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-x529.google.com with SMTP id 136so11826549pgc.0 for ; Mon, 15 Nov 2021 20:33:47 -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=W1W/uDw849nuMSszdX/HSqNK0efID0/VM2h84x69q1YlM4LqQBxcwC6PtgDSGVMGYo /WafmM26EajS/kTQHugr1m+Vh1pT8KfTXLNcBRZxQWtGqQaLd527QRZq+vsVYl6+X9sp +ajByLs3Z5sPEKLGrILafVdYdc7/GQy0Tkguev7+xjy4aC+ajx/1fLSm5ov5f7cDnMZj 2mA5LWEEj9AzyKputxbrmwsM72O5ftH8ee6Z8xKkCINs+D5aN4w5btZC8w1zw6WOorXL Tei5xlg33DZBakLs4I85q5g6e/2a6xSLKEH4zegtSAyq4U2yOwFJsJre8rurs6gETXnr gmIg== 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=ARaPpUMJq+8a3EnozEeFSbjz5BNZh+AfZRsKEW7rvq1AeHiQ9upEkTsdDqMsTMu1lR SS04AMIdoP0f3esDp17MYPkQ0B/o8+0SV61280vp7FVUhXlKTwPAjMUUXfazOS61sU68 shbPYRHQKgXTmGCZGonq8wYU5JBjDXWMmI7hIzUybpokkvf7XyRQVjw9lQZ056vj2hwJ NKtcwUz5uWPo3B5CD8tMfqidyP3YiU9UV7CiurRpPrhplVrhrGFpgRyh7tVz8C050h8L te+wMIPUYDTFHaWan8G1ZZiVb4uW/RqFSeU7sYoeS1W0mF5Lo7yLiC2jsncUtXsRu6ZH eMdw== X-Gm-Message-State: AOAM531IYRW+C9v8KLIV4GcbhY5TT0mr4fB2o8nPtRX75Gj727oqOvfU WRkI4CODkFR3q0udciyneAv2uA== X-Received: by 2002:a63:1441:: with SMTP id 1mr3023995pgu.66.1637037226303; Mon, 15 Nov 2021 20:33:46 -0800 (PST) Received: from localhost.localdomain ([2400:4050:c3e1:100:d07c:c772:1ab9:a9e0]) by smtp.gmail.com with ESMTPSA id lt5sm782914pjb.43.2021.11.15.20.33.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Nov 2021 20:33:45 -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 v7 10/12] test/py: efi_capsule: check the results in case of CAPSULE_AUTHENTICATE Date: Tue, 16 Nov 2021 13:32:36 +0900 Message-Id: <20211116043238.67226-11-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211116043238.67226-1-takahiro.akashi@linaro.org> References: <20211116043238.67226-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.35 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)