[PATCH 00/26] test: spl: Test some load methods

Simon Glass sjg at chromium.org
Thu Oct 12 05:41:31 CEST 2023


Hi Sean,

On Wed, 11 Oct 2023 at 18:56, Sean Anderson <seanga2 at gmail.com> wrote:
>
> This series adds some tests for various SPL load methods, with the intent of
> helping debug v6 of [1]. With that in mind, notable omissions include NAND and
> ROMAPI, which both lack sandbox implementations, and OS_BOOT, which I have
> deferred due to its complexity. Semihosting is also omitted, but I think we can
> test that with qemu.
>
> In order to test all of these methods, we must first generate suitable images,
> possibly on filesystems. While other tests have historically generated these
> images using external tools (e.g. mkimage, mkfs, etc.), I have chosen to
> generate them on the fly. This is for a few reasons:
>
> - By removing external dependencies on pytest to create certain files, the tests
>   become self-contained. This makes them easier to iterate on and debug.
> - By generating tests at runtime, we can dynamically vary the content. This
>   helps detect test failures, as even if tests are loaded to the same location,
>   the expected content will be different.
> - We are not testing the image parsers themselves (e.g. spl_load_simple_fit or
>   fs_read) but rather the load methods (e.g. spl_mmc_load_image). It is
>   unnecessary to exercise full functionality or generate 100% correct images.
> - By reducing functionality to only what is necessary, the complexity of various
>   formats can often be greatly reduced.

This makes sense to me. Also the code to generate the images is
relatively small.

>
> This series depends on [2-3], which are small fixes identified through this
> patch set. The organization of patches in this series is as follows:
>
> - General fixes for bugs which are unlikely to be triggered outside of this
>   series
> - Changes to IMX8 container images to facilitate testing
> - General prep. work, particularly regarding linker issues
> - The tests themselves
>
> Mostly-passing CI at [4]; I have since fixed the typo/missing cast.
>
> [1] https://lore.kernel.org/all/20230731224304.111081-1-sean.anderson@seco.com/
> [2] https://lore.kernel.org/all/20230930204246.515254-1-seanga2@gmail.com/
> [3] https://lore.kernel.org/all/20231008014748.1987840-1-seanga2@gmail.com/
> [4] https://source.denx.de/u-boot/custodians/u-boot-clk/-/pipelines/18091
>
>
> Sean Anderson (26):
>   spl: legacy: Fix referencing _image_binary_end
>   spl: nor: Don't allocate header on stack
>   spl: fit: Fix entry point for SPL_LOAD_FIT_FULL
>   arm: imx: Fix i.MX8 container load address
>   arm: imx: Add newlines after error messages
>   arm: imx: Add function to validate i.MX8 containers
>   arm: imx: Check header before calling spl_load_imx_container
>   Move i.MX8 container image loading support to common/spl
>   spl: Allow enabling SPL_OF_REAL and SPL_OF_PLATDATA at the same time
>   lib: acpi: Fix linking SPL when ACPIGEN is enabled
>   fs: ext4: Fix building ext4 in SPL if write is enabled
>   fs: Compile in sandbox filesystem in SPL if it is enabled
>   net: Fix compiling SPL when fastboot is enabled
>   net: bootp: Move port numbers to header
>   net: bootp: Fall back to BOOTP from DHCP when unit testing
>   spl: Don't cache devices when UNIT_TEST is enabled
>   spl: Use map_sysmem where appropriate
>   test: spl: Split tests up and use some configs
>   test: spl: Fix spl_test_load not failing if fname doesn't exist
>   test: spl: Add functions to create images
>   test: spl: Add functions to create filesystems
>   test: spl: Add a test for spl_blk_load_image
>   test: spl: Add a test for the MMC load method
>   test: spl: Add a test for the NET load method
>   test: spl: Add a test for the NOR load method
>   test: spl: Add a test for the SPI load method
>

Reviewed-by: Simon Glass <sjg at chromium.org>

Yeoman's work, that.

Regards,
Simon


More information about the U-Boot mailing list