Normally the job itself controls which tests are run, by providing an
optional test spec and using the -k option.
It is sometimes useful to run a subset of tests on CI. Add a new
TEST_SPEC variable to control this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Provide some additional variables which can be used to deselect whole
stages, or select a particular test.py build.
Signed-off-by: Simon Glass <sjg@chromium.org>
The rules are enough to handle the results logic. Drop the redundant
checks at the start of the bash script.
Signed-off-by: Simon Glass <sjg@chromium.org>
We use 'testsuites' for the test suites and 'world build' for the world
build. This is inconsistent. Use 'test_suites' and 'word_build' instead,
to avoid confusion.
Signed-off-by: Simon Glass <sjg@chromium.org>
This is not correct when building a kernel FIT, since it adds a second
loadable in addition to the kernel.
There may in fact be a bug in SPL FIT, in which case that should be
fixed, rather than adding an invalid loadable to the FIT.
This reverts commit cabde449b9.
Series-to: concept
Series-cc: heinrich
Cover-letter:
mkimage: Start to tidy up mkimage and friends
The current mkimage code is a bit messy:
- the main() function is very long
- two similarly named structs are used throughout: the first
(struct image_tool_params) is not actually just parameters, the second
(struct image_type_params) is confusingly similar
- quite a bit of FIT processing happens right at the start of main(),
which can be hard to follow
- the program calls exit() from many different places
This series renames the main structures, avoiding using the common
'params' word. It breaks up part of main() into separate functions and
starts the process of exiting in one place.
It also reverts a patch which causes an invalid 'loadables' property to
be added with '-f auto'.
More remains to be done, but this is a start.
END
For listing an image, or processing an existing FIT, an initial code
path is used, then the program exits.
Move this into its own function so it is clear that this is an
early-return path.
Signed-off-by: Simon Glass <sjg@chromium.org>
The run_mkimage() function is long and complicated. Make a start by
moving some initial checks out into their own check_params() function.
Also move the FIT-processing into a new process_fit() function.
Signed-off-by: Simon Glass <sjg@chromium.org>
Rather than exiting in copy_file() and copy_datafile(), return an exit
code. The caller is then responsible for returning it, so update it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Rather than exiting in this function, return an exit code. The caller is
then responsible for returning it, so update it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Pass this pointer in rather than using the global. Update
copy_data_file() too since it calls copy_file()
Signed-off-by: Simon Glass <sjg@chromium.org>
Update usage(), process_args() and run_mkimage() to pass the image-tool
info around, so we can eventually drop the global.
Signed-off-by: Simon Glass <sjg@chromium.org>
Use the same 'itl' (for image-tool) whenever this parameter is passed
around. This makes it easier to recognise. Move away from using the word
'parameters', since it contains essentially all of the info about the
tool, not just parameters. Use 'info' instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
The existing name is confusing since it includes state as well as
parameters. In fact it includes nearly everything known about the tool
while it is running. Rename the struct to imgtool to reflect this.
Signed-off-by: Simon Glass <sjg@chromium.org>
The current name is quite confusing. Mostly this struct holds function
pointers, not parameters. Rename it to imgtool_funcs, so that is has the
same prefix as imgtool (introduced in the next patch) and it is clear
that it provides functions.
Signed-off-by: Simon Glass <sjg@chromium.org>
Rather than exiting in this function, return an exit code. The caller is
then responsible for returning it, so update all the callers to return
the value.
Signed-off-by: Simon Glass <sjg@chromium.org>
Rather than exiting in the middle of the function, return the exit code
to main() so it can return it, in turn.
Signed-off-by: Simon Glass <sjg@chromium.org>
Create a new run_mkimage() function which will hold the top-level logic
for mkimage.
For the few cases where there is a 'return', use that as the exit code
of the problem, preserving existing behaviour.
Signed-off-by: Simon Glass <sjg@chromium.org>
It is confusing to have the main program in the moddle of the mkimage.c
file. Move copy_file() higher, so that main() is at the bottom.
Drop the now-unnecessary forward declaration.
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>
The devicetree file may not be provided, so avoid a failure in that
case.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
The prep_mmc_bootdev() function replaces bootstd's bootdev_order with
its own static version, then returns it.
From then on std->bootdev_order cannot be freed, since it was not
allocated.
So long as the test passes, all is well. But if a test fails, the test
system will try to free std->bootdev_order and this will fail.
Adjust prep_mmc_bootdev() to allocate the boot_dev order, instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
There is no harm in always having this device enabled, thus reducing the
number of script arguments. Enable RNG always.
Series-to: concept
Series-version: 2
Series-changes: 2
- Use /dev/urandom instead, dropping the now-unnecessary arguments
Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
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>
Provide a way to create disk images which consist of multiple filesystem
images.
Provide an option to use the current directory for images, instead of
persistent-data directory. This makes it easy for C tests to locate the
image.
Signed-off-by: Simon Glass <sjg@chromium.org>
It is somewhat inconvenient that callers to mk_fs() must create their
own temporary directory. Convert it to a class so this can be handled
automatically, using a context manager.
Rather than specifying the file size in bytes, use MB since it is rare
to need a smaller file.
Update mk_fs() to use this new class.
Signed-off-by: Simon Glass <sjg@chromium.org>
Nothing uses this argument, so make it a constant for now.
Also fix a pylint warning when checking for vfat/exfat.
Signed-off-by: Simon Glass <sjg@chromium.org>
Check that we can read a FIT containing a devicetree, then boot with a
second FIT.
This requires a few more FIT parameters and commands to be configurable.
Series-to: concept
Series-cc: heinrich
Cover-letter:
Support FITs with load-only configs
FIT is growing a new feature where a load-only configuration can be used
to obtain and set up a devicetree prior to loading the OS.
This series implements this feature in U-Boot.
Some refactoring is necessary to permit this, on top of a previous
series. Also the FIT tests have the annoying property that they all run
at once, so this series also adjusts these.
Further work will integrate this properly into a bootmeth, etc.
END
Signed-off-by: Simon Glass <sjg@chromium.org>
Normally bootm proceeds sequentially through the various states, from
'start' to 'go'.
In some cases we want to load the devicetree from one FIT and the kernel
and ramdisk from another. This requires two bootm commands.
Of course it is possible to just do a second 'bootm start' to load the
kernel. But that removes all record of the devicetree from the
boot_images information, so it is then not provided to the OS.
Add a 'restart' subcommand which allows more images to be loaded,
without erasing those already loaded.