summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2025-08-06test: cmd: Add simple test for i3cDinesh Maniyam
Add simple test to check i3c controller defined in sandbox test DT. Basically, this test case will check validity of the i3c controller by probing it and perform basic commands of cmd/i3c.c Signed-off-by: Dinesh Maniyam <dinesh.maniyam@altera.com>
2025-08-06drivers: i3c: Add i3c sandbox simple test.Dinesh Maniyam
Add s simple test for the I3C uclass in sandbox. Signed-off-by: Dinesh Maniyam <dinesh.maniyam@altera.com>
2025-08-04test: py: test_fit_mkimage_validate: Only run either test on sandboxTom Rini
Both of these tests are only valid for sandbox (and require dtc) so both tests need the pytest annotations. Fixes: 93d09d3bd8ea ("test: fit: add test case for invalid default configuration reference") Signed-off-by: Tom Rini <trini@konsulko.com>
2025-07-24uclass: Cleanup uclass_find_next_deviceAndrew Goodbody
uclass_find_next_device always returns 0, so instead make it a void and update calling sites. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-07-23block: Remove blk_find_first/nextGreg Malysa
In [0], Andrew noted a code quality issue in the implementation of blk_find_first and blk_find_next. This led to the observation that the logic of these functions was also likely incorrect, and based on a quick check it seemed the functions were unused outside of test code, which did not exercise the potential failure case, so we felt they should be removed. In [1], a test patch which illustrates the failure in sandbox is provided for reference. Because a more thorough check agrees that these functions are unused, they are currently incorrect, and fixed/removable flags on block devices prior to probe are unreliable, just remove these functions instead of fixing them. All potential users should have used blk_first_device_err instead anyway. CI results at [2]. [0] https://patchwork.ozlabs.org/project/uboot/patch/20250714-blk-uclass-v1-1-d21428c5f762@linaro.org/ [1] https://gist.github.com/gmalysa/b05e73a5c14bc18c5741a0e0e06a2992 [2] https://gitlab.com/gmalysa/lnxdsp-u-boot/-/pipelines/1931210857 Signed-off-by: Greg Malysa <malysagreg@gmail.com> Reviewed-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-07-23abuf: Remove code that prevented test code runningAndrew Goodbody
When abuf was introduced some test code was prevented from running using a 'return 0' early in the functions. A comment said it crashed on sandbox due to a 'bug' in realloc. Some time later a bug in abuf_realloc was fixed but this test code was never enabled. Remove the early 'return 0' instances so that the test code can run. Also remove some checks that relied on the implementation details of the U-Boot memory code as these can fail on sandbox which uses system memory code. Besides that this code should be testing abuf implementation not the underlying memory code which has its own tests. Finally use a new #define for the allocs that are meant to fail to ensure they do fail on all CI platforms. This issue found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-07-23test: fit: add test case for invalid default configuration referenceAristo Chen
Recent changes to mkimage introduced a validation step to ensure that the 'default' property under the /configurations node in a FIT image references a valid configuration subnode. If the referenced node is missing, mkimage will now return an error. This patch adds a Python test case to verify that mkimage correctly fails when the 'default' configuration does not exist. The test creates a minimal ITS with an invalid default reference and checks that mkimage produces the expected error message. Signed-off-by: Aristo Chen <aristo.chen@canonical.com>
2025-07-11Merge patch series "Create uclass for HW AES cryptographic devices"Tom Rini
Svyatoslav Ryhel <clamor95@gmail.com> says: Add uclass for HW AES cryptographic devices found on some devices, like Tegra20/Tegra30 SoC AES engine. Link: https://lore.kernel.org/r/20250629105711.24687-1-clamor95@gmail.com
2025-07-11test: dm: add AES engine testSvyatoslav Ryhel
Create a basic test suit for AES DM uclass that covers all available operations. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2025-07-10post: Add dependency on ARM || PPCTom Rini
The post framework requires architecture specific implementation details. At the moment this is only done for ARM and PowerPC so express that requirement in Kconfig as well. Signed-off-by: Tom Rini <trini@konsulko.com>
2025-07-08cmd: Introduce CMD_HELPMichal Simek
Add option to disable help command in size constrained systems to save some space. There is also no need to have ifdefs around CMDLINE because all commands depends on it. And also mark cmd_help dependency in test_help.py. Reviewed-by: Peter Robinson <pbrobinson@gmail.com> Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org> Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/c17f825fb8a74e1d1912a3fd09a9a880c84a8bfd.1751286059.git.michal.simek@amd.com
2025-07-03test: wget: add a test case for validating URISughosh Ganu
The wget module has a function wget_validate_uri() which is used for validating the URI to be used by wget. Add a basic test case for this function. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-06-27test/py/test_mmc: wrap multi-argument printf-style stringsBryan Brattlof
Newer versions of python will emit a TypeError about not enough arguments for a format string: FAILED ub/test/py/tests/test_mmc.py::test_mmc_dev - TypeError: not enough arguments for format string FAILED ub/test/py/tests/test_mmc.py::test_mmcinfo - TypeError: not enough arguments for format string FAILED ub/test/py/tests/test_mmc.py::test_mmc_info - TypeError: not enough arguments for format string FAILED ub/test/py/tests/test_mmc.py::test_mmc_rescan - TypeError: not enough arguments for format string FAILED ub/test/py/tests/test_mmc.py::test_mmc_part - TypeError: not enough arguments for format string Add parentheses around all multi argument format strings so all arguments will be passed to the format string Signed-off-by: Bryan Brattlof <bb@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2025-06-26Merge patch series "sandbox: enable CONFIG_CMD_BOOTEFI_SELFTEST by default"Tom Rini
Heinrich Schuchardt <heinrich.schuchardt@canonical.com> says: The sandbox is used for a lot of generic development, we should run the UEFI tests there, too. The TPM emulation on the sandbox is incomplete. Disable the TCG test on sandbox. Link: https://lore.kernel.org/r/20250617061945.9266-1-heinrich.schuchardt@canonical.com
2025-06-26test: disable TCG test on sandboxHeinrich Schuchardt
The TPM emulation on the sandbox is incomplete. Even basic tcg2 functionality like get_capability() fails: lib/efi_selftest/efi_selftest_tcg2.c(886): ERROR: get_manufacturer_id buffer too small failed Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
2025-06-26Merge patch series "sandbox: align LMB memory"Tom Rini
Heinrich Schuchardt <heinrich.schuchardt@canonical.com> says: To implement the EFI_SYSTEM_TABLE_POINTER we need 4 MiB aligned memory. On the sandbox LMB uses addresses relative to the start of a page aligned RAM buffer allocated with mmap(). This leads to a mismatch of alignment between EFI which uses pointers and LMB which uses phys_addr_t. Ensure that the RAM buffer used for LMB is 4 MiB aligned. Provide a unit test for efi_alloc_aligned_pages() verifying this alignment. Do not overwrite RAM size in dram_init(). Link: https://lore.kernel.org/r/20250608075428.32631-1-heinrich.schuchardt@canonical.com
2025-06-26test: unit test for efi_alloc_aligned_pages()Heinrich Schuchardt
Provide unit tests for efi_alloc_aligned_pages() and efi_allocate_pages(). Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-06-26Merge patch series "mkimage: validate image references in FIT configurations"Tom Rini
Aristo Chen <jj251510319013@gmail.com> says: This series introduces a validation step in mkimage to ensure that all image names referenced under the /configurations node of a FIT source (ITS) are actually defined under the /images node. ### Motivation When using mkimage to build FIT images, it's easy to mistakenly reference nonexistent image nodes in configurations (e.g., referencing a missing `fdt` or `firmware` node). Such issues are often not caught until runtime in U-Boot. This series aims to catch these errors early during FIT image creation by validating the configuration references in mkimage itself. Link: https://lore.kernel.org/r/20250610074121.8308-1-aristo.chen@canonical.com
2025-06-26test: py: add mkimage test for undefined image references in FIT configsAristo Chen
Add a test case to verify that mkimage correctly rejects a FIT source that references a non-existent image from a configuration node. This test introduces a minimal ITS that defines a valid kernel image but references a missing "fdt" image under the /configurations section. The test asserts that mkimage fails with a clear error message, as introduced in the new validation logic. This helps ensure the validation logic behaves correctly and prevents regressions in future FIT enhancements. Signed-off-by: Aristo Chen <aristo.chen@canonical.com>
2025-06-25Merge patch series "lmb: use a single API for all allocations"Tom Rini
Sughosh Ganu <sughosh.ganu@linaro.org> says: The LMB module has a bunch for API's which are used for allocating memory. There are a couple of API's for requesting memory, and two more for reserving regions of memory. Replace these different API's with a single one, lmb_alloc_mem(). The type of allocation to be made is specified through one of the parameters to the function. Additionally, the two API's for reserving regions of memory, lmb_reserve() and lmb_alloc_addr() are the same with one difference. One can reserve any memory region with lmb_reserve(), while lmb_alloc_addr() actually checks that the memory region being requested is part of the LMB memory map. Reserving memory that is not part of the LMB memory map is pretty futile -- the allocation functions do not allocate memory which has not been added to the LMB memory map. This series also removes the functionality allowing for reserving memory regions outside the LMB memory map. Any request for reserving a region of memory outside the LMB memory map now returns an -EINVAL error. Certain places in the common code using the LMB API's were not checking the return value of the functions. Checks have been added for them. There are some calls being made from the architecture/platform specific code which too do not check the return value. Those have been kept the same, as I do not have the platform with me to check if it causes any issues on those platforms. In addition, there is a patch which refactors code in lmb_overlaps_region() and lmb_can_reserve_region() so that both functionalities can be put in a single function, lmb_overlap_checks(). Finally, a new patch has been added which checks the return value of the lmb allocation function before copying the device-tree to the allocated address. Link: https://lore.kernel.org/r/20250617104346.1379981-1-sughosh.ganu@linaro.org [trini: Rework arch/arm/mach-snapdragon/board.c merge] Signed-off-by: Tom Rini <trini@konsulko.com>
2025-06-25lmb: use a single function to free up memorySughosh Ganu
There is no need to have two separate API's for freeing up memory. Use a single API lmb_free() to achieve this. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-06-25lmb: replace the lmb_alloc() and lmb_alloc_base() API'sSughosh Ganu
There currently are two API's for requesting memory from the LMB module, lmb_alloc() and lmb_alloc_base(). The function which does the actual allocation is the same. Use the earlier introduced API lmb_alloc_mem() for both types of allocation requests. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-06-25lmb: replace lmb_reserve() and lmb_alloc_addr() API'sSughosh Ganu
There currently are multiple allocation API's in the LMB module. There are a couple of API's for allocating memory(lmb_alloc() and lmb_alloc_base()), and then there are two for requesting a reservation for a particular memory region (lmb_reserve() and lmb_alloc_addr()). Introduce a single API lmb_alloc_mem() which will cater to all types of allocation requests and replace lmb_reserve() and lmb_alloc_addr() with the new API. Moreover, the lmb_reserve() API is pretty similar to the lmb_alloc_addr() API, with the one difference being that the lmb_reserve() API allows for reserving any address passed to it -- the address need not be part of the LMB memory map. The lmb_alloc_addr() does check that the address being requested is actually part of the LMB memory map. There is no need to support reserving memory regions which are outside the LMB memory map. Remove the lmb_reserve() API functionality and use the functionality provided by lmb_alloc_addr() instead. The lmb_alloc_addr() will check if the requested address is part of the LMB memory map and return an error if not. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-06-23Merge tag 'v2025.07-rc5' into nextTom Rini
Prepare v2025.07-rc5 With this merge, tighten up the LTO_FLAGS removal we added to not trigger on ARMv7 (which is Thumb-2 and should be fine).
2025-06-17test/py: tests: gpt: add test_gpt_write_part_typePatrick Delaunay
Add sandbox test on gpt command with partition type for known type. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2025-06-17lib/uuid.c: restore support of system partition type for ESPPatrick Delaunay
Add support of optional shortname for parameter 'type' of gpt command (limited by UUID_STR_LEN) and a separate 'description' for UID format "%pUs" used in 'part list' output. When 'description' is absent in list_guid[], the optional shortname is used as fallback. Many partition types for EFI have no shortcut yet, but only description as they are only used to display information. This patch also restores the "system" as short name for EFI System Partition (ESP). Fixes: d54e1004b8b1 ("lib/uuid.c: use unique name for PARTITION_SYSTEM_GUID") Tested-by: Patrice Chotard <patrice.chotard@foss.st.com> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2025-06-16Merge tag 'u-boot-dfu-next-20250616' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-dfu into next u-boot-dfu-next-20250616 CI: https://source.denx.de/u-boot/custodians/u-boot-dfu/-/pipelines/26704 Usb gadget: - Fix ti_musb driver in gadget mode (with DM_USB_GADGET) DFU: - mmc/scsi backends when using 10 or more partitions
2025-06-12test/py: Correct handling of exceptionsSimon Glass
If an Unexpected exception is thrown in a test, an undefined variable error is reported. Fix this. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 85d7dae377a ("test: Detect dead connections") Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2025-06-12test/py: Use the correct fixture name in exception handlerSimon Glass
If a BootFail exception is thrown in a test, it is not handled correctly. Use the correct fixture variable 'ubman_fix' to resolve this. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: d9ed4b75add ("test/py: Drop u_boot_ prefix on test files") Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2025-06-11Merge tag 'u-boot-stm32-20250611' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-stm into next CI: https://source.denx.de/u-boot/custodians/u-boot-stm/-/pipelines/26607 - Add clock and reset drivers support for STM32MP25 - Add STM32H747-Discovery board support - Add tamp_nvram driver - Add SPL support and clock tree init to STM32MP13 RCC driver - Add STM32MP13xx ram support - Add support for STM32 Image V2.0 for STM32MP13xx - Fix SYSRAM size on STM32MP13xx - Fix DBGMCU macro on STM32MP13xx - Auto-detect ROM API table on STM32MP15xx
2025-06-11sandbox: test: update for CONFIG_CLK_AUTO_ID supportPatrick Delaunay
Update the existing test dm_test_clk_ccf() with new CLK_ID macro. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Lukasz Majewski <lukma@denx.de> Cc: Sean Anderson <seanga2@gmail.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2025-06-10test: tpm: Skip failing tests on coralSimon Glass
These tests have been failing for some months. Disable them so that a CI run can pass on coral. Further work will be needed to see how to make them pass. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-06-10tpm: Drop unwanted special cases for sandboxSimon Glass
These don't seem to be needed. Add a few notes about what to do next. Also mention parallel tests in at the top of thefile. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-06-10tpm: Convert sandbox-focussed tests to CSimon Glass
Some of the Python tests are a pain because they don't reset the TPM state before each test. Driver model tests do this, so convert the tests to C. This means that these tests won't run on real hardware, but we have tests which do TPM init, so there is still enough coverage. Rename and update the Python tpm_init test to use 'tpm autostart', since this fully initializes the TPM and performs the self tests. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-30expo: Drop the special theme code for bootflow_menuSimon Glass
The expo now has all that is needed to apply a suitable theme, so drop this unnecessary code. Any further tweaks can be added to the generic expo code. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Improve the visual appearance of the menuSimon Glass
The menu is currently quite basic. Make use of some recently added features in expo, to: - Show proper prompts - Highlight the current item - Centre text - Use multi-line text instead of two independent lines - Put a box around the items Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Support highlighting menu itemsSimon Glass
Expo normally uses a pointer to show the current item. Add support for highlighting as well, since this makes it easier for the user to see the current item. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Begin implementation of a text editorSimon Glass
It is useful to be able to edit text, e.g. to allow the user to edit the environment or the command-line arguments for the OS. Add the beginnings of an implementation. Future work is needed to finish this: keypress handling and scrolling. For now it just displays the text. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Support object alignmentSimon Glass
Add support for left, right and centred alignment for text, in the horizontal dimension. Also support top, bottom and centred in the vertical dimension, for the text object as a whole. Alignment is not yet implemented for images. It has no meaning for menus. A textline object uses a text object internally, so alignment is supported there. Provide some documentation to explain how objects are positioned. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Implement a boxSimon Glass
It is useful to be able to draw a box around elements in the menu. Add support for an unfilled box with a selectable thickness. Note that there is no support for selecting the colour for any expo objects yet. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Support rendering multiple lines of textSimon Glass
Use the measurement info to write each line of text separately, thus respecting word-wrapping and newlines. Fix up the comment for scene_obj_render() while we are here. Since a lineedit does not support alignment, add a special case to just display the text if there is no measurement. This happens assuming the lineedit is initially empty. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Check the screen contents after renderingSimon Glass
Make sure that the screen contents are as expected when a scene has been rendered. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Allow strings to be editableSimon Glass
In some cases dynamic text is needed, e.g. for a menu countdown. Add a function which handles this, allowing the caller to take control of the text that is shown on each render. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Create a struct for generic text attributesSimon Glass
In preparation for adding more text types, refactor the common fields into a new structure. This will allow common code to be used. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Line up all menu objectsSimon Glass
At present labels are lined up vertically. Do the same with keys and descriptions, since it looks nicer. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Support setting the size and bounds of an objectSimon Glass
Add a function to allow the size of an object to be set independently of its position. Also add a function to permit the object's bounding box to be set independently of its dimensions. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Separate dimensions from the bounding boxSimon Glass
At present each object has a width and height and the bounding box is implicit in that. This is not flexible enough to handle objects which are larger than their contents might need. For example, when centring a text object we might want to have it stretch across the whole width of the display even if the text itself does not need that much space. Create a new 'dimensions' field and convert the existing width/height into x1/y1 coordinates. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Rename x and y in struct scene_obj_bboxSimon Glass
These coordinates are the top left values, so rename them to x0 and y0 in preparation for changing the width and height to x1 and y1 Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Rename scene_dim to scene_obj_bboxSimon Glass
At present we assume that each object is a simple box and that it fills the whole box. This is quite limiting for text objects, which we may want to centre within the box. We need a position within the box where drawing starts. Rename the scene_dim struct to indicate that it is a bounding box. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-30expo: Split bootflow_menu_new() into two piecesSimon Glass
Split the iteration piece of this function into bootflow_menu_add_all() so that it is possible for the caller to be in control of adding items to the menu. Move the expo_destroy() call into the caller. Signed-off-by: Simon Glass <sjg@chromium.org>