aboutsummaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
...
| * tests: gpt: Remove test order dependencyJoshua Watt2023-09-111-12/+8
| | | | | | | | | | | | | | Re-create a clean disk image for each test to prevent modifications from one test affecting another Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
| * test: print: Fix hexdump test on 64bit systemsMarek Vasut2023-09-061-14/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | Use the following regex to make this test compatible with both 32bit and 64bit systems. The trick is to use %0*lx format string for the address prefix in the test. " s@\(ut_assert_nextline("\)0\+\([^:]\+\)\(:.*"\)\();\)@\1%0*lx\3, IS_ENABLED(CONFIG_PHYS_64BIT) ? 16 : 8, 0x\2UL\4 " Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
| * test: dm: test-fdt: Use fdtdec_get_int() in dm_check_devices()Marek Vasut2023-09-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The current fdtdec_get_addr() takes into consideration #address-cells and #size-cells for "ping-expect" property which is clearly neither. Use fdtdec_get_int() instead and return negative one in case the property is not in DT or the platform under test is not DT based, i.e. mimic the current fdtdec_get_addr() behavior. This fixes ut dm dm_test_bus_children test. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
| * Merge tag 'v2023.10-rc4' into nextTom Rini2023-09-041-2/+2
| |\ | | | | | | | | | Prepare v2023.10-rc4
| * | event: Convert existing spy records to simpleSimon Glass2023-08-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Very few of the existing event-spy records use the arguments they are passed. Update them to use a simple spy instead, to simplify the code. Where an adaptor function is currently used, remove it where possible. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | initcall: Support emitting eventsSimon Glass2023-08-311-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present the initcall list consists of a list of function pointers. Over time the initcall lists will likely change to mostly emitting events, since most of the calls are board- or arch-specific. As a first step, allow an initcall to be an event type instead of a function pointer. Add the required macro and update initcall_run_list() to emit an event in that case, or ignore it if events are not enabled. The bottom 8 bits of the function pointer are used to hold the event type, with the rest being all ones. This should avoid any collision, since initcalls should not be above 0xffffff00 in memory. Convert misc_init_f over to use this mechanism. Add comments to the initcall header file while we are here. Also fix up the trace test to handle the change. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | event: Support a simple spy recordSimon Glass2023-08-312-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current event spy is always passed the event context and the event. The context is always NULL for a static spy. The event is not often used. Introduce a 'simple' spy which takes no arguments. This allows us to drop the adaptation code that many of these spy records use. Update the event script to find these in the image. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | drivers/mtd/nvmxip: Move sandbox_set_enable_memio() to testMarek Vasut2023-08-301-0/+2
| | | | | | | | | | | | | | | | | | | | | The sandbox_set_enable_memio() should only ever be set during sandbox testing, not within driver itself, move it back to test/ . Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
| * | fwu: Initialize global fwu library state during CI testMarek Vasut2023-08-301-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current CI test worked by sheer luck, the g_dev global pointer in the fwu library was never initialized and the test equally well failed on sandbox64. Trigger the main loop in sandbox tests too to initialize that global state, and move the sandbox specific exit from fwu_boottime_checks after g_dev is initialized. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Acked-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | test: capsule: Remove logic to add public key ESLSughosh Ganu2023-08-292-20/+4
| | | | | | | | | | | | | | | | | | | | | | | | The public key EFI Signature List(ESL) needed for capsule authentication is now embedded into the platform's DTB as part of the build. Remove the superfluous logic from the test setup. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
| * | sandbox: trace: Increase trace buffer sizeSughosh Ganu2023-08-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When running the trace test on the sandbox platform, the current size of 16MiB is no longer large enough for capturing the entire trace history, and results in truncation. Use a size of 32MiB for the trace buffer on the sandbox platform while running the trace test. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | test: capsule: Generate EFI capsules through binmanSughosh Ganu2023-08-293-174/+346
| | | | | | | | | | | | | | | | | | | | | | | | Support has been added for generating the EFI capsules through binman. Make changes in the EFI capsule update testing feature to generate capsules through binman. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
| * | bootstd: cros: Allow detection of any kernel partitionSimon Glass2023-08-261-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing ChromiumOS bootmeth only supports reading a single kernel partition, either 2 or 4. In fact there are normally two options available. Use the GUID to detect kernel partitions, with the BOOTMETHF_ANY_PART flag, so that bootstd does not require a valid filesystem before calling the bootmeth. Tidy up and improve the logging while we are here. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> [trini: Add missing select of PARTITION_TYPE_GUID] Signed-off-by: Tom Rini <trini@konsulko.com>
| * | bootstd: Add a test for bootmeth_crosSimon Glass2023-08-252-2/+173
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ChromiumOS bootmeth has no tests at present. Before adding more features. add a basic test. This creates a disk which can be scanned by the bootmeth, so make sure things work. It is quite rudimentary, since the kernel is faked, the root disk is missing and there is no cmdline stored. Enable the bootmeth for snow so it can build the unit test. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | bootstd: test: Allow binding and using any mmc deviceSimon Glass2023-08-251-6/+22
| | | | | | | | | | | | | | | | | | | | | We currently use mmc4 for tests. Update the function which sets this up so that it can handle any device. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | bootflow: Show an empty filename when there is noneSimon Glass2023-08-251-10/+12
| | | | | | | | | | | | | | | | | | | | | At present 'bootflow list' shows <NULL> for the filename when it is not present. Show an empty string instead, since that is more user-friendly. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | test: Move 1MB.fat32.img and 2MB.ext2.imgSimon Glass2023-08-253-26/+30
| | | | | | | | | | | | | | | | | | | | | | | | These are currently created in the source directory, which is not ideal. Move them to the persistent-data directory instead. Update the test so skip validating the filename, since it now includes a full path. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | expo: cedit: Support reading settings from CMOS RAMSimon Glass2023-08-251-0/+11
| | | | | | | | | | | | | | | | | | | | | Add a command to read edit settings from CMOS RAM, using the cedit definition to indicate which registers and bits are used. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | expo: cedit: Support writing settings to CMOS RAMSimon Glass2023-08-252-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | Add a command to write cedit settings to CMOS RAM so that it can be preserved across a reboot. This uses a simple bit-encoding, where each field has a 'bit position' and a 'bit length' in the schema. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | expo: cedit: Support reading settings from environment varsSimon Glass2023-08-251-1/+11
| | | | | | | | | | | | | | | | | | | | | Add a command to read cedit settings from environment variables so that they can be restored as part of the environment. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | expo: cedit: Support writing settings to environment varsSimon Glass2023-08-251-0/+33
| | | | | | | | | | | | | | | | | | | | | Add a command to write cedit settings to environment variables so that they can be stored with 'saveenv'. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | expo: cedit: Support reading settings from a fileSimon Glass2023-08-251-3/+19
| | | | | | | | | | | | | | | | | | Add a command to read cedit settings from a devicetree file. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | expo: cedit: Support writing settings to a fileSimon Glass2023-08-251-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | Support writing settings from an expo into a file in FDT format. It consists of a single node with a two properties for each sceneitem, one with tag ID chosen by the user and another for its text value. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | expo: Tidy up the expo.py tool and usageSimon Glass2023-08-253-23/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tidy up this tool a little: - define which arguments are needed - split the enum values out into a header file - warn if no enum values are found - display the dtc error if something goes wrong - avoid a Python traceback on error Signed-off-by: Simon Glass <sjg@chromium.org>
| * | expo: Move cedit test into its own file and tidySimon Glass2023-08-253-43/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move this test out so it can have its own file. Rename the test to use a cedit_ prefix. This allows us to drop the check for CONFIG_CMD_CEDIT in the test. Also we don't need driver model objects for this test, so drop them. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | expo: Provide a way to iterate through all scene objectsSimon Glass2023-08-251-0/+45
| | | | | | | | | | | | | | | | | | | | | For some operations it is necessary to process all objects in an expo. Provide an iterator to handle this. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | abuf: Allow incrementing the sizeSimon Glass2023-08-251-0/+25
| | | | | | | | | | | | | | | | | | Provide a convenience function to increment the size of the abuf. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | test: acpi: Handle both 32bit and 64bit ACPI tablesMarek Vasut2023-08-221-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handle both 32bit and 64bit systems, i.e. sandbox and sandbox64 the same way drivers/cpu/cpu_sandbox.c sets those ACPI tables up. This fixes "$ ./u-boot -Tc 'ut dm dm_test_acpi_write_tables'" test failure on sandbox64. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | test: Fix the help for the ut commandMarek Vasut2023-08-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Drop the 'ut' prefix, this is superfluous and not present in any of the other ut tests. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | Merge tag 'v2023.10-rc3' into nextTom Rini2023-08-218-43/+392
| |\ \ | | | | | | | | | | | | | | | | | | | | Prepare v2023.10-rc3 Signed-off-by: Tom Rini <trini@konsulko.com>
| * | | test: unit test for semihostingHeinrich Schuchardt2023-08-142-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide a unit test for semihosting testing reading and writing a file. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Sean Anderson <sean.anderson@seco.com>
| * | | test: fix a couple NULL vs IS_ERR() checksDan Carpenter2023-08-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The x509_cert_parse() and pkcs7_parse_message() functions return error pointers. They don't return NULL. Update the checks accordingly. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | | test: unicode: fix a sizeof() vs ARRAY_SIZE() bugDan Carpenter2023-08-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The u16_strlcat() is in units of u16 not bytes. So the limit needs to be ARRAY_SIZE() instead of sizeof(). Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
| * | | lib/charset: fix u16_strlcat() return valueMatthias Schiffer2023-08-081-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | strlcat returns min(strlen(dest), count)+strlen(src). Make u16_strlcat's behaviour the same for consistency. Fixes: eca08ce94ceb ("lib/charset: add u16_strlcat() function") Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
| * | | Revert "lib: string: Fix strlcpy return value", fix callersMatthias Schiffer2023-08-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both the Linux kernel and libbsd agree that strlcpy() should always return strlen(src) and not include the NUL termination. The incorrect U-Boot implementation makes it impossible to check the return value for truncation, and breaks code written with the usual implementation in mind (for example, fdtdec_add_reserved_memory() was subtly broken). I reviewed all callers of strlcpy() and strlcat() and fixed them according to my understanding of the intended function. This reverts commit d3358ecc54be0bc3b4dd11f7a63eab0a2842f772 and adds related fixes. Fixes: d3358ecc54be ("lib: string: Fix strlcpy return value") Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Sean Anderson <sean.anderson@seco.com>
* | | | test: build dependency for event unit testsHeinrich Schuchardt2023-09-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test_event_base and test_event_probe unit tests use function event_register() which depends on CONFIG_EVENT_DYNAMIC=y. Fixes: 7d02645fe4c0 ("event: Add a simple test") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | | | nokia_rx51: Remove platformTom Rini2023-09-041-420/+0
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | This platform is behind on migrations (it is the sole user of the oldest legacy version of the USB gadget stack and is long overdue for migration) and with Pali no longer being a maintainer, we remove this platform. Signed-off-by: Tom Rini <trini@konsulko.com>
* | | bootstd: Adjust the default bootmeth orderSimon Glass2023-08-281-2/+2
| |/ |/| | | | | | | | | | | | | | | | | | | The existing distro scripts check extlinux and scripts before EFI. Adjust the default ordering to do the same, to avoid breaking existing flows. Add some documentation, mentioning that this order will likely change in future. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Da Xue <da@libre.computer>
* | test: cpu: Handle both 32bit and 64bit CPUsMarek Vasut2023-08-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | Handle both 32bit and 64bit systems, i.e. sandbox and sandbox64 the same way drivers/cpu/cpu_sandbox.c does, that is in case CONFIG_PHYS_64BIT is enabled, assume 64bit address width, else assume 32bit address width. This fixes ut_dm_dm_test_cpu test failure on sandbox64. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* | test: dm: pinmux: Handle %pa in pinctrl-single mux outputMarek Vasut2023-08-201-41/+51
| | | | | | | | | | | | | | | | | | The pinctrl-single driver uses %pa to print register value in its single_get_pin_muxing() output. Handle this properly in the test based on CONFIG_PHYS_64BIT . Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* | arm_ffa: introduce armffa commandAbdellatif El Khlifi2023-08-082-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide armffa command showcasing the use of the U-Boot FF-A support armffa is a command showcasing how to invoke FF-A operations. This provides a guidance to the client developers on how to call the FF-A bus interfaces. The command also allows to gather secure partitions information and ping these partitions. The command is also helpful in testing the communication with secure partitions. For more details please refer to the command documentation [1]. A Sandbox test is provided for the armffa command. [1]: doc/usage/cmd/armffa.rst Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com> Reviewed-by: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com> Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org> Cc: Jens Wiklander <jens.wiklander@linaro.org> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
* | arm_ffa: introduce sandbox test cases for UCLASS_FFAAbdellatif El Khlifi2023-08-082-1/+263
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add functional test cases for the FF-A support These tests rely on the FF-A sandbox emulator and FF-A sandbox driver which help in inspecting the FF-A communication. Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com> Reviewed-by: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com> Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org> Cc: Jens Wiklander <jens.wiklander@linaro.org> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
* | lib: uuid: introduce testcase for uuid_str_to_le_binAbdellatif El Khlifi2023-08-082-0/+42
|/ | | | | | | | provide a test case Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com> Reviewed-by: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com>
* Revert "Merge branch '2023-07-24-introduce-FF-A-suppport'"Tom Rini2023-07-246-340/+1
| | | | | | | | | This reverts commit d927d1a80843e1c3e2a3f0b8f6150790bef83da1, reversing changes made to c07ad9520c6190070513016fdb495d4703a4a853. These changes do not pass CI currently. Signed-off-by: Tom Rini <trini@konsulko.com>
* arm_ffa: introduce armffa command Sandbox testAbdellatif El Khlifi2023-07-242-0/+35
| | | | | | | | | | Add Sandbox test for the armffa command Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com> Reviewed-by: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com> Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org> Cc: Jens Wiklander <jens.wiklander@linaro.org>
* arm_ffa: introduce sandbox test cases for UCLASS_FFAAbdellatif El Khlifi2023-07-242-1/+263
| | | | | | | | | | | | | | Add functional test cases for the FF-A support These tests rely on the FF-A sandbox emulator and FF-A sandbox driver which help in inspecting the FF-A communication. Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com> Reviewed-by: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com> Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org> Cc: Jens Wiklander <jens.wiklander@linaro.org> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
* lib: uuid: introduce testcase for uuid_str_to_le_binAbdellatif El Khlifi2023-07-242-0/+42
| | | | | | | | provide a test case Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com> Reviewed-by: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com>
* sandbox: fix a compilation errorSergei Antonov2023-07-201-0/+1
| | | | | | | | | | | | | | | | | | | | | With sandbox and sandbox64 configurations: In file included from .../u-boot/include/test/test.h:156, from .../u-boot/include/test/lib.h:9, from .../u-boot/test/lib/test_crc8.c:8: .../u-boot/arch/sandbox/include/asm/test.h: In function ‘sandbox_sdl_set_bpp’: .../u-boot/arch/sandbox/include/asm/test.h:323:17: error: ‘ENOSYS’ undeclared (first use in this function) 323 | return -ENOSYS; | ^~~~~~ Per Tom Rini's suggestion: move that function prototype over to arch/sandbox/include/asm/sdl.h and make test/dm/video.c include <asm/sdl.h> Cc: Simon Glass <sjg@chromium.org> Suggested-by: Tom Rini <trini@konsulko.com> Signed-off-by: Sergei Antonov <saproj@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* test: avoid function name 'setup'Heinrich Schuchardt2023-07-205-24/+24
| | | | | | | | | | | | | | | | | | pytest 7.3.2 treats the function name 'setup' as a fixture [1]. This leads to errors like: TypeError: setup() missing 2 required positional arguments: 'disk_img' and 'osindications' Rename setup() to capsule_setup(). [1] How to run tests written for nose https://docs.pytest.org/en/7.3.x/how-to/nose.html Fixes: 482ef90aeb4c ("test: efi_capsule: refactor efi_capsule test") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* dm: test: Add test for part_get_info_by_typeJoshua Watt2023-07-171-0/+87
| | | | | | | | | | Adds a test suite to ensure that part_get_info_by_type works correctly by creating a hybrid GPT/MBR partition table and reading both. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> [trini: Add this on the other sandbox configs] Signedd-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>