From patchwork Fri Jun 16 11:34:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Herbrechtsmeier X-Patchwork-Id: 1795869 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=weidmueller.onmicrosoft.com header.i=@weidmueller.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-weidmueller-onmicrosoft-com header.b=BQTSPcsJ; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QjHCm4sBGz20X8 for ; Fri, 16 Jun 2023 21:35:48 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2264D86262; Fri, 16 Jun 2023 13:34:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=weidmueller.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=weidmueller.onmicrosoft.com header.i=@weidmueller.onmicrosoft.com header.b="BQTSPcsJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0886086241; Fri, 16 Jun 2023 13:34: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=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,SPF_HELO_PASS,T_SCC_BODY_TEXT_LINE, T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.2 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on20621.outbound.protection.outlook.com [IPv6:2a01:111:f400:7d00::621]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DE47F86248 for ; Fri, 16 Jun 2023 13:34:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=weidmueller.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=stefan.herbrechtsmeier-oss@weidmueller.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RmOwAG+rYK8UmCm6yfxG3lK1GjIJJZ1BvzpMy9NChR6Z28Uhw/mhmmZHs0wwt5wYID/gDzCSW7/tAxcUEeC1vL8etoSM18EtlEQjYwyZuedRHMkL7GT6ss0GGvif6JJ84SRuqPF7/e10saHUlIyH+ydZOK387peRWnJERRaq58CJ5hEMczyu0V/V7iLJcCHzlmIZNGBzxTfu5S/iTXqNoy05CSEflOGUXf3bRGmbqGApgzbqnoaN1KvtNbOHW7SuO3tvCeVBV8T6+zhYE4hNwEUNVpTJ5EtdqNJ6qSCqteSWwXRu8nBWHqhu/wK8XbSVpgzvEEVc5t7xzEvFbG4b0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZH28uyDRDqMX1dIQmIqrqhkBE0ab/wPuzqH4ZBC1j7o=; b=kH4YhAvv1oWSdMdx4veE8pxlUMVTu6GYWMA5aIvIwn+pAcmv8wHpygOkAk9IJo8znJPJI6FNlwQwc97Ump/UlmUt1cgAMLXI5c5uERoCoMxYOKtyCvtKOxNuQIaX8Ut5molV8ByNNycKSRQ1GNh5GyZVCDUiR/Ui3jkoOss2RBQM8UfyPfEiaXMs4ZqassjqvtX93f2Zt8+Babf76dkLNbTnAMW4m5B9yaEw9J1wPu8gMWhF1x4VOvjiBVz0YJ9yE7BZFEfKMw1QY6pUaiT4EEq+74CmkjNcoA4Z+BjXA+siSuliZhkiEK3uQEvXM/tgvUKLZw7iVEeUjj4h0+9HJg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=weidmueller.com; dmarc=pass action=none header.from=weidmueller.com; dkim=pass header.d=weidmueller.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=weidmueller.onmicrosoft.com; s=selector1-weidmueller-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZH28uyDRDqMX1dIQmIqrqhkBE0ab/wPuzqH4ZBC1j7o=; b=BQTSPcsJ6CQrHpbzfFKs1QE+wkJ5L6UM0JTCGYoCWa5QrFo+g+GuGT0xXUmvELFXWfRn9riZPV8WYlVkozhYT5+Hep3zHz9EdyollvGibniytN5c2ktTGCJsJCWahpiAREjebGPyy4c51cdnItPfg+muQvUWu0ufkuy7fRR3eA8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=weidmueller.com; Received: from PAXPR08MB6969.eurprd08.prod.outlook.com (2603:10a6:102:1d8::23) by DB9PR08MB6444.eurprd08.prod.outlook.com (2603:10a6:10:23c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.29; Fri, 16 Jun 2023 11:34:40 +0000 Received: from PAXPR08MB6969.eurprd08.prod.outlook.com ([fe80::7501:6f07:8ffe:f389]) by PAXPR08MB6969.eurprd08.prod.outlook.com ([fe80::7501:6f07:8ffe:f389%4]) with mapi id 15.20.6500.025; Fri, 16 Jun 2023 11:34:40 +0000 From: Stefan Herbrechtsmeier To: u-boot@lists.denx.de Cc: Malte Schmidt , Sughosh Ganu , Malte Schmidt , Stefan Herbrechtsmeier , Heinrich Schuchardt , Ilias Apalodimas Subject: [PATCH 3/5] test: efi_capsule: test a capsule update containing multiple images Date: Fri, 16 Jun 2023 13:34:24 +0200 Message-Id: <20230616113426.13976-4-stefan.herbrechtsmeier-oss@weidmueller.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230616113426.13976-1-stefan.herbrechtsmeier-oss@weidmueller.com> References: <20230616113426.13976-1-stefan.herbrechtsmeier-oss@weidmueller.com> X-ClientProxiedBy: FR2P281CA0174.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:9f::11) To PAXPR08MB6969.eurprd08.prod.outlook.com (2603:10a6:102:1d8::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR08MB6969:EE_|DB9PR08MB6444:EE_ X-MS-Office365-Filtering-Correlation-Id: b47cd157-7383-49e2-15b9-08db6e5dac3c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Wcff9AYkcesvEZPELzgKi2nruohVHo0gaB7HQn2ln9FuwMXJKNJY15vMg04rifE5OaVkL6/tbN+oE2yNDEggVxfSgZzLaMNfReBePlRf5xTDE86iJ20w9xPVmf2xwBNSk4xYYVUmU+P6BNnXyuXWR3JQ6fDNv59mt/+Abt9oq/i7cicy3QndBnrJdqOJCqyeLKxt4bEHbpY6G3pTX3b1tA1ttGm1YePTXPb8Ocgw4kqMV4blOr6w43ZaFAZRhR7MSksxDC5qyJoNke1owSIiQaMeXOFuQy933apLi0CcSb++QpXyOw6ZXGoKP+vPPqktJ0LYzNoiYPiJqt3bYt/x/Jk/sNxbVSgKgzAx5lLKQI3rtmSrBXgHRLZTFW/16BJ2w5yMielwx89BVb7JQxzrxo5gdp9gCM62ZFeIV4yGXCHb+cvFFBv3MT7qjmfYPRmetnFWfuI/UGfAiNCHynkmhU/C7W0OU2fELmM/15N6E8HMp/p1fm7Rmgbs/brpP6aaiAoz0c9uP+Izyzv1eHUO7vt/PevEA8KzurSE0yYLtjtj+kKLWUj3qfo9jbaY87GmDtUVfCnxn6ZggF/B8Yy7/FwMrf/O6kRNvxh/HCYNI+hK/OeAXbipth4U1MOfEpXI X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR08MB6969.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(136003)(346002)(366004)(39860400002)(376002)(396003)(451199021)(5660300002)(54906003)(41300700001)(6486002)(8676002)(8936002)(316002)(6666004)(52116002)(186003)(6506007)(26005)(6512007)(15650500001)(478600001)(4326008)(6916009)(66556008)(66476007)(66946007)(86362001)(1076003)(38100700002)(38350700002)(2616005)(83380400001)(36756003)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5TUD+4uB2700p2MydwbXlX6mdAurqPf4DXnJAhNEnm14Dwwm8swNpuSruoB3+J3qhV19t5V+saz3+aneWTfgZreLoJizfeP0EUMILp/dQ1AIeh38doR7iv0WNclTjL1K197voZ/UBrs8DKpx+fmq6BGsWCHNaQcx0n6MAwSS3yf7BReT8B+1x3Q5iMmHkbw3+2Q4dp2BVEwTQwAfpVgDXzDHvF+QM3ukDrJOJis7aQNY/ERmLyB/CWL24FkmvYkwcTTZXueOdouWPTkwH4Ay0c1mdVKplOmqvaA+cXWQXnE3tLapunXt66+0t31samPO43DxKU2ppLHNjsNmBn0oRIK3kdVxpYAT7DPt0M3VLhqpOUvI/mGGlLs1rOnZ7VeeYEk4t+eqENZowmazGbHbLK9D7QCovi7oLjBP4QW4H/wa3XBxfJJqgSLeDMeawv2BDuR5oTcqlfLAnIBkD1kLRkQb1IlCwvfGWbTfczuQh9I49Hg5t9QnSywdmaiR0kAVxdAIXS0chQD+pos67LutJtyGci9pZnIsqTSH8ERZ0CjZg5xXeDE3aDWjTKPEahEcU9+eMtNG0eueaV6YXkW7NAJ+0mId6h1Pss+OPQY77q4zV+SBg1sedl8b3vSHPgABYjOHSv8DMT0PZL43hLmb5dqkp+NgnsK1MO67Clmay8h34At1VbEPV6dZ/qeO6oG4heHv+Xb5GCa8AXnv2BWwPzzq7/vodddbNHXXvCMzxi6xmACKacOmpfjF6VYF9AcDAlFhF+LCOMRhEJpIDWSDs+n5uIpmgAbQvg5oCldJCxnehUNN5mhhAYGiJjsnVhTbYx9hHjbRj/jpvM6mtd6d/4JFNfAYNxtYP65lgrZQfIMO3U/XHzzzCT7vaRJZoaoITgI+PgSttNIEyGiA1spqKdRkVsDA3tXsfULwgJa5O2GCY7RbCSz/B24YLWVzY8t20ADIFmXf/kWKqlBFo9z/BThGzOSIg/BBgsbbOZ6P9CY/shPSM0352f0ramcKMv2CCkW1S0ZlKj+AWBwNp3kpQtqQwqffXhfFUvNfW9TI5EQ48TyRO75SITwaa6vryWsXfcqbbGDgidPW+tR2FX9EVLvvreg78C10RaU3OksEXpc+SP2wEsFCy9ilk2n6aC/gBRAOfYTd5EPvMkG9Q3xurMou/8KH0tABfkmwoaeczZU5pCr+c6RJcQBtj8FVuEwmiCdhrW3rAnBcx+/sfU6+kgJLQBc+Dtxpr2nYnGUqSFntzbodMB7oGz9L82dj1q5KdoIobOpqekYlyf4St7CUZDnGjEZFXPXwdonUOha3LYQTG4Kb+sLC+aul4xTRduSga1XFMV884a2HrXz0J27hSj3J3IY0vrMI3a+iMgpesu0GEDodRcHEsBj2E9c3PLNoIIN/NS/Dr7T+ugsvC/8YfQQPfXTLEl68UzpBTuCdvnK/d1x8LONoxuUx4T4wd1QhfiqzoSgK30BlieZsDAr0/n/7c1G6UGVBnsyCptzgBxmEXkIQ0FyguldRkfh/Cj0SWsdZtf7MMfDZzOFs41CdtPWbfbOWSD+5HXKJwwbVpzzp6rvU0ODtHNF3vSjOsAuW0ZET3e/dn5pUa7IZfrBdwA== X-OriginatorOrg: weidmueller.com X-MS-Exchange-CrossTenant-Network-Message-Id: b47cd157-7383-49e2-15b9-08db6e5dac3c X-MS-Exchange-CrossTenant-AuthSource: PAXPR08MB6969.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2023 11:34:40.5348 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e4289438-1c5f-4c95-a51a-ee553b8b18ec X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qUufuWX2YJz2fpiTL0eRXXvF5eh//ry3mMXn3Ur5y6PClk2RjROECXwfdKfaJpTCyiMdfsB57738rKvVQbFVSA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6444 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 From: Malte Schmidt Test updating U-Boot and the U-Boot environment with a single capsule. This test also checks that the mkeficapsule tool builds a capsule containing both images to update correctly. Testing of a signed and an unsigned image is implemented. Signed-off-by: Malte Schmidt Signed-off-by: Stefan Herbrechtsmeier --- test/py/tests/test_efi_capsule/conftest.py | 18 +++++++- .../test_capsule_firmware_raw.py | 46 ++++++++++++++++--- .../test_capsule_firmware_signed_raw.py | 24 ++++++++-- 3 files changed, 77 insertions(+), 11 deletions(-) diff --git a/test/py/tests/test_efi_capsule/conftest.py b/test/py/tests/test_efi_capsule/conftest.py index 054be1ee97..7acafb8599 100644 --- a/test/py/tests/test_efi_capsule/conftest.py +++ b/test/py/tests/test_efi_capsule/conftest.py @@ -124,6 +124,12 @@ def efi_capsule_data(request, u_boot_config): '--guid 3673B45D-6A7C-46F3-9E60-ADABB03F7937 uboot_bin_env.itb Test105' % (data_dir, u_boot_config.build_dir), shell=True) + check_call('cd %s; %s/tools/mkeficapsule --index 1,2 ' + '--guid 09D7CF52-0720-4710-91D1-08469B7FE9C8,5A7021F5-FEF2-48B4-AABA-832E777418C0 ' + '-b u-boot.bin.new,u-boot.env.new ' + 'Test106' % + (data_dir, u_boot_config.build_dir), + shell=True) if capsule_auth_enabled: # raw firmware signed with proper key @@ -205,7 +211,17 @@ def efi_capsule_data(request, u_boot_config): 'uboot_bin_env.itb Test115' % (data_dir, u_boot_config.build_dir), shell=True) - + # multiple raw firmwares with proper key + check_call('cd %s; %s/tools/mkeficapsule --index 1,2 ' + '--monotonic-count 1,2 ' + '--private-key SIGNER.key ' + '--certificate SIGNER.crt ' + '--fw-version 5,10 ' + '--guid 09D7CF52-0720-4710-91D1-08469B7FE9C8,5A7021F5-FEF2-48B4-AABA-832E777418C0 ' + '-b u-boot.bin.new,u-boot.env.new ' + 'Test116' + % (data_dir, u_boot_config.build_dir), + shell=True) # Create a disk image with EFI system partition check_call('virt-make-fs --partition=gpt --size=+1M --type=vfat %s %s' % (mnt_point, image_path), shell=True) diff --git a/test/py/tests/test_efi_capsule/test_capsule_firmware_raw.py b/test/py/tests/test_efi_capsule/test_capsule_firmware_raw.py index 80d791e3de..627b93b337 100644 --- a/test/py/tests/test_efi_capsule/test_capsule_firmware_raw.py +++ b/test/py/tests/test_efi_capsule/test_capsule_firmware_raw.py @@ -105,12 +105,27 @@ class TestEfiCapsuleFirmwareRaw: def test_efi_capsule_fw3( self, u_boot_config, u_boot_console, efi_capsule_data): """ Test Case 3 - Update U-Boot on SPI Flash, raw image format + Update U-Boot and U-Boot environment, raw image format, two separate capsules + 0x100000-0x150000: U-Boot binary (but dummy) + """ + self.efi_capsule_fw3_common(u_boot_config, u_boot_console, efi_capsule_data, "3", ['Test01', 'Test02']) + + def test_efi_capsule_fw3_multi( + self, u_boot_config, u_boot_console, efi_capsule_data): + """ Test Case 3-multi + Update U-Boot and U-Boot environment, raw image format, one capsule + 0x100000-0x150000: U-Boot binary (but dummy) + """ + self.efi_capsule_fw3_common(u_boot_config, u_boot_console, efi_capsule_data, "3-multi", ['TODO!']) + + def efi_capsule_fw3_common(self, u_boot_config, u_boot_console, efi_capsule_data, test_case_no, capsule_files): + """ Test Case + Update U-Boot and U-Boot environment, raw image format 0x100000-0x150000: U-Boot binary (but dummy) """ disk_img = efi_capsule_data - capsule_files = ['Test01', 'Test02'] - with u_boot_console.log.section('Test Case 3-a, before reboot'): + + with u_boot_console.log.section('Test Case %s-a, before reboot' % test_case_no): setup(u_boot_console, disk_img, '0x0000000000000004') init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old') init_content(u_boot_console, '150000', 'u-boot.env.old', 'Old') @@ -124,7 +139,7 @@ class TestEfiCapsuleFirmwareRaw: # reboot u_boot_console.restart_uboot(expect_reset = capsule_early) - with u_boot_console.log.section('Test Case 3-b, after reboot'): + with u_boot_console.log.section('Test Case %s-b, after reboot' % test_case_no): if not capsule_early: exec_manual_update(u_boot_console, disk_img, capsule_files) @@ -147,6 +162,7 @@ class TestEfiCapsuleFirmwareRaw: expected = 'u-boot-env:Old' if capsule_auth else 'u-boot-env:New' verify_content(u_boot_console, '150000', expected) + def test_efi_capsule_fw4( self, u_boot_config, u_boot_console, efi_capsule_data): """ Test Case 4 @@ -154,9 +170,25 @@ class TestEfiCapsuleFirmwareRaw: 0x100000-0x150000: U-Boot binary (but dummy) 0x150000-0x200000: U-Boot environment (but dummy) """ + self.efi_capsule_fw4_common(u_boot_config, u_boot_console, efi_capsule_data, '4', ['Test101', 'Test102']) + + def test_efi_capsule_fw4_multi( + self, u_boot_config, u_boot_console, efi_capsule_data): + """ Test Case 4-multi + Update U-Boot on SPI Flash, raw image format with fw_version and lowest_supported_version, one capsule + 0x100000-0x150000: U-Boot binary (but dummy) + 0x150000-0x200000: U-Boot environment (but dummy) + """ + self.efi_capsule_fw4_common(u_boot_config, u_boot_console, efi_capsule_data, '4-multi', ['Test106']) + + def efi_capsule_fw4_common(self, u_boot_config, u_boot_console, efi_capsule_data, test_case_no, capsule_files): + """ Test Case + Update U-Boot on SPI Flash, raw image format with fw_version and lowest_supported_version + 0x100000-0x150000: U-Boot binary (but dummy) + 0x150000-0x200000: U-Boot environment (but dummy) + """ disk_img = efi_capsule_data - capsule_files = ['Test101', 'Test102'] - with u_boot_console.log.section('Test Case 4-a, before reboot'): + with u_boot_console.log.section('Test Case %s-a, before reboot' % test_case_no): setup(u_boot_console, disk_img, '0x0000000000000004') init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old') init_content(u_boot_console, '150000', 'u-boot.env.old', 'Old') @@ -169,7 +201,7 @@ class TestEfiCapsuleFirmwareRaw: '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'): + with u_boot_console.log.section('Test Case %s-b, after reboot' % test_case_no): if not capsule_early: exec_manual_update(u_boot_console, disk_img, capsule_files) diff --git a/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py b/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py index ad2b1c6324..1624311f00 100644 --- a/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py +++ b/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py @@ -125,12 +125,30 @@ class TestEfiCapsuleFirmwareSignedRaw(): """Test Case 4 - Update U-Boot on SPI Flash, raw image format with version information 0x100000-0x150000: U-Boot binary (but dummy) + If the capsule is properly signed, the authentication + should pass and the firmware be updated. + """ + self.efi_capsule_auth4_common(u_boot_config, u_boot_console, efi_capsule_data, '4', ['Test111', 'Test112']) + + def test_efi_capsule_auth4_multi( + self, u_boot_config, u_boot_console, efi_capsule_data): + """Test Case 4-multi - Update U-Boot on SPI Flash, raw image format with version information, one capsule + 0x100000-0x150000: U-Boot binary (but dummy) + + If the capsule is properly signed, the authentication + should pass and the firmware be updated. + """ + self.efi_capsule_auth4_common(u_boot_config, u_boot_console, efi_capsule_data, '4-multi', ['Test116']) + + def efi_capsule_auth4_common(self, u_boot_config, u_boot_console, efi_capsule_data, test_case_no, capsule_files): + """Test Case - Update U-Boot on SPI Flash, raw image format with version information + 0x100000-0x150000: U-Boot binary (but dummy) + If the capsule is properly signed, the authentication should pass and the firmware be updated. """ disk_img = efi_capsule_data - capsule_files = ['Test111', 'Test112'] - with u_boot_console.log.section('Test Case 4-a, before reboot'): + with u_boot_console.log.section('Test Case %s-a, before reboot' % test_case_no): setup(u_boot_console, disk_img, '0x0000000000000004') init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old') place_capsule_file(u_boot_console, capsule_files) @@ -139,7 +157,7 @@ class TestEfiCapsuleFirmwareSignedRaw(): capsule_early = u_boot_config.buildconfig.get( 'config_efi_capsule_on_disk_early') - with u_boot_console.log.section('Test Case 4-b, after reboot'): + with u_boot_console.log.section('Test Case %s-b, after reboot' % test_case_no): if not capsule_early: exec_manual_update(u_boot_console, disk_img, capsule_files)