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 A547EC433F5 for ; Thu, 12 May 2022 07:10:54 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2C3AF84388; Thu, 12 May 2022 09:10:51 +0200 (CEST) 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="VUSoE8K7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9AA9C84371; Thu, 12 May 2022 09:10:48 +0200 (CEST) Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) (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 DA14384371 for ; Thu, 12 May 2022 09:10:44 +0200 (CEST) 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-x429.google.com with SMTP id 204so4015103pfx.3 for ; Thu, 12 May 2022 00:10:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=1HozRwwd7peTN9CrMVGPR+F6Jtt0mLMOO4itlsK/xI4=; b=VUSoE8K7S85XyR9RWDXaD7FIYv3nH6XBZmpwY4RLDEHdlg57+3o7Nf6KNZZiGASueY Br1cEOkULCjWdMZLM+EdttzNV6HyFk40fu/qY2H/H3a1DW9De5nlqoUW8v4LkTEdsj0/ 0mFQj2VeZJsCUWtkN1y6xwTuthJ3De7KVaxKgr738PIkVn96qcN5JcDkXYrJnzR4AH2J n4cIgfIJv0u1lQ61lMHwI/FXEGcRv7966DYJiNe8/GdSbXdIbhNu//FujAvhCa8o1xm8 JJmmDP7697b7vBkZjiFwfCaLnM/kHP+xTT0tIK32pXBgmYQHA1i/XgClClOkYeiIMQ90 ST+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=1HozRwwd7peTN9CrMVGPR+F6Jtt0mLMOO4itlsK/xI4=; b=H5W5MOlYfcLPpvlUU7qxUtZ0QPk7cokF70yQB+jxHYaLfoNHaraP8aqIcWgwxO4dcy 7vgFDMAXyDCjFDbZKQMtL8PBXZA6AAn5gfGXxMy0oq96SbL88/JgPMaLEVL8bsfjOmEX qHTInxeVwReCvDpGTHuAnsjUnh2Is0ink5a/Z3rMpcliJJMb2OThiaWR0iYMi3HE4Rz/ RnbH4g75M81fEG65sTzGBCG10zz6rgzfoxa3eQ5Kcd2P8+Xi1wpxFo53SVVPBthH+hh4 +K7D1Y9fbWj2H+52spaEJAmMh3BJ9IZlkfqzmqOBVznD1vS6TqKwgaLjIKTVMOgickwY EPGA== X-Gm-Message-State: AOAM531FetcsXeKk+63dkCF9IuG38u4PapdAUmvjowWeM892NQef3yt/ bRQH3l+gwEmA4RQtxvShzXSt2A== X-Google-Smtp-Source: ABdhPJxvo6K2pbVAnFhmnxmQB8aVfqhlJ3eIF1q4BCgem8/emlSSaG5uasStTPnO8vltdbbLtkL3DA== X-Received: by 2002:a05:6a00:298a:b0:50e:8e3:b673 with SMTP id cj10-20020a056a00298a00b0050e08e3b673mr28807113pfb.28.1652339443029; Thu, 12 May 2022 00:10:43 -0700 (PDT) Received: from laputa ([2400:4050:c3e1:100:f5e6:8e26:8fc:a1db]) by smtp.gmail.com with ESMTPSA id n23-20020aa78a57000000b00512c63bfaf0sm2051460pfa.62.2022.05.12.00.10.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 00:10:42 -0700 (PDT) Date: Thu, 12 May 2022 16:10:39 +0900 From: AKASHI Takahiro To: Heinrich Schuchardt Cc: mark.kettenis@xs4all.nl, u-boot@lists.denx.de Subject: Re: [PATCH v2 3/3] test: efi_bootmgr: add a test case for a short-form path Message-ID: <20220512071039.GA88188@laputa> Mail-Followup-To: AKASHI Takahiro , Heinrich Schuchardt , mark.kettenis@xs4all.nl, u-boot@lists.denx.de References: <20220512022903.65346-1-takahiro.akashi@linaro.org> <20220512022903.65346-4-takahiro.akashi@linaro.org> <01a85a9a-bf19-9f06-61c1-cef99f0b7f32@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <01a85a9a-bf19-9f06-61c1-cef99f0b7f32@gmx.de> 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 On Thu, May 12, 2022 at 09:02:36AM +0200, Heinrich Schuchardt wrote: > On 5/12/22 04:29, AKASHI Takahiro wrote: > > A short-form path starting with a file device path will be tested in > > a new test case. > > > > This type of short-form path will be created with "efidebug boot add -b", > > in particular, when a file system has no partition table. > > > > Signed-off-by: AKASHI Takahiro > > --- > > test/py/tests/test_efi_bootmgr/conftest.py | 25 +++++++++++++++++++ > > .../test_efi_bootmgr/test_efi_bootmgr.py | 25 +++++++++++++++++++ > > 2 files changed, 50 insertions(+) > > > > diff --git a/test/py/tests/test_efi_bootmgr/conftest.py b/test/py/tests/test_efi_bootmgr/conftest.py > > index a0a754afbe1b..5cd7252671fa 100644 > > --- a/test/py/tests/test_efi_bootmgr/conftest.py > > +++ b/test/py/tests/test_efi_bootmgr/conftest.py > > @@ -38,3 +38,28 @@ def efi_bootmgr_data(u_boot_config): > > shell=True) > > > > return image_path > > + > > +@pytest.fixture(scope='session') > > +def efi_bootmgr_data2(u_boot_config): > > + """Set up a file system without a partition table to be used > > + in UEFI bootmanager tests > > Why do you want a file system without partition table? This is nothing > the UEFI specification expects to support. As we discussed several times in the past, a partition table in the file system is not mandatory in U-Boot's UEFI subsystem. > Your test should cover having > a partition table and a device path which is file only. > > Best regards > > Heinrich > > > + > > + Args: > > + u_boot_config -- U-boot configuration. > > + > > + Return: > > + A path to disk image to be used for testing > > + """ > > + mnt_point = u_boot_config.persistent_data_dir + '/test_efi_bootmgr' > > + image_path = u_boot_config.persistent_data_dir + '/efi_bootmgr_data2.img' > > + > > + shutil.rmtree(mnt_point, ignore_errors=True) > > + os.mkdir(mnt_point, mode = 0o755) > > + > > + shutil.copyfile(u_boot_config.build_dir + '/lib/efi_loader/helloworld.efi', > > + mnt_point + '/helloworld.efi') > > + > > + check_call(f'virt-make-fs --size=+1M --type=vfat {mnt_point} {image_path}', > > + shell=True) > > + > > + return image_path > > diff --git a/test/py/tests/test_efi_bootmgr/test_efi_bootmgr.py b/test/py/tests/test_efi_bootmgr/test_efi_bootmgr.py > > index 75a6e7c96296..ab3d53a2dc95 100644 > > --- a/test/py/tests/test_efi_bootmgr/test_efi_bootmgr.py > > +++ b/test/py/tests/test_efi_bootmgr/test_efi_bootmgr.py > > @@ -41,3 +41,28 @@ def test_efi_bootmgr(u_boot_console, efi_bootmgr_data): > > > > u_boot_console.run_command(cmd = 'efidebug boot rm 0001') > > u_boot_console.run_command(cmd = 'efidebug boot rm 0002') > > + > > +@pytest.mark.boardspec('sandbox') > > +@pytest.mark.buildconfigspec('cmd_efidebug') > > +@pytest.mark.buildconfigspec('cmd_bootefi_bootmgr') > > +def test_efi_bootmgr_short(u_boot_console, efi_bootmgr_data2): > > + """ Unit test for UEFI bootmanager with a short-form path > > + In this test case, > > + - File system has no partition table > > + - UEFI load option has a short-form path starting with a file device path > > + > > + Args: > > + u_boot_console -- U-Boot console > > + efi_bootmgr_data2 -- Path to the disk image used for testing. > > + """ > > + u_boot_console.run_command(cmd = f'host bind 0 {efi_bootmgr_data2}') > > + > > + u_boot_console.run_command(cmd = 'efidebug boot add ' \ > > + '-b 0001 TEST2 host 0:0 helloworld.efi') > > This will not create a file only device path. So this does not test > patch 1 and 2. It does. See the output from "efidebug boot dump" in the log. > You could use setenv -e -i to create the boot option. > > Best regards > > Heinrich > > > + response = u_boot_console.run_command(cmd = 'efidebug boot dump') > > + assert 'file_path: /helloworld.efi' in response Furthermore, here is the check for a device path only with a file. -Takahiro Akashi > > + u_boot_console.run_command(cmd = 'efidebug boot next 0001') > > + response = u_boot_console.run_command(cmd = 'bootefi bootmgr') > > + assert 'Hello, world!' in response > > + > > + u_boot_console.run_command(cmd = 'efidebug boot rm 0001') >