summaryrefslogtreecommitdiff
path: root/test
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]>
4 daysdm: Respect dma-ranges sizeMarek Vasut
Rework dev_phys_to_bus() and dev_bus_to_phys() to respect the size of the area specified in dma-ranges DT property. The area outside of ranges is remapped 1:1, while the area in the ranges is remapped according to the description in the dma-ranges property. Adjust the test to test the area within the remapped range, not area outside the remapped range, which was incorrect. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Markus Schneider-Pargmann <[email protected]>
5 daysMerge branch 'next'Tom Rini
9 dayscmd: test: add bug-compatibility special case for 'test -n'Rasmus Villemoes
It turns out that there is lots of code in the wild, including in the U-Boot tree itself, which used to rely on test -n $somevar to yield false when $somevar is not defined or empty. See for example all the occurrences of 'test -n $fdtfile'. That was really only a quirk of the implementation that refused calls with argc < 3, and not because it was interpreted as test -n "$somevar" which is how this should be spelled. While not exactly conforming to POSIX, we can accomodate such scripts by special-casing a single argument "-n" to be interpreted as if it comes from code as above with empty $somevar. Since we only just added the ability to test a string for emptiness using the single-argument form, it is very unlikely that there is code doing test "$str" which would now fail if $str happens to be exactly "-n"; such a test should really always be spelled test -n "$str" Fixes: 8b0619579b2 ("cmd: test: fix handling of single-argument form of test") Reported-by: Franz Schnyder <[email protected]> Signed-off-by: Rasmus Villemoes <[email protected]> Reviewed-by: Simon Glass <[email protected]>
12 daystest: Correct dependencies for SPL_UNIT_TESTTom Rini
As exposed by "make randconfig", we have an issue with the dependencies for SPL_UNIT_TEST. In order to test SPL_DM_DEVICE_REMOVE we also need to have ensured that SPL_DM is enabled, so select that as well. Signed-off-by: Tom Rini <[email protected]>
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-25Merge patch series "add [ as alias for test, fix 0/1 argument handling"Tom Rini
Rasmus Villemoes <[email protected]> says: Make 'test' behave a little more like its cousins in other shells, by allowing the [ ... ] spelling, and while here, fix up the handling of a single, non-empty argument to comply with POSIX. Link: https://lore.kernel.org/r/[email protected]
2026-03-25cmd: test: fix handling of single-argument form of testRasmus Villemoes
POSIX states that 0 arguments: Exit false (1). 1 argument: Exit true (0) if $1 is not null; otherwise, exit false. and at least bash and busybox sh behave that way. The current 'argc < 3' does the right thing for a non-existing or empty argv[1], but not for a non-empty argv[1]. Fix that and add corresponding test cases. Signed-off-by: Rasmus Villemoes <[email protected]> Tested-by: Anshul Dalal <[email protected]>
2026-03-25test: add tests for left-bracket alias for 'test' commandRasmus Villemoes
Duplicate a few of the existing test cases, using the [ spelling, and also ensure that the presence of a matching ] as a separate and last argument is enforced. Signed-off-by: Rasmus Villemoes <[email protected]> Tested-by: Anshul Dalal <[email protected]>
2026-03-25virtio: Fix virtio initialization sequenceChristian Pötzsch
The virtio spec clearly states in "3.1.1 Driver Requirements: Device Initialization" the sequence a client has to follow after device reset. Because u-boot resets here again, it also needs to set the "acknowledge" bit again even if this was done in virtio_uclass_child_post_bind already once before. Signed-off-by: Christian Pötzsch <[email protected]> Signed-off-by: Adam Lackorzynski <[email protected]> [trini: Add VIRTIO_CONFIG_S_ACKNOWLEDGE flag check to the test] Signed-off-by: Tom Rini <[email protected]>
2026-03-25Merge patch series "virtio: rng: Handle oversized return buffers"Tom Rini
Meet Patel <[email protected]> says: The virtio-rng test to verify effective handling of oversized return buffers checks that an (undocumented) error is raised, instead of the real concern, which is the surrounding buffer integrity following a rng function call. Update the test to check that the other contents of a buffer remain unchanged instead of looking for an error code. Link: https://lore.kernel.org/r/[email protected]
2026-03-25test: dm: virtio_rng: Update virtio-rng testKavin Gunasekara
The virtio-rng test to verify effective handling of oversized return buffers checks that an (undocumented) error is raised, instead of the real concern, which is the surrounding buffer integrity following a rng function call. Update the test to check that the other contents of a buffer remain unchanged instead of looking for an error code. Signed-off-by: Kavin Gunasekara <[email protected]> Signed-off-by: Meet Patel <[email protected]> Reviewed-by: Andre Przywara <[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-23Merge tag 'v2026.04-rc3' into nextTom Rini
Prepare v2026.04-rc3
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-17treewide: Clean up DECLARE_GLOBAL_DATA_PTR usagePeng Fan
Remove DECLARE_GLOBAL_DATA_PTR from files where gd is not used, and drop the unnecessary inclusion of asm/global_data.h. Headers should be included directly by the files that need them, rather than indirectly via global_data.h. Reviewed-by: Patrice Chotard <[email protected]> #STMicroelectronics boards and STM32MP1 ram test driver Tested-by: Anshul Dalal <[email protected]> #TI boards Acked-by: Yao Zi <[email protected]> #TH1520 Signed-off-by: Peng Fan <[email protected]>
2026-02-17test: log_filter: Include vsprintf.hPeng Fan
snprintf is used, need to include vsprintf.h. Otherwise there will be build error after asm/global_data.h is removed. Signed-off-by: Peng Fan <[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-02-07Merge patch series "Add command for getting ramsize in scripts"Tom Rini
Frank Wunderlich <[email protected]> says: Add command for getting ramsize in scripts Link: https://lore.kernel.org/r/[email protected]
2026-02-07test: cmd: add test for memsizeFrank Wunderlich
Add a test for memsize command in same way as meminfo. Signed-off-by: Frank Wunderlich <[email protected]>
2026-01-28test: dm: Add compatible multimatch testMarkus Schneider-Pargmann (TI.com)
Add a test for binding of multiple drivers with the same compatible. If one of the drivers returns -ENODEV the other one needs to be bound. Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]> Signed-off-by: Markus Schneider-Pargmann (TI.com) <[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-19test: cmd: consider configuration in meminfo testHeinrich Schuchardt
The output of the meminfo command depends on several Kconfig variables. These need to be taken into account to provide valid test results. Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2026-01-19cmd/meminfo: display of addresses above 4 GiBHeinrich Schuchardt
Addresses above 4 GiB don't fit into 8 digits. Use 13 digits which encompass up to 15 TiB. 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-07Merge patch series "test: env: Add test for environment storage in SPI NOR"Tom Rini
This patch series from Marek Vasut <[email protected]> adds support for having a platform be able to convert from a non-redundant envrionment to a redundant one at run-time. Link: https://lore.kernel.org/r/[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]>
2026-01-06test: The LMB test depends on CONFIG_LMBHeinrich Schuchardt
Many boards use CONFIG_LMB=y but not all, e.g. amd_versal2_mini_defconfig. Building this board with CONFIG_UNIT_TEST=y fails: aarch64-linux-gnu-ld: test/lib/lmb.c:411:(.text.test_noreserved+0x428): undefined reference to `lmb_free' We should be able to enable CONFIG_UNIT_TEST on any board. With this patch the LMB test is only built if LMB is enabled which overcomes the build issue. Reviewed-by: Ilias Apalodimas <[email protected]> Signed-off-by: Heinrich Schuchardt <[email protected]>
2026-01-02cmd: bdinfo: fix incorrect Kconfig options check for print_eth()Quentin Schulz
CMD_NET_LWIP has never existed so it cannot be right. I'm guessing the intent was to allow print_eth() to be called when NET_LWIP is defined (NET means "legacy networking stack" as opposed to NET_LWIP which is the newest (and incompatible) stack). There probably was some mix-up between CMD_NET and NET options. The dependency on CMD_NET seems unnecessary as it seems perfectly fine to run bdinfo without CMD_NET (build and run tested). So let's instead make the dependency on NET || NET_LWIP. Let's sync the unit test as well. Fixes: 95744d2527cb ("cmd: bdinfo: enable -e when CONFIG_CMD_NET_LWIP=y") Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Jerome Forissier <[email protected]>