From: Tom Rini <trini@konsulko.com>
To: Simon Glass <sjg@chromium.org>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
Bin Meng <bmeng.cn@gmail.com>
Subject: Re: [PATCH v2 28/28] test: Add a test for booting Ubuntu 24.04
Date: Thu, 20 Feb 2025 08:53:11 -0600 [thread overview]
Message-ID: <20250220145311.GY1233568@bill-the-cat> (raw)
In-Reply-To: <CAFLszTjmAeAFwajpB1ee85=8_AF3c2_ttm0Rj1wcMxN-OrXdeg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 10082 bytes --]
On Thu, Feb 20, 2025 at 06:49:49AM -0700, Simon Glass wrote:
> Hi Tom,
>
> On Tue, 18 Feb 2025 at 17:55, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Tue, Feb 18, 2025 at 05:01:40PM -0700, Simon Glass wrote:
> > > Hi Tom,
> > >
> > > On Tue, 18 Feb 2025 at 08:11, Tom Rini <trini@konsulko.com> wrote:
> > > >
> > > > On Tue, Feb 18, 2025 at 05:09:23AM -0700, Simon Glass wrote:
> > > > > Hi Tom,
> > > > >
> > > > > On Mon, 17 Feb 2025 at 10:52, Tom Rini <trini@konsulko.com> wrote:
> > > > > >
> > > > > > On Sun, Feb 16, 2025 at 01:44:13PM -0700, Simon Glass wrote:
> > > > > > > Now that U-Boot can boot this quickly, using kvm, add a test that the
> > > > > > > installer starts up correctly.
> > > > > > >
> > > > > > > Use the qemu-x86_64 board in the SJG lab.
> > > > > > >
> > > > > > > Signed-off-by: Simon Glass <sjg@chromium.org>
> > > > > > > ---
> > > > > > >
> > > > > > > Changes in v2:
> > > > > > > - Add more patches to support booting with kvm
> > > > > > > - Add new patch with a test for booting Ubuntu 24.04
> > > > > > >
> > > > > > > .gitlab-ci.yml | 5 ++++
> > > > > > > test/py/tests/test_distro.py | 53 ++++++++++++++++++++++++++++++++++++
> > > > > > > 2 files changed, 58 insertions(+)
> > > > > > > create mode 100644 test/py/tests/test_distro.py
> > > > > > >
> > > > > > > diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> > > > > > > index 8c49d5b0a79..ec799e97c10 100644
> > > > > > > --- a/.gitlab-ci.yml
> > > > > > > +++ b/.gitlab-ci.yml
> > > > > > > @@ -745,3 +745,8 @@ zybo:
> > > > > > > variables:
> > > > > > > ROLE: zybo
> > > > > > > <<: *lab_dfn
> > > > > > > +
> > > > > > > +qemu-x86_64:
> > > > > > > + variables:
> > > > > > > + ROLE: qemu-x86_64
> > > > > > > + <<: *lab_dfn
> > > > > >
> > > > > > I'm not sure why this is in your lab stanza, rather than the normal
> > > > > > test.py QEMU stanza.
> > > > >
> > > > > Are you wanting to add the Ubuntu image into CI? It is quite large.
> > > >
> > > > If we're going to be able to run it on N platforms, yes, we need to
> > > > think of a good way to cache the download. There's not a particular
> > > > reason we can't run the stock Ubuntu RISC-V image on the two sifive
> > > > targets and also qemu-riscv64, is there?
> > >
> > > Yes, we can do that. It is pretty simple to set up in Labgrid and it
> > > doesn't require all the runners to download a much larger image, etc.
> >
> > I don't quite understand why it's under "labgrid". These are generic CI
> > tests. Now maybe we need to, in both Gitlab and Azure, add some logic so
> > that certain longer or possibly destructive tests are only run on tagged
> > releases or as requested rather than every time, as it will take longer.
> > But pretty much every platform under the qemu target list should be able
> > to Just Boot an off the shelf OS distribution is my point.
>
> Sure, and I'm not suggesting we shouldn't do that as well.
>
> >
> > > > > > > diff --git a/test/py/tests/test_distro.py b/test/py/tests/test_distro.py
> > > > > > > new file mode 100644
> > > > > > > index 00000000000..51eec45cecc
> > > > > > > --- /dev/null
> > > > > > > +++ b/test/py/tests/test_distro.py
> > > > > > > @@ -0,0 +1,53 @@
> > > > > > > +# SPDX-License-Identifier: GPL-2.0+
> > > > > > > +# Copyright 2025 Canonical Ltd.
> > > > > > > +# Written by Simon Glass <simon.glass@canonical.com>
> > > > > > > +
> > > > > > > +import pytest
> > > > > > > +
> > > > > > > +DOWN = '\x1b\x5b\x42\x0d'
> > > > > > > +
> > > > > > > +# Enable early console so that the test can see if something goes wrong
> > > > > > > +CONSOLE = 'earlycon=uart8250,io,0x3f8 console=uart8250,io,0x3f8'
> > > > > > > +
> > > > > > > +@pytest.mark.boardspec('qemu-x86_64')
> > > > > > > +@pytest.mark.role('qemu-x86_64')
> > > > > > > +def test_distro(ubman):
> > > > > > > + """Test that of-platdata can be generated and used in sandbox"""
> > > > > > > + with ubman.log.section('boot'):
> > > > > > > + ubman.run_command('boot', wait_for_prompt=False)
> > > > > > > +
> > > > > > > + with ubman.log.section('Grub'):
> > > > > > > + # Wait for grub to come up and offset a menu
> > > > > > > + ubman.p.expect(['Try or Install Ubuntu'])
> > > > > > > +
> > > > > > > + # Press 'e' to edit the command line
> > > > > > > + ubman.run_command('e', wait_for_prompt=False, send_nl=False)
> > > > > > > +
> > > > > > > + # Wait until we see the editor appear
> > > > > > > + ubman.p.expect(['/casper/initrd'])
> > > > > > > +
> > > > > > > + # Go down to the 'linux' line
> > > > > > > + ubman.send(DOWN * 3)
> > > > > > > +
> > > > > > > + # Go to end of line
> > > > > > > + ubman.ctrl('E')
> > > > > > > +
> > > > > > > + # Backspace to remove 'quiet splash'
> > > > > > > + ubman.send('\b' * len('quiet splash'))
> > > > > > > +
> > > > > > > + # Send our noisy console
> > > > > > > + ubman.send(CONSOLE)
> > > > > > > +
> > > > > > > + # Tell grub to boot
> > > > > > > + ubman.ctrl('X')
> > > > > > > + ubman.p.expect(['Booting a command list'])
> > > > > > > +
> > > > > > > + with ubman.log.section('Linux'):
> > > > > > > + # Linux should start immediately
> > > > > > > + ubman.p.expect(['Linux version'])
> > > > > > > +
> > > > > > > + with ubman.log.section('Ubuntu'):
> > > > > > > + # Shortly later, we should see this banner
> > > > > > > + ubman.p.expect(['Welcome to .*Ubuntu 24.04.1 LTS.*!'])
> > > > > > > +
> > > > > > > + ubman.restart_uboot()
> > > > > >
> > > > > > And this seems very inflexible. Please see
> > > > > > test/py/tests/test_net_boot.py for an example of how to have this be
> > > > > > configurable and work on arbitrary platforms. What I assume is tricky is
> > > > > > that the "role" part here is where you have a special disk image being
> > > > > > passed. That too could be dealt with in u-boot-test-hooks in a few ways,
> > > > > > and the images pre-fetched to the CI container. And if this was
> > > > > > configurable similar to the example I noted above, it could check real
> > > > > > hardware too.
> > > > >
> > > > > That wasn't the reaction I expected.
> > > > >
> > > > > Yes, it is inflexible, but it is a starting point. Isn't it better
> > > > > than what we have today?
> > > >
> > > > Is your inflexible boot an OS test better than the flexible boot an OS
> > > > test that we have today? No, it's not.
> > >
> > > I didn't even know about it, or perhaps I forgot.
> >
> > I believe I mentioned it every time you've said we should have an OS
> > test, so yes, I guess you forgot.
>
> Well it was only added in May last year and it relies on board config
> which I don't have...although I see that you have now posted yours.
Yes, it was added not quite a year ago, and is documented within the
test, like most tests that rely on the real platform.
And do we need better documentation for test? Yes.
> > > Perhaps this relates to getting the labgrid config published and
> > > figuring out how to pass info from Labgrid to tests.
> > >
> > > >
> > > > > I would like to generalise this test to work on at least one real
> > > > > board, preferably one that doesn't use grub.
> > > >
> > > > OK. The test we have today does that, if you check for the "Welcome to
> > > > ..." string instead of the kernel has booted string. It also does
> > > > netboot rather than run default bootcmd. But that's an easy enough test
> > > > to write up. The only thing stopping me from doing that right now is I
> > > > need to find a board in the lab where we installed an OS to eMMC and not
> > > > SD card (some lab sd-mux issues).
> > >
> > > OK. Labgrid has a 'features' thing which you can attach to targets, so
> > > I should be able to use that to indicate that Ubuntu, Debian, Armbian,
> > > etc. are available.
> >
> > OK, but that sounds like the opposite direction. These are generic tests
> > that can run in any / all of the labs, not just your labgrid
> > configuration. AMD has been contributing tests that run on hardware for
> > example.
>
> That's great, the more tests we have the better. But those tests can't
> and don't run in CI, whereas mine can and do.
AFAICT they're running on AMD's CI. They run on my CI. They don't run on
*your* lab because you took things, intentionally, in a direction to
minimize using u-boot-test-hooks and our existing per-board
configuration infrastructure.
> We need an 'all of the above' strategy here.
Sure. But I still want to see things as reusable as possible. What you
have above is *extremely* board and OS specific and non-configurable. I
also don't quite see why it's not a test of autoboot with the
pre-requisite of an OS being installed.
> BTW, having thought about how test/py works a bit, instead of the
> env__net_tftp_bootable_file stuff, we should have code or data which
> sets up the required test files (on a suitable server) before running
> the test. That way, all the test code is in one Python file and we
> don't have to spend ages trying to divine what each test needs.
That seems like a lot more work than documenting more what we have
today, and I'm not sure of the benefit. Given the contents of the pxe
test, yes, just having those files available to 'cp' in place would be
helpful. But that's not the case for booting a kernel (the FIT match
stuff doesn't work on the TI platforms atm). And if you look at the
config I posted it also includes bootstage configuration. It also won't
work well for the SPI tests, which I'm talking with Love about in
another thread.
In other words, the majority of py/<host>/u_boot_boardenv_ content is
configuration details, specific to both the platform / SoC first, some
lab specific details second and drop-in existing 3rd party files a
distant third.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
next prev parent reply other threads:[~2025-02-20 14:53 UTC|newest]
Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-16 20:43 [PATCH v2 00/28] x86: Improve operation under QEMU Simon Glass
2025-02-16 20:43 ` [PATCH v2 01/28] x86: Expand x86_64 early memory Simon Glass
2025-02-16 20:43 ` [PATCH v2 02/28] x86: qemu: Switch to bochs display Simon Glass
2025-02-16 20:43 ` [PATCH v2 03/28] x86: qemu: Enable dhrystone Simon Glass
2025-02-16 20:43 ` [PATCH v2 04/28] x86: qemu: Avoid accessing BSS too early Simon Glass
2025-02-16 20:43 ` [PATCH v2 05/28] x86: Drop mpspec from the SPL build Simon Glass
2025-02-16 20:43 ` [PATCH v2 06/28] x86: Add some log categories Simon Glass
2025-02-16 20:43 ` [PATCH v2 07/28] x86: Drop use of CONFIG_REALMODE_DEBUG Simon Glass
2025-02-16 20:43 ` [PATCH v2 08/28] x86: Avoid clearing the VESA display Simon Glass
2025-02-16 20:43 ` [PATCH v2 09/28] x86: Add 64-bit entries to the GDT Simon Glass
2025-02-16 20:43 ` [PATCH v2 10/28] x86: Use defines for the cache flags Simon Glass
2025-02-16 20:43 ` [PATCH v2 11/28] x86: spl: Drop duplicate CPU init Simon Glass
2025-02-16 20:43 ` [PATCH v2 12/28] x86: Drop the message about features missing in 64-bit Simon Glass
2025-02-16 20:43 ` [PATCH v2 13/28] x86: Include stdbool.h in interrupt header Simon Glass
2025-02-16 20:43 ` [PATCH v2 14/28] x86: Tidy up the GDT size in start/16.S Simon Glass
2025-02-16 20:44 ` [PATCH v2 15/28] x86: Disable paging before changing to long mode Simon Glass
2025-02-16 20:44 ` [PATCH v2 16/28] x86: Use the same GDT when jumping " Simon Glass
2025-02-16 20:44 ` [PATCH v2 17/28] x86: Use a simple jump into " Simon Glass
2025-02-16 20:44 ` [PATCH v2 18/28] x86: Rename the _D dirty flag Simon Glass
2025-02-16 20:44 ` [PATCH v2 19/28] x86: Support CPU functions in long mode Simon Glass
2025-02-16 20:44 ` [PATCH v2 20/28] x86: Tidy up address size in MTRR calculations Simon Glass
2025-02-16 20:44 ` [PATCH v2 21/28] Add a 64-bit version of is_power_of_2() Simon Glass
2025-02-16 20:44 ` [PATCH v2 22/28] x86: Support MTRRs of 4GB on 32-bit machines Simon Glass
2025-02-16 20:44 ` [PATCH v2 23/28] x86: emulation: Set an MTRR for the RAM Simon Glass
2025-02-16 20:44 ` [PATCH v2 24/28] scripts: Expand a few options Simon Glass
2025-02-16 20:44 ` [PATCH v2 25/28] test/py: Add a helper to send characters Simon Glass
2025-02-16 20:44 ` [PATCH v2 26/28] test/py: Allow tests to be filtered by role Simon Glass
2025-02-17 17:48 ` Tom Rini
2025-02-18 12:09 ` Simon Glass
2025-02-18 15:12 ` Tom Rini
2025-02-19 0:04 ` Simon Glass
2025-02-19 0:25 ` Tom Rini
2025-02-19 0:39 ` Simon Glass
2025-02-19 0:50 ` Tom Rini
2025-02-21 13:57 ` Simon Glass
2025-02-16 20:44 ` [PATCH v2 27/28] RFC: test/py: Deal with timeouts Simon Glass
2025-02-17 17:45 ` Tom Rini
2025-03-14 14:45 ` Simon Glass
2025-02-16 20:44 ` [PATCH v2 28/28] test: Add a test for booting Ubuntu 24.04 Simon Glass
2025-02-17 17:52 ` Tom Rini
2025-02-18 12:09 ` Simon Glass
2025-02-18 15:11 ` Tom Rini
2025-02-19 0:01 ` Simon Glass
2025-02-19 0:55 ` Tom Rini
2025-02-20 13:49 ` Simon Glass
2025-02-20 14:53 ` Tom Rini [this message]
2025-02-21 13:57 ` Simon Glass
2025-02-21 16:06 ` Tom Rini
2025-02-22 8:27 ` Heiko Schocher
2025-02-22 13:47 ` Heiko Schocher
2025-02-24 17:54 ` Simon Glass
2025-02-25 13:59 ` Tom Rini
2025-02-26 2:56 ` Simon Glass
2025-02-26 14:35 ` Tom Rini
2025-02-27 10:11 ` Heiko Schocher
2025-02-27 15:26 ` Tom Rini
2025-02-27 16:27 ` Simon Glass
2025-02-27 17:20 ` Tom Rini
2025-02-27 19:26 ` Simon Glass
2025-02-27 20:15 ` Tom Rini
2025-02-28 5:26 ` Heiko Schocher
2025-03-06 14:16 ` Simon Glass
2025-03-06 14:32 ` Tom Rini
2025-03-06 16:11 ` Simon Glass
2025-03-06 16:43 ` Tom Rini
2025-03-06 23:31 ` Simon Glass
2025-03-07 15:34 ` Tom Rini
2025-02-16 21:13 ` [PATCH v2 00/28] x86: Improve operation under QEMU Paolo Bonzini
2025-02-17 13:16 ` Simon Glass
2025-02-16 21:57 ` Tom Rini
2025-02-17 13:14 ` Simon Glass
2025-02-17 14:05 ` Tom Rini
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=20250220145311.GY1233568@bill-the-cat \
--to=trini@konsulko.com \
--cc=bmeng.cn@gmail.com \
--cc=sjg@chromium.org \
--cc=u-boot@lists.denx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.