public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Simon Glass <sjg@chromium.org>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	U-Boot Mailing List <u-boot@lists.denx.de>
Subject: Re: [PATCH v5 13/14] test: efi: boot: Set up an image suitable for EFI testing
Date: Mon, 16 Sep 2024 10:34:53 -0600	[thread overview]
Message-ID: <20240916163453.GH4252@bill-the-cat> (raw)
In-Reply-To: <CAFLszThVnydvrV_vPmsWPPZOV1Dc6wzDbw2jV5ywLj-XA3J5Pg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 11206 bytes --]

On Mon, Sep 16, 2024 at 05:42:42PM +0200, Simon Glass wrote:
> Hi Heinrich,
> 
> On Thu, 12 Sept 2024 at 09:09, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> >
> > On 02.09.24 03:18, Simon Glass wrote:
> > > Create a new disk for use with tests, which contains the new 'testapp'
> > > EFI app specifically intended for testing the EFI loader.
> > >
> > > Attach it to the USB device, since most testing is currently done with
> > > mmc.
> > >
> > > Initially this image will be used to test the EFI bootmeth.
> > >
> > > Fix a stale comment in prep_mmc_bootdev() while we are here.
> > >
> > > Signed-off-by: Simon Glass <sjg@chromium.org>
> > > ---
> > >
> > > (no changes since v1)
> > >
> > >   arch/sandbox/dts/test.dts           |   2 +-
> > >   test/boot/bootdev.c                 |  18 +++++++++-
> > >   test/boot/bootflow.c                |   2 +-
> > >   test/py/tests/bootstd/flash1.img.xz | Bin 0 -> 5016 bytes
> > >   test/py/tests/test_ut.py            |  52 ++++++++++++++++++++++++----
> > >   5 files changed, 65 insertions(+), 9 deletions(-)
> > >   create mode 100644 test/py/tests/bootstd/flash1.img.xz
> > >
> > > diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
> > > index 5fb5eac862e..a99de6e62ce 100644
> > > --- a/arch/sandbox/dts/test.dts
> > > +++ b/arch/sandbox/dts/test.dts
> > > @@ -1507,7 +1507,7 @@
> > >                               flash-stick@1 {
> > >                                       reg = <1>;
> > >                                       compatible = "sandbox,usb-flash";
> > > -                                     sandbox,filepath = "testflash1.bin";
> > > +                                     sandbox,filepath = "flash1.img";
> > >                               };
> > >
> > >                               flash-stick@2 {
> > > diff --git a/test/boot/bootdev.c b/test/boot/bootdev.c
> > > index c635d06ec25..269bcd693a6 100644
> > > --- a/test/boot/bootdev.c
> > > +++ b/test/boot/bootdev.c
> > > @@ -212,6 +212,10 @@ static int bootdev_test_order(struct unit_test_state *uts)
> > >       /* Use the environment variable to override it */
> > >       ut_assertok(env_set("boot_targets", "mmc1 mmc2 usb"));
> > >       ut_assertok(bootflow_scan_first(NULL, NULL, &iter, 0, &bflow));
> > > +
> > > +     /* get the usb device which has a backing file (flash1.img) */
> > > +     ut_asserteq(0, bootflow_scan_next(&iter, &bflow));
> > > +
> > >       ut_asserteq(-ENODEV, bootflow_scan_next(&iter, &bflow));
> > >       ut_asserteq(5, iter.num_devs);
> > >       ut_asserteq_str("mmc1.bootdev", iter.dev_used[0]->name);
> > > @@ -251,7 +255,11 @@ static int bootdev_test_order(struct unit_test_state *uts)
> > >       ut_assertok(bootflow_scan_first(NULL, NULL, &iter, 0, &bflow));
> > >       ut_asserteq(2, iter.num_devs);
> > >
> > > -     /* Now scan past mmc1 and make sure that the 3 USB devices show up */
> > > +     /*
> > > +      * Now scan past mmc1 and make sure that the 3 USB devices show up. The
> > > +      * first one has a backing file so returns success
> > > +      */
> > > +     ut_asserteq(0, bootflow_scan_next(&iter, &bflow));
> > >       ut_asserteq(-ENODEV, bootflow_scan_next(&iter, &bflow));
> > >       ut_asserteq(6, iter.num_devs);
> > >       ut_asserteq_str("mmc2.bootdev", iter.dev_used[0]->name);
> > > @@ -313,6 +321,10 @@ static int bootdev_test_prio(struct unit_test_state *uts)
> > >
> > >       /* 3 MMC and 3 USB bootdevs: MMC should come before USB */
> > >       ut_assertok(bootflow_scan_first(NULL, NULL, &iter, 0, &bflow));
> > > +
> > > +     /* get the usb device which has a backing file (flash1.img) */
> > > +     ut_asserteq(0, bootflow_scan_next(&iter, &bflow));
> > > +
> > >       ut_asserteq(-ENODEV, bootflow_scan_next(&iter, &bflow));
> > >       ut_asserteq(6, iter.num_devs);
> > >       ut_asserteq_str("mmc2.bootdev", iter.dev_used[0]->name);
> > > @@ -330,6 +342,10 @@ static int bootdev_test_prio(struct unit_test_state *uts)
> > >       bootflow_iter_uninit(&iter);
> > >       ut_assertok(bootflow_scan_first(NULL, NULL, &iter, BOOTFLOWIF_HUNT,
> > >                                       &bflow));
> > > +
> > > +     /* get the usb device which has a backing file (flash1.img) */
> > > +     ut_asserteq(0, bootflow_scan_next(&iter, &bflow));
> > > +
> > >       ut_asserteq(-ENODEV, bootflow_scan_next(&iter, &bflow));
> > >       ut_asserteq(7, iter.num_devs);
> > >       ut_asserteq_str("usb_mass_storage.lun0.bootdev",
> > > diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c
> > > index da55d5cfe69..37884dbd441 100644
> > > --- a/test/boot/bootflow.c
> > > +++ b/test/boot/bootflow.c
> > > @@ -525,7 +525,7 @@ static int prep_mmc_bootdev(struct unit_test_state *uts, const char *mmc_dev,
> > >
> > >       order[2] = mmc_dev;
> > >
> > > -     /* Enable the mmc4 node since we need a second bootflow */
> > > +     /* Enable the requested mmc node since we need a second bootflow */
> > >       root = oftree_root(oftree_default());
> > >       node = ofnode_find_subnode(root, mmc_dev);
> > >       ut_assert(ofnode_valid(node));
> > > diff --git a/test/py/tests/bootstd/flash1.img.xz b/test/py/tests/bootstd/flash1.img.xz
> > > new file mode 100644
> > > index 0000000000000000000000000000000000000000..9148b91a20c1f0acb54449b124d1408961e92507
> > > GIT binary patch
> > > literal 5016
> > > zcmeI0cTf{r8pRVz9+4n5AV?_EgQ1BO;n5K(kx-;pUwkwL0tBUqlz==yF+ikBDAExL
> > > zQWT{~2Sq?y06~gW5eP+U$nMPkwKMCEzIn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1r%Sk4yV+%E8c2*ol{zZAGEORz}_=pJYbILT?~9
> > > zx@Ww_ZY!Phs9}DZ;|(-K7u0?|<x*!^Q((Pp0U@L0j5%*kym>tedsc3u1!ajplM14D
> > > z?)FvVYF1EAD}VwEmh!>y)l!<B_<wT8$jHNU{OnXe*r~#qv;d5N2DZJiLI6N8ou4Vd
> > > g!6FL)+!7BD4?iLFVyT<d=5|Q;_y0ElgRR})0MlW=WB>pF
> > >
> > > literal 0
> > > HcmV?d00001
> >
> > This reminds me of the xy hack. We should not add binary files. Please,
> > create it on the fly.
> 
> All the other tests work the same way.
> 
> >
> > >
> > > diff --git a/test/py/tests/test_ut.py b/test/py/tests/test_ut.py
> > > index 39aa1035e34..f647e2f0af2 100644
> > > --- a/test/py/tests/test_ut.py
> > > +++ b/test/py/tests/test_ut.py
> > > @@ -28,21 +28,22 @@ def mkdir_cond(dirname):
> > >       if not os.path.exists(dirname):
> > >           os.mkdir(dirname)
> > >
> > > -def setup_image(cons, mmc_dev, part_type, second_part=False):
> > > +def setup_image(cons, devnum, part_type, second_part=False, basename='mmc'):
> > >       """Create a 20MB disk image with a single partition
> > >
> > >       Args:
> > >           cons (ConsoleBase): Console to use
> > > -        mmc_dev (int): MMC device number to use, e.g. 1
> > > +        devnum (int): Device number to use, e.g. 1
> > >           part_type (int): Partition type, e.g. 0xc for FAT32
> > >           second_part (bool): True to contain a small second partition
> > > +        basename (str): Base name to use in the filename, e.g. 'mmc'
> > >
> > >       Returns:
> > >           tuple:
> > >               str: Filename of MMC image
> > >               str: Directory name of 'mnt' directory
> > >       """
> > > -    fname = os.path.join(cons.config.source_dir, f'mmc{mmc_dev}.img')
> > > +    fname = os.path.join(cons.config.source_dir, f'{basename}{devnum}.img')
> > >       mnt = os.path.join(cons.config.persistent_data_dir, 'mnt')
> > >       mkdir_cond(mnt)
> > >
> > > @@ -78,16 +79,17 @@ def mount_image(cons, fname, mnt, fstype):
> > >       u_boot_utils.run_and_log(cons, f'sudo chown {getpass.getuser()} {mnt}')
> >
> > Please, do not use sudo in tests.
> 
> All the other test setup uses sudo, as do the fs-tests

We're actively removing the use of sudo in the fs-tests, as noted in
previous iterations of this series (I believe it was this series) and
asked that you rebase this part at least on top of that series or wait
for it to be merged.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  reply	other threads:[~2024-09-16 16:35 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-02  1:18 [PATCH v5 00/14] efi: Add a test for EFI bootmeth Simon Glass
2024-09-02  1:18 ` [PATCH v5 01/14] efi_loader: Use puts() in cout so that console recording works Simon Glass
2024-09-02  1:18 ` [PATCH v5 02/14] efi_loader: Put back copyright message Simon Glass
2024-09-02  1:18 ` [PATCH v5 03/14] efi_loader: Rename and move CMD_BOOTEFI_HELLO_COMPILE Simon Glass
2024-09-02  1:18 ` [PATCH v5 04/14] efi: arm: x86: riscv: Drop crt0/relocal extra- rules Simon Glass
2024-09-02  1:18 ` [PATCH v5 05/14] efi_loader: Shorten the app rules Simon Glass
2024-09-02  1:18 ` [PATCH v5 06/14] efi_loader: Shorten the app rules further Simon Glass
2024-09-02  1:18 ` [PATCH v5 07/14] efi_loader: Show the vendor in helloworld Simon Glass
2024-09-02  1:18 ` [PATCH v5 08/14] efi: Use the same filename for all sandbox builds Simon Glass
2024-09-12 14:03   ` Heinrich Schuchardt
2024-09-16 15:41     ` Simon Glass
2024-09-02  1:18 ` [PATCH v5 09/14] bootstd: Add debugging for efi bootmeth Simon Glass
2024-09-12 15:28   ` Heinrich Schuchardt
2024-09-02  1:18 ` [PATCH v5 10/14] efi_loader: Disable ANSI output for tests Simon Glass
2024-09-12 14:45   ` Heinrich Schuchardt
2024-09-16 15:42     ` Simon Glass
2024-09-16 16:33       ` Tom Rini
2024-09-17  3:54         ` Simon Glass
2024-09-17 16:59           ` Tom Rini
2024-09-19 14:14             ` Simon Glass
2024-09-02  1:18 ` [PATCH v5 11/14] efi_loader: Add a test app Simon Glass
2024-09-12 14:48   ` Heinrich Schuchardt
2024-09-16 15:41     ` Simon Glass
2024-09-02  1:18 ` [PATCH v5 12/14] efi_loader: Avoid using sandbox virtio devices Simon Glass
2024-09-12 15:00   ` Heinrich Schuchardt
2024-09-16 15:42     ` Simon Glass
2024-09-17 17:03       ` Tom Rini
2024-09-19 14:10         ` Simon Glass
2024-09-19 17:45           ` Tom Rini
2024-09-20  7:25             ` Simon Glass
2024-09-20 14:59               ` Tom Rini
2024-09-25 12:52                 ` Simon Glass
2024-09-25 17:26                   ` Tom Rini
2024-09-26 21:34                     ` Simon Glass
2024-09-02  1:18 ` [PATCH v5 13/14] test: efi: boot: Set up an image suitable for EFI testing Simon Glass
2024-09-12 15:04   ` Heinrich Schuchardt
2024-09-16 15:42     ` Simon Glass
2024-09-16 16:34       ` Tom Rini [this message]
2024-09-17  3:52         ` Simon Glass
2024-09-17 22:19           ` Tom Rini
2024-09-19 14:13             ` Simon Glass
2024-09-25 17:26               ` Tom Rini
2024-09-02  1:18 ` [PATCH v5 14/14] test: efi: boot: Add a test for the efi bootmeth Simon Glass
2024-09-12 15:07   ` Heinrich Schuchardt
2024-09-16 15:42     ` Simon Glass
2024-09-12  1:01 ` [PATCH v5 00/14] efi: Add a test for EFI bootmeth Simon Glass
2024-09-12  7:02   ` Ilias Apalodimas
2024-09-13 13:50 ` Heinrich Schuchardt
2024-09-19 14:13   ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240916163453.GH4252@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox