From patchwork Fri Sep 8 12:00:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 720810 Delivered-To: patch@linaro.org Received: by 2002:adf:eec5:0:b0:31d:da82:a3b4 with SMTP id a5csp720682wrp; Fri, 8 Sep 2023 05:01:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFH96I0tZ/vgXqiKrUoufpAXNsdCYAhFb1/YgzeCFw4QdCAEoLc3b5y4QO/7Ty7oFxVIjdR X-Received: by 2002:a1c:7508:0:b0:401:be5a:989 with SMTP id o8-20020a1c7508000000b00401be5a0989mr1840229wmc.23.1694174499649; Fri, 08 Sep 2023 05:01:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694174499; cv=none; d=google.com; s=arc-20160816; b=q9hv1LpNKomcsMMXb6NOcZD7BQs/ezI3opoeV2VoYhasnJqufNAiP4p3wkWchS+kSh 5k98muatEjs0xcOe8Y5OfUW94/W9ziWmdl8z9jQRkcE5tdJnmZZCUeiS++YkBaJIYMTA b94DLasSTBiOQd8fkvsU1WhEV7zbpbyNNxGaiDncd1EA0j3BS7mj3ZHB44uIxv3onzvy 9+QDOmqQno22xyLtmJ6RRK4NlJeTybfs2bedkUNQBP6SNnSsJrH32bUTfFxd8YJNCZsV bOxaSiF2KuoPhA7wyj9PLuUu/1r63lRZfeDr50AytRmmGWc5LUj1XFUyOjyeXgNuc6IK kuDg== 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; bh=hPNeKigA2ADSDBrJ7MfRbwUq6cmcdks4PAfnjTfGOF8=; fh=lo2Vjgyv/ggZk8yIty16CtyHjEqk0MugRW6STG9XbrI=; b=omiST3dGSBPS6CyTe9/8fekfNojmXTfm1obwmHUWs6WpTVyEikKJKGyvhXSEpI9LHS kYt2KFrPvu3sRtFifauKCLe2oSXLGmciMwkfJA1mWF8nJwOpA78rIGU8+SDMVjtOPdFM X7Zhj9W3d6hEhj5ieYIsZgFf/q4ERYxBP5oTUqIQDm/YbTUbIKMc4MA8rHfUWf0TbYO7 4qIwoJJ7AZf2bFc06BSjO2ntEmlfLwZtheg0q+djzku27CZ7TwbS7NLZ3fvSjQCRixPv La/pX0kG8Popx5EjcNRMt3uQNLZMnRv0fC4NYruZ6hEgKJQo9MQZ263pLxd5SYVNz1ib UbXA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 22-20020a05600c231600b003fee7ad3f41si780602wmo.199.2023.09.08.05.01.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Sep 2023 05:01:39 -0700 (PDT) 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; 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=fail (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 83AE786A4B; Fri, 8 Sep 2023 14:00:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 5EE4A866AA; Fri, 8 Sep 2023 14:00:46 +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=-1.2 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 8750B86A54 for ; Fri, 8 Sep 2023 14:00:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F09D4D75; Fri, 8 Sep 2023 05:01:20 -0700 (PDT) Received: from a076522.blr.arm.com (a076522.blr.arm.com [10.162.46.7]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8A9453F67D; Fri, 8 Sep 2023 05:00:40 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Takahiro Akashi , Tom Rini , Malte Schmidt , Sughosh Ganu Subject: [PATCH 6/8] test: capsule: Generate capsules through config file Date: Fri, 8 Sep 2023 17:30:00 +0530 Message-Id: <20230908120002.29851-7-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230908120002.29851-1-sughosh.ganu@linaro.org> References: <20230908120002.29851-1-sughosh.ganu@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.8 at phobos.denx.de X-Virus-Status: Clean Add logic to generate capsules through a config file while testing the EFI capsule update functionality. Capsule generation through config file is enabled on the sandbox variant. Signed-off-by: Sughosh Ganu --- .../test_efi_capsule/capsule_gen_binman.dts | 8 ++++++++ test/py/tests/test_efi_capsule/conftest.py | 18 ++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/test/py/tests/test_efi_capsule/capsule_gen_binman.dts b/test/py/tests/test_efi_capsule/capsule_gen_binman.dts index e8a1858509..9bde81cbad 100644 --- a/test/py/tests/test_efi_capsule/capsule_gen_binman.dts +++ b/test/py/tests/test_efi_capsule/capsule_gen_binman.dts @@ -54,6 +54,13 @@ }; }; +#ifdef CONFIG_EFI_USE_CAPSULE_CFG_FILE + capsule { + efi-capsule-cfg-file { + cfg-file = "sandbox_capsule_cfg.txt"; + }; + }; +#else capsule1 { filename = "Test01"; efi-capsule { @@ -318,4 +325,5 @@ }; }; }; +#endif /* !CONFIG_EFI_USE_CAPSULE_CFG_FILE */ }; diff --git a/test/py/tests/test_efi_capsule/conftest.py b/test/py/tests/test_efi_capsule/conftest.py index dd41da9284..dba3114e58 100644 --- a/test/py/tests/test_efi_capsule/conftest.py +++ b/test/py/tests/test_efi_capsule/conftest.py @@ -76,15 +76,25 @@ def efi_capsule_data(request, u_boot_config): check_call('cd %s; echo -n u-boot:Old > u-boot.bin.old; echo -n u-boot:New > u-boot.bin.new; echo -n u-boot-env:Old > u-boot.env.old; echo -n u-boot-env:New > u-boot.env.new' % data_dir, shell=True) + capsule_cfg_file_gen = u_boot_config.buildconfig.get('config_efi_use_capsule_cfg_file') + capsule_cfg_file_flag="" + if capsule_cfg_file_gen: + capsule_cfg_flag="-DCONFIG_EFI_USE_CAPSULE_CFG_FILE" + check_call('cd %s; ' + 'cp u-boot.bin.* %s; cp u-boot.env.* %s' + % (data_dir, u_boot_config.build_dir, u_boot_config.build_dir), shell=True) + check_call('cp %s/test/py/tests/test_efi_capsule/sandbox_capsule_cfg.txt %s' + % (u_boot_config.source_dir, data_dir), shell=True) + pythonpath = os.environ.get('PYTHONPATH', '') os.environ['PYTHONPATH'] = pythonpath + ':' + '%s/scripts/dtc/pylibfdt' % u_boot_config.build_dir check_call('cd %s; ' - 'cc -E -I %s/include -x assembler-with-cpp -o capsule_gen_tmp.dts %s/test/py/tests/test_efi_capsule/capsule_gen_binman.dts; ' + 'cc -E -I %s/include -x assembler-with-cpp %s -o capsule_gen_tmp.dts %s/test/py/tests/test_efi_capsule/capsule_gen_binman.dts; ' 'dtc -I dts -O dtb capsule_gen_tmp.dts -o capsule_binman.dtb;' - % (data_dir, u_boot_config.source_dir, u_boot_config.source_dir), shell=True) + % (data_dir, u_boot_config.source_dir, capsule_cfg_file_flag, u_boot_config.source_dir), shell=True) check_call('cd %s; ' - './tools/binman/binman --toolpath %s/tools build -u -d %s/capsule_binman.dtb -O %s -m --allow-missing -I %s -I ./board/sandbox -I ./arch/sandbox/dts' - % (u_boot_config.source_dir, u_boot_config.build_dir, data_dir, data_dir, data_dir), shell=True) + '%s/tools/binman/binman --toolpath %s/tools build -u -d capsule_binman.dtb -O . -m --allow-missing -I . -I %s/board/sandbox -I %s/arch/sandbox/dts' + % (data_dir, u_boot_config.source_dir, u_boot_config.build_dir, u_boot_config.source_dir, u_boot_config.source_dir), shell=True) os.environ['PYTHONPATH'] = pythonpath # Create a disk image with EFI system partition