summaryrefslogtreecommitdiff
path: root/test/py
AgeCommit message (Collapse)Author
3 dayscmd/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]>
5 daysMerge 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]
2026-03-23test: Convert fs_helper to use a classSimon Glass
Create a class around mk_fs() (and later setup_image()) to handle the common tasks of image creation. Many callers of fs_helper.mk_fs() create their own scratch directories while users of fs_helper.setup_image() rely on one being returned. Unify this by adding 'srcdir' as a field while converting to a class. The class delegates to the existing mk_fs() function for the actual filesystem creation, adding lifecycle management for scratch directories and the image file. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2026-03-23test: fs_helper: Drop the size_gran argumentSimon Glass
Nothing uses this argument, so make it a constant for now. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Christian Taedcke <[email protected]>
2026-03-23test: Update comment for fs_helper.setup_image()Simon Glass
This function actually allows creating two partitions now, so update its comment to match that. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2026-03-23test: fs_helper: Add a quiet flag to mk_fs()Simon Glass
In many cases callers only want to see warnings and errors from the filesystem-creation tools, not their normal output. Add a quiet parameter to mk_fs() that suppresses the output of mkfs and switches mcopy from verbose to quiet mode. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2026-03-23test: fs_helper: Allow passing the image filenameSimon Glass
The mk_fs() function always generates its own image filename from the prefix and fs_type. Some callers need to specify a custom leaf name while still keeping the image under the persistent-data directory. Add an fs_img parameter that accepts a leaf filename. When provided, it is joined with persistent_data_dir instead of the default name. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2026-03-22tests: FIT: Add "clone" image attack image testTom Rini
Related to the problem resolved with commit 2092322b31cc ("boot: Add fit_config_get_hash_list() to build signed node list"), add a testcase for the problem as well. Reported-by: Apple Security Engineering and Architecture (SEAR) Signed-off-by: Tom Rini <[email protected]>
2026-03-14test/py: add ECPT testsVincent Stehlé
Add a couple of EFI Conformance Profiles Table (ECPT) tests, which exercise the "efidebug ecpt" command. Signed-off-by: Vincent Stehlé <[email protected]> Cc: Tom Rini <[email protected]> Cc: Heinrich Schuchardt <[email protected]> Cc: Ilias Apalodimas <[email protected]>
2026-03-09Merge tag 'v2026.04-rc4' into nextTom Rini
Prepare v2026.04-rc4
2026-03-09boot: Add fit_config_get_hash_list() to build signed node listSimon Glass
The hashed-nodes property in a FIT signature node lists which FDT paths are included in the signature hash. It is intended as a hint so should not be used for verification. Add a function to build the node list from scratch by iterating the configuration's image references. Skip properties known not to be image references. For each image, collect the path plus all hash and cipher subnodes. Use the new function in fit_config_check_sig() instead of reading 'hashed-nodes'. Update the test_vboot kernel@ test case: fit_check_sign now catches the attack at signature-verification time (the @-suffixed node is hashed instead of the real one, causing a mismatch) rather than at fit_check_format() time. Update the docs to cover this. The FIT spec can be updated separately. Signed-off-by: Simon Glass <[email protected]> Closes: https://lore.kernel.org/u-boot/[email protected]/ Reported-by: Apple Security Engineering and Architecture (SEAR) Tested-by: Tom Rini <[email protected]>
2026-03-06test: boot: Add test for bootmeth_raucMartin Schwan
Add a simple unit test for testing the RAUC bootmethod. Provide only the very basic tests for now, running a scan and list, to verify correct detection of the RAUC bootmethod. More advanced boot tests of this bootmethod can be added in a separate patch. This requires another mmc image (mmc10) to contain the following partitions: 1. boot A: contains a dummy boot.scr 2. root A: contains an empty root filesystem 3. boot B: contains a dummy boot.scr 4. root B: contains an empty root filesystem The bootmeth_rauc scans all four partitions for existence and expects a boot script in each boot partition. Also add BOOTMETH_RAUC as a dependency on sandbox so that we can test this with: $ ./test/py/test.py -B sandbox --build -k test_ut # build the mmc10.img $ ./test/py/test.py -B sandbox --build -k bootflow_rauc Signed-off-by: Martin Schwan <[email protected]> Reviewed-by: Simon Glass <[email protected]> [trini: mmc9 is now in use, switch to mmc10] Signed-off-by: Tom Rini <[email protected]>
2026-02-18test: cmd: Add test for zip/unzip/gzwrite commandsMarek Vasut
Add simple test for zip/unzip/gzwrite commands. The test works as follows. First, create three buffers with a bit of space between each of them, fill them with random data, then compress data in buffer 1 into buffer 2, decompress data in buffer 2 either directly into buffer 3 or into MMC 1 and then read them back into buffer 3, and finally compare buffer 1 and buffer 3, they have to be identical. The buffers are filled with random data to detect out of bounds writes. Test for various sizes, both small and large and unaligned. The test uses ut_assert_skip_to_line() to skip over gzwrite progress bar. Since the progress bar updates fill up the console record buffer, increase the size of it to compensate. Reviewed-by: Mattijs Korpershoek <[email protected]> Tested-by: Mattijs Korpershoek <[email protected]> Signed-off-by: Marek Vasut <[email protected]>
2026-02-16test/py: Fix spelling of source_dir in docstringDavid Lechner
Fix a typo in the docstring for run_build() where source_dir was misspelled. Signed-off-by: David Lechner <[email protected]>
2026-01-20Merge tag 'efi-2026-04-rc1-2' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-efi Pull request efi-2026-04-rc1-2 CI: https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/29050 Documentation: * Update StarFive JH7110 common description * Add TI AM62D documentation * Update urllib3 version for building * Update links to doc/develop/falcon.rst * Describe QEMU networking * kdoc: handle the obsolescensce of docutils.ErrorString() * Fix typo "addtional" -> "additional" in pflash section. UEFI: * Fix boot failure from FIT with compressed EFI binary Others: * cmd/meminfo: Correct displaying addresses above 4 GiB * test: - Consider configuration in meminfo test - Consider initf_malloc is only traced with EARLY_TRACE - Clean up test_trace.py code
2026-01-19test/py, buildman: Update filelock package versionTom Rini
The GitHub dependabot tool has reported a "medium" priority bug CVE-2026-22701, with this package. Update to the patched version. Reported-by: GitHub dependabot Signed-off-by: Tom Rini <[email protected]>
2026-01-19test: clean up test_trace.py codeHeinrich Schuchardt
* Add module doc string * Correct sequence of imports * Correct long exceeding 100 characters * Remove unused variables * Remove module level invocation of check_flamegraph * Add encoding to open() calls Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Simon Glass <[email protected]> Acked-by: Ilias Apalodimas <[email protected]>
2026-01-19test: initf_malloc is only traced with EARLY_TRACEHeinrich Schuchardt
Only if early tracing is enable the function initf_malloc can be traced. Add a configuration check. Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2026-01-16Merge tag 'u-boot-dfu-20260116' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-dfu u-boot-dfu-20260116 CI: https://source.denx.de/u-boot/custodians/u-boot-dfu/-/pipelines/29018 Android: * Fix missing dependency for BOOTMETH_ANDROID * Add bootconfig support * Add 'get ramdisk' command to abootimg DFU: * Improve error handling in dfu_fill_entity() USB Gadget: * ci_udc: Ensure ci_ep->desc is valid before using it * ci_udc: Add additional debug prints
2026-01-16test: abootimg: Add test for bootconfig handlingGuillaume La Roque (TI.com)
Add test to verify that androidboot.* parameters are correctly extracted from bootargs and appended to the bootconfig section when using 'abootimg get ramdisk' with boot image v4 and vendor_boot image. The test verifies: - androidboot.* parameters are removed from bootargs - They are appended to the bootconfig section in the ramdisk - Non-androidboot parameters remain in bootargs - The bootconfig trailer is properly updated Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Guillaume La Roque (TI.com) <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]> Link: https://lore.kernel.org/r/[email protected] [mkorpershoek: dropped whitespace changes from original patch] Signed-off-by: Mattijs Korpershoek <[email protected]>
2026-01-12Merge patch series "a few test.py improvements"Tom Rini
David Lechner <[email protected]> says: While trying to run the test suite for the first time, I encountered a few minor issues. Here are a few patches to address them. Link: https://lore.kernel.org/r/20260105-a-few-test-py-improvements-v3-0-fea38243ca5b@baylibre.com
2026-01-12test.py: check ubconfig exists before using itDavid Lechner
Set ubconfig to None and add a check in the show_timings() function of test/py/test.py to ensure that the global ubconfig variable was actually initialized before access attributes. If tests fail early, e.g. because --build failed, ubconfig may not have been initialized yet and results in an exception in an atexit handler. Adding this check avoids unnecessary noise in the output. Exception ignored in atexit callback: <function cleanup at 0x7de475ea6b60> Traceback (most recent call last): File "u-boot/test/py/conftest.py", line 669, in cleanup show_timings() File "u-boot/test/py/conftest.py", line 616, in show_timings if ubconfig.timing: ^^^^^^^^ NameError: name 'ubconfig' is not defined Tested-by: Mattijs Korpershoek <[email protected]> # sandbox Reviewed-by: Mattijs Korpershoek <[email protected]> Signed-off-by: David Lechner <[email protected]>
2026-01-08usb: xhci: avoid noisy 'Starting the controller' message.Heinrich Schuchardt
We should avoid overwhelming users with non-essential messages. The message 'Starting the controller' is not written for EHCI. We should not write it for XHCI either. Adjust the Python test accordingly. Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]>
2026-01-07env: Add single to redundant environment upgrade pathMarek Vasut
Add support for converting single-copy environment to redundant environment. In case CRC checks on both redundant environment copies fail, try one more CRC check on the primary environment copy and treat it as single environment. If that check does pass, rewrite the single-copy environment into redundant environment format, indicate the environment is valid, and import that as usual primary copy of redundant environment. Follow up 'env save' will then store two environment copies and the system will continue to operate as regular redundant environment system. Add test which validates this upgrade path. The test starts with spi.bin which is pre-populated as single-copy environment and then upgrades that environment to dual-copy environment. Signed-off-by: Marek Vasut <[email protected]>
2026-01-07test: env: Add test for environment storage in SPI NORMarek Vasut
Add test for environment stored in SPI NOR. The test works in a very similar way to the current test for environment stored in ext4 FS, except it generates spi.bin file backing the SPI NOR. Signed-off-by: Marek Vasut <[email protected]>
2025-12-22Merge tag 'v2026.01-rc5' into nextTom Rini
Prepare v2026.01-rc5
2025-12-18test/py, buildman: Update filelock package versionTom Rini
The GitHub dependabot tool has reported a "medium" priority bug CVE-2025-68146, with this package. Update to the patched version. Reported-by: GitHub dependabot Signed-off-by: Tom Rini <[email protected]>
2025-12-11Merge tag 'u-boot-dfu-next-20251211' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-dfu into next u-boot-dfu-next-20251211: CI: https://source.denx.de/u-boot/custodians/u-boot-dfu/-/pipelines/28724 Android: * Fix 8-byte alignment for newer versions of libfdt
2025-12-06Merge patch series "test/py: fit: Deduplicate the test"Tom Rini
This series from Marek Vasut <[email protected]> cleans up some of the FIT pytests we have and then extends mkimage to support including the TEE in FIT images when using "-f auto" to create the resulting FIT. Link: https://lore.kernel.org/r/[email protected]
2025-12-06mkimage: Add support for bundling TEE in mkimage -f autoMarek Vasut
Introduce two new parameters to be used with mkimage -f auto to bundle TEE image into fitImage, using auto-generated fitImage. Add -z to specify TEE file name and -Z to specify TEE load and entry point address. This is meant to be used with systems which boot all of TEE, Linux and its DT from a single fitImage, all booted by U-Boot. Example invocation: " $ mkimage -E -A arm -C none -e 0xc0008000 -a 0xc0008000 -f auto \ -d arch/arm/boot/zImage \ -b arch/arm/boot/dts/st/stm32mp135f-dhcor-dhsbc.dtb \ -z ../optee_os/out/arm-plat-stm32mp1/core/tee-raw.bin \ -Z 0xde000000 \ /path/to/output/fitImage " Documentation update and test are also included, the test validates both positive and negative test cases, where fitImage does not include TEE and does include TEE blobs. Acked-by: Quentin Schulz <[email protected]> Signed-off-by: Marek Vasut <[email protected]>
2025-12-06test/py: fit: Deduplicate the testMarek Vasut
Introduce generate_and_check_fit_image() and call it with various parameters to test various configurations of the fitImage. This is identical to the existing test, expect for the code duplication. Reviewed-by: Quentin Schulz <[email protected]> Signed-off-by: Marek Vasut <[email protected]>
2025-12-05test/py: android: Point fdt command to aligned addressesMarek Vasut
Newer versions of libfdt strictly check whether the FDT blob passed to them is at 8-byte aligned offset, if it is not, then the library fails checks with -FDT_ERR_ALIGNMENT . Currently, 'abootimg get dtb --index=1 addr size' may return non 8-byte aligned FDT address which points directly into the abootimg. Copy the result into temporary location before validation to avoid FDT alignment check failure. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mattijs Korpershoek <[email protected]>
2025-12-05Merge patch series "test: let UNIT_TEST imply CONSOLE_RECORD"Tom Rini
Heinrich Schuchardt <[email protected]> says: Many C unit tests are not executed if CONFIG_CONSOLE_RECORD is not set. Hence Tom suggested to let UNIT_TEST imply CONSOLE_RECORD. The first patch makes the skipped C unit tests visible. The rest of the series deals with hidden bugs in our tests. The 'fdt get value' command returned incorrect values on low-endian systems. So this needed fixing too. Link: https://lore.kernel.org/r/[email protected]
2025-12-05test: Let pytest indicate skipped C unit testsHeinrich Schuchardt
We invoke the ut command in test_ut.py. Currently we only check for failures. Instead we should also indicate if sub-tests were skipped. With this change we will get output like the following for skipped tests: test/py/tests/test_ut.py ..sssss......ss..............s.sssss.s.s... ================================ short test summary info ================================ SKIPPED [1] test/py/tests/test_ut.py:597: Test addrmap addrmap_test_basic has 1 skipped sub-test(s). SKIPPED [1] test/py/tests/test_ut.py:597: Test bdinfo bdinfo_test_eth has 4 skipped sub-test(s). Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-11-28test/py: Use aligned address for overlays in 'extension' testMarek Vasut
The 'extension' test would set 'extension_overlay_addr' variable to decimal 4096 due to conversion in python. The 'extension_overlay_addr' is however sampled using env_get_hex("extension_overlay_addr", 0); which converts the 4096 to 0x4096 and uses that as DT overlay address, which is unaligned. Fix this by setting extension_overlay_addr to 0x1000 as intended, which is aligned. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Tom Rini <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]>
2025-11-10dm: Remove pre-schema tag supportTom Rini
Support for using "u-boot,dm-..." rather than "bootph-..." has been deprecated since February 2023. Any platforms using this have had a console message saying to migrate by 2023.07. Go and remove all support here now, for the v2026.01 release. The results of this change that aren't clear from the above are that we still have a checkpatch.pl error message, and document in doc/develop/spl.rst that they have been migrated since 2023. We also change the key2dtsi.py tool to use the correct bootph phase rather than the legacy phase. Signed-off-by: Tom Rini <[email protected]>
2025-11-07test/py: multiplexed_log.py: Clean up and correct RunAndLog()Tom Rini
The general python documentation for the subprocess class recommends that run() be used in all cases that it can handle. What we do in RunAndLog is simple enough that run() is easy to switch to. In fact, looking at this exposed a problem we have today, which is that we had combined stdout and stderr but then looked at both stdout and stderr as if they were separate. Stop combining them. Signed-off-by: Tom Rini <[email protected]>
2025-11-04pytest: add test script to validate Firmware HandoffRaymond Mao
Add test cases to validate FDT and TPM eventlog handoff from TF-A and OP-TEE via bloblist. For FDT, the nodes 'reserved-memory' and 'firmware' appended by OP-TEE indicates a successful handoff. For TPM eventlog, the events 'SECURE_RT_EL3', 'SECURE_RT_EL1_OPTEE' and 'SECURE_RT_EL1_OPTEE_EXTRA1' created by TF-A indicates a successful handoff. Signed-off-by: Raymond Mao <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2025-10-16test/py: Update to a newer pytest releaseTom Rini
Our pytest package was pinned to a release from 2021. The minimum compatible with labgrid v25.0.x is pytest 7.0.0. Update to the current relase which is currently 8.4.2 Signed-off-by: Tom Rini <[email protected]>
2025-10-16test: uninstall PK after secboot testsHeinrich Schuchardt
The EFI secure boot tests install a security data base. Other EFI tests assume that secure boot is not enabled. Add the missing tear-down at the end of each secboot test sequence. Reported-by: Tom Rini <[email protected]> Signed-off-by: Heinrich Schuchardt <[email protected]> Tested-by: Tom Rini <[email protected]>
2025-09-24Revert "Merge patch series "mkimage: Detect FIT image load address overlaps ↵Tom Rini
and fix related test/DTS issues"" This reverts commit 4d84fa1261eb27d57687f2e4c404a78b8653c183, reversing changes made to b82a1fa7ddc7f3be2f3b75898d5dc44c34420bdd. I had missed some feedback on this series from earlier, and we have since had reports of regressions due to this as well. For now, revert this. Signed-off-by: Tom Rini <[email protected]>
2025-09-23Merge patch series "mkimage: Detect FIT image load address overlaps and fix ↵Tom Rini
related test/DTS issues" Aristo Chen <[email protected]> says: This patch series enhances FIT image robustness by adding **memory region overlap detection** to `mkimage` and fixing existing overlaps in DTS files and `binman` tests. The primary goal is to prevent runtime memory corruption from conflicting load addresses in FIT images. Key Changes: 1. `mkimage` Overlap Detection: A new validation in `tools/fit_image.c` checks for overlapping load addresses within FIT configurations. `mkimage` now errors out with detailed info on conflicts, preventing bad FIT image creation. 2. New Test Case: A Python test verifies the new detection. It intentionally creates an overlap (kernel and FDT) to confirm correct error handling. 3. Fixes for Existing Overlaps: * Board DTS (k3-am6xx): Adjusted load addresses for TI firmware stubs to prevent conflicts. This resolves previously undetected overlaps. * `binman` Tests: Fixed several tests. U-Boot load addresses were shifted to avoid ATF conflicts. A new linker script for TEE ELF sections ensures distinct memory layouts. 4. Documentation: Added guidance for developers on how to determine ELF load addresses using readelf, linker scripts, and objdump when working with binman FIT images. Impact: This series improves FIT image reliability by catching overlaps at build time, helping developers resolve issues before runtime failures. Link: https://lore.kernel.org/r/[email protected]
2025-09-23test: Add test case for FIT image load address overlap detectionAristo Chen
Add a new test case to verify that mkimage properly detects and reports memory region overlaps in FIT image configurations. The test creates a FIT image with kernel and FDT components that have the same load address (0x40000), which should trigger the overlap detection logic and cause mkimage to fail with an appropriate error message. Test verifies: - mkimage returns non-zero exit code when overlap is detected - Error message contains "Error: Overlap detected:" - Error message identifies the specific overlapping components (kernel@1 and fdt@1) This test ensures the overlap detection feature works correctly and prevents deployment of FIT images with conflicting memory layouts that could cause runtime failures. Signed-off-by: Aristo Chen <[email protected]>
2025-09-12mkimage: Add support for bundling TFA BL31 in mkimage -f autoMarek Vasut
Introduce two new parameters to be used with mkimage -f auto to bundle TFA BL31 image into fitImage, using auto-generated fitImage. Add -y to specify TFA BL31 file name and -Y to specify TFA BL31 load and entry point address. This is meant to be used with systems which boot all of TFA BL31, Linux and its DT from a single fitImage, all booted by U-Boot. Example invocation: " $ mkimage -E -A arm64 -C none -e 0x50200000 -a 0x50200000 -f auto \ -d arch/arm64/boot/Image \ -b arch/arm64/boot/dts/renesas/r8a779g3-sparrow-hawk.dtb \ -y ../tfa/build/rcar_gen4/release/bl31.bin -Y 0x46400000 \ /path/to/output/fitImage " Documentation update and test are also included, the test validates both positive and negative test cases, where fitImage does not include TFA BL31 and does include TFA BL31 blobs. Signed-off-by: Marek Vasut <[email protected]>
2025-08-18test/py: Fix capsule update testsIlias Apalodimas
Capsule updates tests have been skipped since commit 659f97eb1fc3 ("scripts/Makefile.lib: EFI: Use capsule CRT instead of ESL file") Remove that check since it's not needed anymore and re-enable the tests. Fixes: 659f97eb1fc3 ("scripts/Makefile.lib: EFI: Use capsule CRT instead of ESL file") Signed-off-by: Ilias Apalodimas <[email protected]>