summaryrefslogtreecommitdiff
path: root/test/py/tests
AgeCommit message (Collapse)Author
39 hoursMerge patch series "various memory related fixups"nextTom Rini
[email protected] <[email protected]> says: From: Randolph Sapp <[email protected]> Nitpicks and fixes from the discovery thread on adding PocketBeagle2 support [1]. This does a lot of general setup required for the device, but these modifications themselves aren't device specific. For those specifically interested in PocketBeagle2 support and don't care about these details, my development branch is public [2]. That first patch may provoke some opinions, but honestly if that warning was still present I wouldn't have spent a week poking holes in both the EFI and LMB allocations systems. Please let me know if there is a specific usecase that it breaks though. [1] https://lore.kernel.org/all/[email protected]/ [2] https://github.com/StaticRocket/u-boot/tree/feature/pocketbeagle2 Link: https://lore.kernel.org/r/[email protected]
39 hourstest: boot: add a fdt reserved region checkRandolph Sapp
Add a image_fdt suite and a check for boot_fdt_add_mem_rsv_regions. This will ensure the user is properly informed of any reservation failures. It will also validate that reservations are cleaned up correctly when switching FDTs. Signed-off-by: Randolph Sapp <[email protected]> Reviewed-by: Simon Glass <[email protected]> Acked-by: Ilias Apalodimas <[email protected]>
39 hourstest_ut: add a ut_ubman fixture to clean up testsRandolph Sapp
Add a ut_ubman fixture to clean up after certain problematic tests without negatively affecting the current assert based testing. Currently this catches "bootstd bootflow_cmd_boot" and "bootstd bootflow_scan_boot" ut_subtests, as these will change the sandbox state a little too much to be recoverable from. Signed-off-by: Randolph Sapp <[email protected]> Reviewed-by: Simon Glass <[email protected]>
4 daysimage-fit: Validate external data offset and sizeAnton Ivanov
fit_image_get_data() uses the data-position, data-offset, and data-size FIT properties without bounds checking. A crafted FIT image can specify values that cause out-of-bounds read during signature verification of an untrusted FIT. Validate that the external data offset and size are non-negative, and that the data region fits within the FIT image bounds. Signed-off-by: Anton Ivanov <[email protected]> Reviewed-by: Simon Glass <[email protected]>
4 daysimage-fit-sig: Validate hashed-strings region sizeAnton Ivanov
fit_config_check_sig() reads the hashed-strings property and uses its size value without validation when building the region list for signature verification. A crafted FIT image can specify an arbitrary size, causing the hash calculation to read beyond the end of the FIT image. The property length is also not checked, so a truncated hashed-strings property causes strings[1] to be read past the end of the property. This may result in the out-of-bounds read during signature verification of an untrusted FIT. Validate both the property length and that the declared strings region fits within bounds before adding it to the region list. Signed-off-by: Anton Ivanov <[email protected]>
6 daysMerge patch series "tools: mkimage: fix get_basename crash on paths with ↵Tom Rini
dotted directories" Aristo Chen <[email protected]> says: The get_basename() helper in tools/fit_image.c searches the entire input path independently for the last '/' and the last '.'. When the last '.' falls at an offset earlier than the last '/', for example "./mydt", "a.b/c" or "sub.d/leaf", 'end' points before 'start' and the computed length is negative. The size check uses signed comparison so the negative value flows unchanged into memcpy() (cast to size_t there) and mkimage segfaults during -f auto FIT generation. The helper is reached on every auto-FIT build via the -b, --fit-tee and --fit-tfa-bl31 file arguments. The first patch restricts the dot search to the substring that follows the last slash, which is the minimal fix and preserves the existing behaviour for typical inputs such as "arch/arm/dts/foo.dtb". The second patch adds a parametrized sandbox test under test/py/tests/test_fit_mkimage_validate.py that drives mkimage -f auto with each of the crashing inputs ("./mydt", "./sub.d/leaf", "./a.b/c") plus one control input ("./mydt.dtb"). The test reads the resulting /images/fdt-1 description back from the produced FIT via fdtget to verify get_basename()'s output matches the expected stripped basename. Reproducer that previously segfaulted and now produces a valid image: echo dummy > kernel.bin echo dummy > ./mydt ./tools/mkimage -f auto -A arm -O linux -T kernel -C none \ -a 0x80000000 -e 0x80000000 -n test \ -d kernel.bin -b ./mydt out.itb Verified by rebuilding tools/mkimage on master and running the command above with each of the four parametrized inputs. The three crash triggers all segfault before the fix and now produce the expected fdt-1 descriptions ("mydt", "leaf", "c"); the control input "./mydt.dtb" continues to produce "mydt" as before. Link: https://lore.kernel.org/r/[email protected]
6 daystest/py: cover get_basename crash on paths with dotted directoriesAristo Chen
Add a parametrized regression test for the fix in the previous commit. The test invokes mkimage in auto-FIT mode (-f auto) with a -b argument whose directory component contains a '.' and whose leaf either lacks an extension or is a plain identifier. Before the fix these inputs caused get_basename() to compute a negative length and segfault inside memcpy. The test asserts that mkimage exits successfully and that the fdt sub-image description matches the expected stripped basename, covering "./mydt", "./sub.d/leaf", and "./a.b/c". A control input of "./mydt.dtb" is also exercised to confirm normal extension stripping still works. Signed-off-by: Aristo Chen <[email protected]>
6 daysMerge patch series "allow control DTB to double as "FIT image""Tom Rini
Rasmus Villemoes <[email protected]> says: The commit message for patch 1 explains what it is I'd like to be able to do, but here's some more background: For a long time, we've embedded the boot script in the U-Boot binary by building a bootscript.itb, and using a .dtsi like / { config { bootscript = /incbin/("/path/to/bootscript.itb"); }; }; which in turn is mentioned in CONFIG_DEVICE_TREE_INCLUDES, that bootscript.itb FIT image has been embedded in U-Boot's control dtb. Running that was then a matter of doing fdt addr ${fdtcontroladdr} && fdt get addr bsaddr /config bootscript && source ${bsaddr} There are a couple of advantage of having the bootscript (and other script logic) embedded in the U-Boot binary. First, there's no need to figure out some separate partition to store the script in, and making sure that gets updated whenever the bootloader itself does. Second, one doesn't need to worry about verifying the script; whatever steps one needs to take to implement secure boot for U-Boot itself will by necessity also cover the control dtb (if nothing else then because that's where the public key for the kernel verification lives). And third, the boot script is automatically updated together with U-Boot itself; and if U-Boot is stored in an eMMC boot partition, that update is guaranteed to be atomic. Now with the stricter requirements of libfdt starting from v2026.04, the above command no longer worked, or only half the time, because the embedded FIT image may not land on an 8-byte aligned address. So that line had to be changed a little (line breaks added) fdt addr ${fdtcontroladdr} && fdt get addr bsaddr /config bootscript && fdt get size bssize /config bootscript && cp.b ${bsaddr} ${loadaddr} ${bssize} && source ${loadaddr} which is getting quite unwieldy. Then it struck me that one could perhaps simplify all of this quite a lot: Cut out the intermediate bootscript.itb, just create a .dtsi which directly puts a /images node inside the control dtb / { images { default = "bootscript"; bootscript { description = "Boot script"; data = /incbin/("/path/to/bootscript.sh"); type = "script"; compression = "none"; }; }; }; and treat the control dtb itself as a FIT image; so the command to put in $bootcmd becomes simply source ${fdtcontroladdr}:bootscript and embedding other pieces of callable scripts is quite trivial. And that almost works out-of-the-box, except for the fit_check_format() sanity check. Introduce a CONFIG_ knob that allows one to opt out of those sanity checks, for the special case of the address being checked being identical to gd->fdt_blob. Link: https://lore.kernel.org/r/[email protected]
6 daystest: hook up test of allowing control DTB to act as FIT imageRasmus Villemoes
Add a test demonstrating how one can embed various scripts in the control DTB. Verify that the source command can be used with ${fdtcontroladdr} by itself (invoking the default script), and with :<node-name> suffix. Check that the scripts themselves can invoke "sibling" scripts. Also verify that without CONTROL_DTB_AS_FIT set, the control DTB is not accepted by the source command. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Rasmus Villemoes <[email protected]>
8 daysMerge tag 'v2026.07-rc4' into nextTom Rini
Prepare v2026.07-rc4
2026-06-02tests: fs_helper: check path validity during cleanupFrancesco Valla
If the filesystem creation attempted by the FsHelper class fails, the invocation of the cleanup function will cause a TypeError exception, because the path of the filesystem itself, fed to os.remove(), will be None. This will lead to a test failure even in case a skip is instead wanted. Such an exception will lead to a backtrace like this: test/py/tests/test_fs/conftest.py:269: in fs_obj_basic fsh.mk_fs() test/py/tests/fs_helper.py:70: in mk_fs self.fs_img = mk_fs(self.config, self.fs_type, self.size_mb << 20, test/py/tests/fs_helper.py:246: in mk_fs check_call(f'mkfs.{fs_lnxtype} {mkfs_opt} {fs_img}', shell=True, /usr/lib64/python3.14/subprocess.py:420: in check_call raise CalledProcessError(retcode, cmd) E subprocess.CalledProcessError: Command '<...>' returned non-zero exit status 1. During handling of the above exception, another exception occurred: test/py/tests/test_fs/conftest.py:272: in fs_obj_basic pytest.skip('Setup failed for filesystem: ' + fs_type + '. {}'.format(err)) E Skipped: Setup failed for filesystem: ext4. Command '<...>' returned non-zero exit status 1. During handling of the above exception, another exception occurred: test/py/tests/test_fs/conftest.py:277: in fs_obj_basic fsh.cleanup() test/py/tests/fs_helper.py:91: in cleanup os.remove(self.fs_img) E TypeError: remove: path should be string, bytes or os.PathLike, not NoneType Fix this by checking if the variable containing the filesystem path is valid before attempting to call os.remove() on it. Fixes: 3691b1e4ce074 ("test: Convert fs_helper to use a class") Signed-off-by: Francesco Valla <[email protected]>
2026-05-27Merge patch series "fit: dm-verity support"Tom Rini
Daniel Golle <[email protected]> says: This series adds dm-verity support to U-Boot's FIT image infrastructure. It is the first logical subset of the larger OpenWrt boot method series posted as an RFC in February 2026 [1], extracted here for independent review and merging. OpenWrt's firmware model embeds a read-only squashfs or erofs root filesystem directly inside a uImage.FIT container as a FILESYSTEM-type loadable FIT image. At boot the kernel maps this sub-image directly from the underlying block device via the fitblk driver (/dev/fit0, /dev/fit1, ...), the goal is that the bootloader never even copies it to RAM. dm-verity enables the kernel to verify the integrity of those mapped filesystems at read time, with a Merkle hash tree stored contiguously in the same sub-image just after the data. Two kernel command-line parameters are required: dm-mod.create= -- the device-mapper target table for the verity device dm-mod.waitfor= -- a comma-separated list of block devices to wait for before dm-init sets up the targets (needed when fitblk probes late, e.g. because it depends on NVMEM calibration data) The FIT dm-verity node schema was upstreamed into the flat-image-tree specification [2], which this implementation tries to follow exactly. The runtime feature is guarded behind CONFIG_FIT_VERITY. If not enabled the resulting binary size remains unchanged. If enabled the binary size increases by about 3kB. [1] previous submissions: RFC: https://www.mail-archive.com/[email protected]/msg565945.html v1: https://www.mail-archive.com/[email protected]/msg569472.html v2: https://www.mail-archive.com/[email protected]/msg570599.html v3: https://www.mail-archive.com/[email protected]/msg573223.html v4: https://www.mail-archive.com/[email protected]/msg574000.html [2] flat-image-tree dm-verity node spec: https://github.com/open-source-firmware/flat-image-tree/commit/795fd5fd7f0121d0cb03efb1900aafc61c704771 Link: https://lore.kernel.org/r/[email protected]
2026-05-27test: py: add mkimage dm-verity round-trip testDaniel Golle
Add test/py/tests/test_fit_verity.py covering: - mkimage writes correct dm-verity properties for matched and mismatched block sizes (4096/4096 and 4096/1024); - veritysetup verify re-checks the digest against the .itb's external data section; - mkimage rejects dm-verity images built without -E. All tests are skipped if veritysetup is not installed on the host. Signed-off-by: Daniel Golle <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2026-05-25Merge patch series "boot/fit: use fdt_for_each_subnode() in image-fit.c"Tom Rini
Aristo Chen <[email protected]> says: This series ends with replacing the verbose fdt_next_node() + ndepth idiom in boot/image-fit.c with fdt_for_each_subnode(), bringing the file in line with boot/image-fit-sig.c. Six of the seven sites in image-fit.c predate the macro by 2-6 years; the seventh was copy-pasted from a neighbour in 2015 just after the macro landed. The old idiom is legacy, not a deliberate technical choice. Converting straight to the macro turned out to need a prerequisite, which is patch 1. fit_print_contents() reads the default-config property using the loop variable left over after iterating /images children. With /images defined first in the source (the conventional layout) libfdt's walker happens to leave that variable pointing at /configurations and the read works. With /configurations defined first the read returns NULL and the "Default Configuration" line is silently omitted. fdt_for_each_subnode()'s post-loop value is unconditionally a negative error code, so a naive conversion would have made the missing line the unconditional behaviour. Patch 1 reads the property from confs_noffset directly and removes the layout dependency. Patch 2 adds a regression test for the configs-before-images layout, which had no coverage. Patch 3 is the mechanical conversion at all seven sites, equivalence-preserving as described in the per-patch message. Link: https://lore.kernel.org/r/[email protected]
2026-05-25test: fit: regression test for default-config print with reversed node orderAristo Chen
Add a test that builds a FIT whose /configurations node is defined before /images in the source, runs iminfo, and asserts that the "Default Configuration: '<name>'" line appears in the output. Before the fix in the preceding commit ("boot/fit: read default-config property from the configurations node"), fit_print_contents() read the default-config property using the loop variable left over from iterating /images children. With /images defined first that variable accidentally pointed at /configurations and the line printed correctly; with /configurations defined first the read returned NULL and the line was silently omitted. The new test exercises the latter layout, which had no coverage. iminfo and the fit_print_contents() path had no test coverage at all before this commit. Signed-off-by: Aristo Chen <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2026-05-25test: fs: Use shared generate_file from utilsAristo Chen
test_fs/test_erofs.py and test_fs/test_squashfs/sqfs_common.py both defined a generate_file() helper that writes a file of a given size filled with 'x'. The two functions were functionally identical and differed only in parameter names and docstrings. Move the helper into the existing test/py/utils.py module, which is the established home for generic test utilities (md5sum_file, PersistentRandomFile, attempt_to_open_file). Update both call sites to use it. Signed-off-by: Aristo Chen <[email protected]> Reviewed-by: [email protected] Reviewed-by: Simon Glass <[email protected]>
2026-05-08test: fit: Use shared make_fname from fit_utilAristo Chen
test_fit.py declares a local make_fname closure that is byte-identical to fit_util.make_fname. Drop the local copy and call the shared helper at all seven call sites so there is one definition to maintain. No behavioural change. Both implementations return os.path.join(ubman.config.build_dir, basename). Signed-off-by: Aristo Chen <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2026-04-27Merge patch series "net: migrate NO_NET out of the networking stack choice"Tom Rini
Quentin Schulz <[email protected]> says: This migrates the net options away from the main Kconfig to net/Kconfig, rename the current NET option to NET_LEGACY to really highlight what it is and hopefully encourage more people to use lwIP, add a new NET menuconfig (but keep NO_NET as an alias to NET=n for now) which then allows us to replace all the "if legacy_stack || lwip_stack" checks with "if net_support" which is easier to read and maintain. The only doubt I have is wrt SYS_RX_ETH_BUFFER which seems to be needed for now even when no network is configured? Likely due to include/net-common.h with PKTBUFSRX? No change in behavior is intended. Only change in defconfig including other defconfigs where NO_NET=y or NET is not set, in which case NO_NET is not set or NET=y should be set in the top defconfig. Similar change required for config fragments. See commit log in patch adding NET menuconfig for details. This was tested based on 70fd0c3bb7c2 ("x86: there is no CONFIG_UBOOT_ROMSIZE_KB_12288"), from within the GitLab CI container trini/u-boot-gitlab-ci-runner:noble-20251013-23Jan2026 and set up similarly as in "build all platforms in a single job" GitLab CI job. #!/usr/bin/env bash set -o pipefail set -eux ARGS="-BvelPEWM --reproducible-builds --step 0" ./tools/buildman/buildman -o ${O} --force-build $ARGS -CE $* ./tools/buildman/buildman -o ${O} $ARGS -Ssd $* O=../build/u-boot/ ../u-boot.sh -b master^..b4/net-kconfig |& tee ../log.txt I can't really decipher the log.txt, but there's no line starting with + which would be an error according to tools/buildman/builder.py help text. Additionally, because I started the script with set -e set and because buildman has an exit code != 0 when it fails to build a board, and I have the summary printed (which is the second buildman call), I believe it means all builds passed. The summary is the following: aarch64: (for 537/537 boards) all +0.0 rodata +0.0 uniphier_v8 : all +1 rodata +1 u-boot: add: 0/0, grow: 1/0 bytes: 1/0 (1) function old new delta data_gz 10640 10641 +1 arm: (for 733/733 boards) all -0.0 rodata -0.0 uniphier_v7 : all -1 rodata -1 u-boot: add: 0/0, grow: 0/-1 bytes: 0/-1 (-1) function old new delta data_gz 11919 11918 -1 opos6uldev : all -3 rodata -3 u-boot: add: 0/0, grow: 0/-1 bytes: 0/-3 (-3) function old new delta data_gz 18778 18775 -3 uniphier_ld4_sld8: all -3 rodata -3 u-boot: add: 0/0, grow: 0/-1 bytes: 0/-3 (-3) function old new delta data_gz 11276 11273 -3 stemmy : all -20 rodata -20 u-boot: add: 0/0, grow: 0/-1 bytes: 0/-20 (-20) function old new delta data_gz 15783 15763 -20 As far as I could tell this data_gz is an automatically generated array when CONFIG_CMD_CONFIG is enabled. It is the compressed .config stored in binary form. Because I'm changing the name of symbols, replacing a menu with a menuconfig, additional text makes it to .config and the "# Networking" section in .config disappears. Here is the diff for the 5 defconfigs listed above, generated with: for f in build/*-m; do diff --unified=0 $f/.config $(dirname $f)/$(basename -a -s '-m' $f)/.config done (-m is the build directory for master, and without the suffix, it's the top commit of this series) """ --- build/opos6uldev-m/.config 2026-04-20 10:53:49.804528526 +0200 +++ build/opos6uldev/.config 2026-04-20 11:03:37.430242767 +0200 @@ -970,4 +969,0 @@ - -# -# Networking -# @@ -975,0 +972 @@ +CONFIG_NET_LEGACY=y --- build/stemmy-m/.config 2026-04-20 11:01:33.653698123 +0200 +++ build/stemmy/.config 2026-04-20 11:04:53.452577311 +0200 @@ -733,4 +732,0 @@ - -# -# Networking -# @@ -738,2 +733,0 @@ -# CONFIG_NET is not set -# CONFIG_NET_LWIP is not set --- build/uniphier_ld4_sld8-m/.config 2026-04-20 11:00:41.605469071 +0200 +++ build/uniphier_ld4_sld8/.config 2026-04-20 11:04:22.226439899 +0200 @@ -997,4 +996,0 @@ - -# -# Networking -# @@ -1002,0 +999 @@ +CONFIG_NET_LEGACY=y --- build/uniphier_v7-m/.config 2026-04-20 10:53:04.019307319 +0200 +++ build/uniphier_v7/.config 2026-04-20 11:03:01.688085486 +0200 @@ -1004,4 +1003,0 @@ - -# -# Networking -# @@ -1009,0 +1006 @@ +CONFIG_NET_LEGACY=y --- build/uniphier_v8-m/.config 2026-04-20 10:43:05.614441175 +0200 +++ build/uniphier_v8/.config 2026-04-20 10:41:03.214852130 +0200 @@ -875,4 +874,0 @@ - -# -# Networking -# @@ -880,0 +877 @@ +CONFIG_NET_LEGACY=y """ This is fine: - Networking menu doesn't exist anymore so "#\n# Networking\n#\n" won't be in .config anymore. - opos6uldev, uniphier_ld4_sld8, uniphier_v7 and uniphier_v8 all have (old) CONFIG_NET enabled, (new) CONFIG_NET will still be set but CONFIG_NET_LEGACY also needs to be defined now to reflect the stack choice (even if default), - stemmy has CONFIG_NO_NET set, which means CONFIG_NET and CONFIG_NET_LWIP are not reachable anymore hence why they don't need to be part of .config, GitLab CI was run on this series (well, not exactly, but it's only changes to the git logs that were made): https://source.denx.de/u-boot/contributors/qschulz/u-boot/-/pipelines/29849 It passes. Link: https://lore.kernel.org/r/[email protected]
2026-04-27simplify NET_LEGACY || NET_LWIP condition with NET conditionQuentin Schulz
Since the move to make NET a menuconfig and NO_NET a synonym of NET=n, when NET is enabled, NET_LEGACY || NET_LWIP is necessarily true, so let's simplify the various checks across the codebase. SPL_NET_LWIP doesn't exist but SPL_NET_LEGACY is an alias for SPL_NET so the proper symbol is still defined in SPL whenever needed. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Peter Robinson <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2026-04-27rename NET to NET_LEGACYQuentin Schulz
Highlight that NET really is the legacy networking stack by renaming the option to NET_LEGACY. This requires us to add an SPL_NET_LEGACY alias to SPL_NET as otherwise CONFIG_IS_ENABLED(NET_LEGACY) will not work for SPL. The "depends on !NET_LWIP" for SPL_NET clearly highlights that it is using the legacy networking app so this seems fine to do. This also has the benefit of removing potential confusion on NET being a specific networking stack instead of "any" network stack. Signed-off-by: Quentin Schulz <[email protected]> Acked-by: Ilias Apalodimas <[email protected]> Reviewed-by: Peter Robinson <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2026-04-22Merge patch series "test: Refactor FIT test for clarity and extensibility"Tom Rini
Simon Glass <[email protected]> says: This series reworks the FIT test (test_fit.py) to make it easier to maintain and extend. It fixes the buildconfigspec so the test actually runs on sandbox, avoids unnecessary U-Boot restarts, renames the main test for easier selection, adds a missing-kernel check, fixes Python warnings, converts the test to use a class, splits into separate test functions, and adds Sphinx documentation. Link: https://lore.kernel.org/r/[email protected]
2026-04-22test: Add fsetup fixture and prepare helper for FIT testSimon Glass
Create an 'fsetup' fixture which sets up files and parameters, and a prepare() helper which builds a FIT with given parameter overrides. Update check_equal() and check_not_equal() to look up filenames from a params dict by key, reducing the number of local variables needed. Split the single test_fit_operations() into individual test functions so that each appears separately in the results. Signed-off-by: Simon Glass <[email protected]>
2026-04-22test: Convert FIT test to use a classSimon Glass
Move this test over to use a class instead of a function, so we can easily split it into some related tests. Move the TODO so it is part of the comment for the class. Tidy up some function comments while we are here. Signed-off-by: Simon Glass <[email protected]>
2026-04-22test: Update fit test to fix a few Python warningsSimon Glass
Fix some warnings and disable one that cannot be fixed. Signed-off-by: Simon Glass <[email protected]>
2026-04-22test: Add a check for a missing kernelSimon Glass
U-Boot should complain if the kernel is missing, so add a check for this in test_fit_base() Signed-off-by: Simon Glass <[email protected]>
2026-04-22test: Rename test_fit() to test_fit_base()Simon Glass
The current name is uses as a root name by a few other tests, such as test_fit_ecdsa() which makes it hard to run just this test. Rename it to test_fit_base() Signed-off-by: Simon Glass <[email protected]>
2026-04-22test: fit: Avoid restarting U-BootSimon Glass
We don't actually need to use the test FDT as the control FDT. It slows down the test since U-Boot needs to be restarted each time. Instead of restarting, update the test to clear memory before it loads the FIT. Rename the data-variable to fdt_data since is it no-longer the control FDT. Signed-off-by: Simon Glass <[email protected]>
2026-04-22test: fit: Drop the fit_signature buildconfigspecSimon Glass
The test_fit test requires buildconfigspec('fit_signature') but does not exercise signature verification. The ITS template includes a signature-1 node, but mkimage only needs TOOLS_FIT_SIGNATURE (a host tool option) to handle it, not CONFIG_FIT_SIGNATURE in the U-Boot binary. Since sandbox does not enable CONFIG_FIT_SIGNATURE, the test is silently skipped on every run. Change the marker to buildconfigspec('fit') which is all the test actually needs. Signed-off-by: Simon Glass <[email protected]>
2026-04-21Merge patch series "test: Convert tests to use FsHelper and DiskHelper"Tom Rini
Simon Glass <[email protected]> says: This series adds a DiskHelper class and converts most test code to use FsHelper and DiskHelper instead of calling mk_fs() and setup_image() directly. The FsHelper class (already upstream) provides a cleaner interface for creating filesystem images, handling temporary directories and cleanup automatically. The new DiskHelper class builds on this, creating partitioned disk images from one or more FsHelper filesystems. DiskHelper includes a cur_dir flag to place the disk image in the current directory rather than the persistent-data directory. This matches the behaviour of setup_image() which places disk images in source_dir where sandbox expects to find them. This flag is needed for now and should be removed in a follow-up once all tests are migrated to use the persistent-data directory instead. With these helpers, test-setup code becomes shorter, more consistent and easier to follow. Manual sfdisk/dd/cleanup sequences are replaced by a few method calls. The series also fixes a broken fs_obj_fat fixture where a stale size_gran argument is silently causing the test to be skipped. A few EFI test fixtures (efi_capsule, efi_secboot, eficonfig) still use mk_fs() directly; these are left for a follow-up series since they would benefit from a full DiskHelper conversion. Link: https://lore.kernel.org/r/[email protected]
2026-04-21test: Convert test_fs fixtures to use FsHelperSimon Glass
Replace all direct calls to the mk_fs() function with FsHelper in the filesystem test fixtures. Each fixture now creates an FsHelper instance, populates its srcdir with test files, then calls mk_fs() on the object. This removes manual scratch-directory management and cleanup code, since FsHelper handles the source directory and image-file lifecycle. Signed-off-by: Simon Glass <[email protected]>
2026-04-21test: Convert setup_rauc_image() to use FsHelperSimon Glass
Use FsHelper and DiskHelper to create the RAUC A/B disk image. This replaces the manual sfdisk and dd commands, making the code shorter and easier to follow. The same boot and root filesystems are added twice to produce the A/B partition layout. Signed-off-by: Simon Glass <[email protected]>
2026-04-21test: Rename setup_bootflow_image()Simon Glass
The name of this is fairly vague. Use 'extlinux' so that it is clear that it relates to that format. Signed-off-by: Simon Glass <[email protected]>
2026-04-21test: Convert test_ut_dm_init() to use FsHelperSimon Glass
Use the helper here, for consistency. Signed-off-by: Simon Glass <[email protected]>
2026-04-21test: Convert setup_efi_image() to use FsHelperSimon Glass
Simplify this test-setup code by using the helper. Signed-off-by: Simon Glass <[email protected]>
2026-04-21test: Convert setup_bootflow_image() to use FsHelperSimon Glass
Simplify this test-setup code by using the helper. Signed-off-by: Simon Glass <[email protected]>
2026-04-21test: Split out core of Fedora image into a new functionSimon Glass
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 <[email protected]>
2026-04-21test: Convert setup_bootmenu_image() to use FsHelperSimon Glass
Simplify this test-setup code by using the helper. Signed-off-by: Simon Glass <[email protected]>
2026-04-21test: Convert test_efi_bootmgr to use FsHelperSimon Glass
Simplify this test by using the helper. Signed-off-by: Simon Glass <[email protected]>
2026-04-21test: Convert test_xxd to use FsHelperSimon Glass
Simplify this test by using the helper. Signed-off-by: Simon Glass <[email protected]>
2026-04-21test: Convert test_cat to use FsHelperSimon Glass
Simplify this test by using the helper. Signed-off-by: Simon Glass <[email protected]>
2026-04-21test: Fix broken fs_obj_fat fixtureSimon Glass
The removal of the size_gran parameter from mk_fs() leaves a stale positional argument (1024) that is now interpreted as the fs_img filename. Since 1024 is an integer, os.path.join() raises TypeError, causing the fixture to silently skip via the bare except clause. Drop the stale argument so the fixture works again. Fixes: d030dc34d67a ("test: fs_helper: Drop the size_gran argument") Signed-off-by: Simon Glass <[email protected]>
2026-04-21test: fs_helper: Skip empty srcdir when creating a filesystemSimon Glass
FsHelper.mk_fs() always creates a srcdir via setup(), then passes it to the module-level mk_fs(). This fails for filesystem types like ext2 that do not support the -d flag, raising ValueError even when no files need to be copied. Pass None for src_dir when the srcdir is empty, so that creating an empty filesystem works for all supported types. Signed-off-by: Simon Glass <[email protected]>
2026-04-21test: Add a helper class to create disk imagesSimon Glass
Provide a way to create disk images which consist of multiple filesystem images. Include a cur_dir option to place the disk image in the current directory rather than in the persistent-data directory. This matches the behaviour of setup_image() which places disk images in source_dir where sandbox expects to find them. This flag is a temporary feature and should be removed once all tests are migrated to use the persistent-data directory instead. Signed-off-by: Simon Glass <[email protected]>
2026-04-08cmd/scsi: drop scsi reset commandDavid Lechner
Since commit b630f8b3aefc ("scsi: Forceably finish migration to DM_SCSI") the "scsi reset" command has no possibility of actually resetting any SCSI controller. Drop the command to avoid confusion that the command is actually resetting the SCSI controller. Signed-off-by: David Lechner <[email protected]>
2026-04-06Merge branch 'next'Tom Rini
2026-03-25Merge patch series "test/py: gpio: cleanups and improvement"Tom Rini
David Lechner <[email protected]> says: I wanted to do some quick tests to make sure gpios were working without having to dig out a schematic. Which means I didn't want to set any GPIO as an output first without checking. So the main point here is the last patch which allows gpio_op_pin to be optional and skip the test instead of failing with exception. This works similar to several other config options that are already optional in this module. I also noticed a few easy things to clean up while I was looking at the file, so there are a couple of extra patches for that. Link: https://lore.kernel.org/r/[email protected]
2026-03-25test/py: gpio: allow omitting gpio_op_pinDavid Lechner
Modify tests that make use of gpio_op_pin from env__gpio_dev_config to be skipped if gpio_op_pin is not provided. This is useful in cases where one might not be sure which GPIOs are safe to use as outputs that can be toggled without causing problems. Signed-off-by: David Lechner <[email protected]>
2026-03-25test/py: gpio: removing trailing semicolonsDavid Lechner
Remove trailing semicolons in test_gpio.py. Python does not require them and they are considered improper style. Signed-off-by: David Lechner <[email protected]>
2026-03-25test/py: gpio: remove unused importsDavid Lechner
Remove unused imports in test_gpio.py. Signed-off-by: David Lechner <[email protected]>
2026-03-23Merge patch series "Provide a class for building filesystem images"Tom Rini
Simon Glass <[email protected]> says: Create a class around mk_fs() to handle the common tasks of image creation, such as managing scratch directories and cleaning up. Start with a few small cleanups to mk_fs(), then convert the helper to use a class. Link: https://lore.kernel.org/r/[email protected]