Add two new MMC test devices:
- mmc13: LUKS2 encrypted with TKey-derived key, for testing TKey-based
disk encryption unlock
- mmc14: LUKS2 encrypted with a known master key, for testing the
pre-derived master key unlock path
The test setup generates keys matching the TKey emulator's deterministic
output. An override.bin file can be used to test with a physical TKey.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Add a new mmc12 image which has a LUKS2-encrypted ext4 partition.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Move setup_localboot_image() to a new module
Series-to: concept
Cover-letter:
test: Split up the image-creation code
This series moves the image-creation code into separate files so it is
easier to find and maintain.
END
Signed-off-by: Simon Glass <sjg@chromium.org>
Co-authored-by: Claude <noreply@anthropic.com>
Move setup_cros_image() to its own module. This function creates disk
images with a ChromiumOS partition layout.
Signed-off-by: Simon Glass <sjg@chromium.org>
Co-authored-by: Claude <noreply@anthropic.com>
Move setup_bootmenu_image() to its own module. This function creates an
image styled on Armbian 22.08 Jammy with a boot menu.
Co-authored-by: Claude <noreply@anthropic.com>
Move mkdir_cond(), copy_partition(), and setup_extlinux_image() to a
common module which can be used by the rest of the image-creation code.
Signed-off-by: Simon Glass <sjg@chromium.org>
Co-authored-by: Claude <noreply@anthropic.com>
Pass in the two fixtures this function actually requires, rather than
ubman, which is a function-scoped fixture.
Series-to: concept
Cover-letter:
test: Move towards using a fixture for test images
There are quite a few test images created by the test system. Most are
needed for bootstd tests.
At present these are created by a test, called test_ut_dm_init_bootstd()
which runs before the test_ut() tests.
This means that it is possible to create the images once, then iterate
on a test without the images being recreated each time.
While this is not a terrible approach, it does have some drawbacks:
- If an image is missing or corrupted for some reason, the test fails
- The relationship between the images and the tests is not obvious
- Images are often created even if the tests to be run do not need them
Overall, it seems worthwhile to explore moving to using a fixture for
the images.
Another problem is that 'make qcheck' and 'make pcheck' are not tested
in CI, so can break over time. The latter is a good way of seeing
whether each test is independent, e.g. not reliant on files created by
another test.
Overall this area of U-Boot could use some attention. This series makes
a very small start on this:
- Update test_fdt_add_pubkey() to work without test_vboot_base()
- Fix 'make qcheck' so that it passes
- Minor fixes to a few tests
- Pass separate fixtures to the image-setup functions instead of the
overall ubman fixture
END
Signed-off-by: Simon Glass <sjg@chromium.org>
Pass in the two fixtures this function actually requires, rather than
ubman, which is a function-scoped fixture.
Signed-off-by: Simon Glass <sjg@chromium.org>
Pass in the two fixtures this function actually requires, rather than
ubman, which is a function-scoped fixture.
Signed-off-by: Simon Glass <sjg@chromium.org>
Pass in the two fixtures this function actually requires, rather than
ubman, which is a function-scoped fixture.
Signed-off-by: Simon Glass <sjg@chromium.org>
Pass in the two fixtures this function actually requires, rather than
ubman, which is a function-scoped fixture.
Signed-off-by: Simon Glass <sjg@chromium.org>
Pass in the two fixtures this function actually requires, rather than
ubman, which is a function-scoped fixture.
Signed-off-by: Simon Glass <sjg@chromium.org>
Pass in the two fixtures this function actually requires, rather than
ubman, which is a function-scoped fixture.
Signed-off-by: Simon Glass <sjg@chromium.org>
Pass in the two fixtures this function actually requires, rather than
ubman, which is a function-scoped fixture.
Signed-off-by: Simon Glass <sjg@chromium.org>
Pass in the two fixtures this function actually requires, rather than
ubman, which is a function-scoped fixture.
Signed-off-by: Simon Glass <sjg@chromium.org>
Pass in the two fixtures this function actually requires, rather than
ubman, which is a function-scoped fixture.
Signed-off-by: Simon Glass <sjg@chromium.org>
Pass in the two fixtures this function actually requires, rather than
ubman, which is a function-scoped fixture.
Signed-off-by: Simon Glass <sjg@chromium.org>
Create two new images (vbe0 and vbe1) containing the two types of VBE-OS
setups: with and without an OEM FIT. Put this in a new img/ subdirectory
since the test_ut.py file is getting quite large.
Most of the test is in C, with just the image-setup done in Python.
Enable the test for non-SPL sandbox builds.
Signed-off-by: Simon Glass <sjg@chromium.org>
Create two new images (vbe0 and vbe1) containing the two types of VBE-OS
setups: with and without an OEM FIT. Put this in a new img/ subdirectory
since the test_ut.py file is getting quite large.
Most of the test is in C, with just the image-setup done in Python.
Signed-off-by: Simon Glass <sjg@chromium.org>
This shows a message for the user. Implement it to keep the user
informed.
Series-to: u-boot
pxe: Support an automatic localboot
It seems that extlinux expects that boards know how to boot a local OS
from attached media. U-Boot currently assumes that boards define a
"localcmd" environment variable to support this. None does.
Provide an automatic means to find a kernel and ramdisk, using common
filenames. This addresses booting on MAAS, at least.
END
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
The current localboot implementation assumes that a 'localcmd'
environment variable is provided, with the instructions to follow. This
may not be included, so provide a fallback in that case.
Add a test image and test as well.
Signed-off-by: Simon Glass <sjg@chromium.org>
Use the helper here, for consistency.
Series-to: concept, heinrich
Cover-letter:
test: Create a better helper for filesystems
This series includes a few new helpers which make it easier to create
filesystems and disk images for testing.
The current approach requires the caller to create a temporary
directory, put files in there, then call the helper. It has poor support
for building disks containing multiple partitions.
This new helper works by creating a temporary directory which the caller
can use, then creating the filesystem and cleaning up.
Most of U-Boot is moved over to use these new helpers, but two EFI tests
are left alone, since they don't currently pass:
- test_efi_eficonfig() has a 'return' in it, so doesn't run
- TestEfiCapsuleFirmwareFit is skipped due to a failure at the start
These can be moved over later when they are working.
This series also includes a few quirks to the VBE tests.
END
Signed-off-by: Simon Glass <sjg@chromium.org>
Add an extlinux configuration-file that contains a few entries as
created by the u-boot-menu package in Ubuntu 24.04
Increase the number of sandbox-USB-hub ports to permit this.
Signed-off-by: Simon Glass <sjg@chromium.org>
To permit easier adding of other images, move the Fedora-specific
portions of setup_bootflow_image() into a separate function.
Signed-off-by: Simon Glass <sjg@chromium.org>
The generic function in test_ut.py to create a disk image with partition
table can be useful outside of test_ut.py so move it to be available
more clearly.
To make this a bit more easily used library function, make use of
check_call directly rather than calling things though u_boot_utils. In
turn, to more easily handle stdin here, use the shell "printf" utility
to pass sfdisk the specification to create as we do not have an actual
file descriptor to use here.
Signed-off-by: Tom Rini <trini@konsulko.com>
At present the disks end up being 1MB shorter than they should be,
since dd truncates by default.
Move the code into a function and update it to avoid truncation.
This resolves various warnings when running sandbox tests, of the form:
mmc_bread() MMC: block number 0x9801 exceeds max(0x9800)
caused by the FAT partition being scanning.
Signed-off-by: Simon Glass <sjg@chromium.org>
We know this is U-Boot so the prefix serves no purpose other than to
make things longer and harder to read. Drop it and rename the files.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # test_android / test_dfu
This fixture name is quite long and results in lots of verbose code.
We know this is U-Boot so the 'u_boot_' part is not necessary.
But it is also a bit of a misnomer, since it provides access to all the
information available to tests. It is not just the console.
It would be too confusing to use con as it would be confused with
config and it is probably too short.
So shorten it to 'ubman'.
Signed-off-by: Simon Glass <sjg@chromium.org>
Link: https://lore.kernel.org/u-boot/CAFLszTgPa4aT_J9h9pqeTtLCVn4x2JvLWRcWRD8NaN3uoSAtyA@mail.gmail.com/
Add a function to show the stats, so we can decide when to print it.
This slightly adjusts the output, so that any 'test not found' message
appears on its own line after all other output.
The 'failures' message now appears in lower case so update pytest
accordingly.
Signed-off-by: Simon Glass <sjg@chromium.org>
We don't need the fallback anymore. Remove the code which uses these
files.
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Richard Weinberger <richard@nod.at>
We don't need the fallback anymore. As a first step to removing it,
drop the try...except clauses and unindent the code.
This produces a large diff but there are no other code changes.
Signed-off-by: Simon Glass <sjg@chromium.org>
Like for test_fs, no need to mess with loop mounts.
Tweaks to reduce diff (keep mnt variable):
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Simon Glass <sjg@chromium.org>
Add a parameter to indicate the size of the image to build.
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Richard Weinberger <richard@nod.at>
There is no need to mount the filesystem on the host side.
All filesystem tools offer some way to fill the fs without mounting.
So, create the content on the host side, create and fill the fs
without mounting.
No more sudo or guestmount needed.
This new approach works because the tests don't care about user IDs
and no device files are needed.
If user IDs start to matter it's still possible to use wrapper
tools like fakeroot in future while filling the fs.
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Add a new 'bootstd images' command, which lists the images which have
been loaded.
Update some existing tests to use it. Provide some documentation about
images in general and this command in particular.
Use a more realistic kernel command-line to make the test easier to
follow.
Signed-off-by: Simon Glass <sjg@chromium.org>