aboutsummaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
2024-05-22include: Move snprintf to stdio.hRaymond Mao2-1/+2
Move snprintf to stdio.h since it is needed by exteranl libraries. Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-05-08test/py: Make the number of SPL banners seen a variableWIP/08May2024-nextTom Rini1-11/+4
Currently we have the option to tell the console code that we should ignore the SPL banner. We also have an option to say that we can see it a second time, and ignore it. However, some platforms such as TI AM64x will have us see the SPL banner three times. Rather than add an "spl3_skipped" option, rework the code. By default we expect to see the banner once, but boards can specify seeing it as many times as they expect to. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-06test: Remove <common.h> and add needed includesTom Rini196-196/+9
Remove <common.h> from all "test/" files and when needed add missing include files directly. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-05rng: Introduce SPL_DM_RNGMarek Vasut1-1/+1
Add SPL variant of DM_RNG so that the DM_RNG can be disabled in SPL if necessary. This may be necessary due to e.g. size constraints of the SPL. Signed-off-by: Marek Vasut <marex@denx.de>
2024-05-01efi_loader: improve error handling in try_load_entry()Heinrich Schuchardt3-22/+22
The image is not unloaded if a security violation occurs. If efi_set_load_options() fails, we do not free the memory allocated for the optional data. We do not unload the image. * Unload the image if a security violation occurs. * Free load_options if efi_set_load_options() fails. * Unload the image if efi_set_load_options() fails. Fixes: 53f6a5aa8626 ("efi_loader: Replace config option for initrd loading") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-04-18test: py: add optee_rpmb testsIgor Opaniuk1-0/+20
Add read/write tests for optee_rpmb cmd. Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-04-17test: typo currenHeinrich Schuchardt1-3/+3
Fix typos in test_eficonfig.py: %s/curren/current/ Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Igor Opaniuk <igor.opaniuk@gmail.com>
2024-04-12disk: simplify print_part_header()Heinrich Schuchardt1-1/+1
Using uclass_get_name() reduces the code size. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-04-12test: remove unused import from pkg_resourcesHeinrich Schuchardt1-1/+0
load_entry_point is not used. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-04-08boot: correct finding the default EFI binaryHeinrich Schuchardt1-1/+3
* The sandbox must not use an arbitrary file name bootsbox.efi but the file name matching the host architecture to properly boot the respective file. We already have an include which provides a macro with the name of the EFI binary. Use it. * The path to the EFI binary should be absolute. * The path and the file name must be capitalized to conform to the UEFI specification. This is important when reading from case sensitive file systems. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Tested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-04-08boot: correct the default sequence of boot methodsHeinrich Schuchardt1-1/+1
The default sequence of boot methods is determined by alphabetical sorting during linkage. * efi_mgr must run before efi to be UEFI compliant * pxe should run as last resort Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-04-08sandbox: capsule: binman: generate some capsules as part of buildSughosh Ganu2-160/+8
Currently, all the capsules for the sandbox platform are generated at the time of running the capsule tests. To showcase generation of capsules through binman, generate all raw(non FIT payload) capsules needed for the sandbox platform as part of the build. This acts as an illustrative example for generating capsules as part of a platform's build. Make corresponding change in the capsule test's configuration to get these capsules from the build directory. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2024-03-27acpi: rename aslc_id, aslc_revisionHeinrich Schuchardt1-3/+3
The fields Creator ID and Creator Revision contain information about the tool that created an ACPI table. This may be the ASL compiler for some tables but it is not for others. Naming these fields aslc_id and aslc_revision is misleading. It is usual to see diverse values of Creator ID. On a laptop I saw these: 'AMD ', 'INTL, 'MSFT', 'PTEC'. Obviously not all relate to the Intel ASL compiler. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-03-20test: dm: add button_cmd testWIP/20Mar2024-nextCaleb Connolly1-0/+96
Add a test for the button_cmd feature. This validates that commands can be mapped to two buttons, that the correct command runs based on which button is pressed, that only 1 command is run, and that no command runs if button_cmd_0_name is wrong or unset. Additionally, fix a potential uninitialised variable use caught by these tests, the btn variable in get_button_cmd() is assumed to be null if button_get_by_label() fails, but it's actually used uninitialised in that case. CONFIG_BUTTON is now enabled automatically and was removed when running save_defconfig. Fixes: e761035b6423 ("boot: add support for button commands") Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-03-19test/py: reset: Add a test for reset commandLove Kumar1-0/+63
Add a test for reset commands which performs resetting of CPU, It does COLD reset by default and WARM reset with -w option. Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-03-19test/py: saveenv: Add a test for saveenv commandLove Kumar1-0/+137
Add test case for saveenv command in non-JTAG bootmode which saves the u-boot environment variables in persistent storage. Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-03-04bootstd: fix build error when CONFIG_MMC is disabledDan Carpenter1-0/+3
This code assumes that CONFIG_MMC and it causes a build error when the config is disabled. aarch64-linux-gnu-ld.bfd: test/boot/bootstd_common.o: in function `bootstd_test_check_mmc_hunter': test/boot/bootstd_common.c:83:(.text.bootstd_test_check_mmc_hunter+0x70): undefined reference to `_u_boot_list_2_bootdev_hunter_2_mmc_bootdev_hunter' Fixes: 66e3dce78750 ("bootstd: Allow hunting for a bootdev by label") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
2024-03-04bootflow: Fix build error when BOOTMETH_CROS is disabledDan Carpenter1-1/+1
The bootflow testing assumes that BOOTMETH_CROS is enabled but it might not be which leads to a build error. aarch64-linux-gnu-ld.bfd: test/boot/bootflow.o: in function `prep_mmc_bootdev': test/boot/bootflow.c:549:(.text.prep_mmc_bootdev+0x1c8): undefined reference to `_u_boot_list_2_driver_2_bootmeth_cros' Fixes: d08db02d2d3d ("bootstd: Add a test for bootmeth_cros") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
2024-03-02cmd: setexpr: fix no matching string in gsub return empty valueMassimiliano Minella1-0/+10
In gsub, when the destination string is empty, the string 't' is provided and the regular expression doesn't match, then the final result is an empty string. Example: => echo ${foo} => setenv foo => setexpr foo gsub e a bar => echo ${foo} => The variable ${foo} should contain "bar" and the lack of match shouldn't be considered an error. This patch fixes the erroneous behavior by removing the return statement and breaking out of the loop in case of lack of match. Also add a test for the no match case. Signed-off-by: Massimiliano Minella <massimiliano.minella@se.com>
2024-03-02test: cmd: mbr: Fix Smatch static checker warningAlexander Gendin1-1/+5
This patch fixes Smatch static checker warning: test/cmd/mbr.c:243 mbr_test_run() warn: sizeof(NUMBER)? Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Alexander Gendin <agendin@matrox.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2024-03-01test/py: net: Add dhcp abort testLove Kumar1-0/+58
Abort the dhcp request in the middle by pressing ctrl + c on u-boot prompt and validate the abort status. Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-02-29Merge patch series "Handoff bloblist from previous boot stage"Tom Rini1-5/+3
Raymond Mao <raymond.mao@linaro.org> says: This patch set adds/adapts a few bloblist APIs and implements Arm arch custom function to retrieve the bloblist (aka. Transfer List) from previous loader via boot arguments when BLOBLIST option is enabled and all boot arguments are compliant to the register conventions defined in the Firmware Handoff spec v0.9. If an arch wishes to have different behaviors for loading bloblist from the previous boot stage, it is required to implement the custom function xferlist_from_boot_arg().
2024-02-29bloblist: refactor of bloblist_reloc()Raymond Mao1-4/+2
The current bloblist pointer and size can be retrieved from global data, so we don't need to pass them from the function arguments. This change also help to remove all external access of gd->bloblist outside of bloblist module. Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-02-29bloblist: check bloblist with specified buffer sizeRaymond Mao1-1/+1
Instead of expecting the bloblist total size to be the same as the pre-allocated buffer size, practically we are more interested in whether the pre-allocated buffer size is bigger than the bloblist total size. Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-02-15avb: move SPDX license identifiers to the first lineIgor Opaniuk1-2/+1
Move SPDX license identifiers to the first line, so it conforms to license placement rule [1]: Placement: The SPDX license identifier in kernel files shall be added at the first possible line in a file which can contain a comment. For the majority of files this is the first line, except for scripts which require the '#!PATH_TO_INTERPRETER' in the first line. For those scripts the SPDX identifier goes into the second line. [1] https://www.kernel.org/doc/Documentation/process/license-rules.rst Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com> Link: https://lore.kernel.org/r/20240209192045.3961832-3-igor.opaniuk@foundries.io Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2024-01-29clk: Remove rfreeSean Anderson1-9/+0
Nothing uses this function. Remove it. Since clk_free no longer does anything, just stub it out. Signed-off-by: Sean Anderson <seanga2@gmail.com> Link: https://lore.kernel.org/r/20231216193843.2463779-2-seanga2@gmail.com
2024-01-29test/py: scsi: Add test for scsi commandsLove Kumar1-0/+92
Add a following test cases for scsi commands: scsi_reset - To reset SCSI controller scsi_info - To show available SCSI devices scsi_scan - To (re-)scan SCSI bus scsi_device - To show or set surrent device scsi_part - To print partition table of selected SCSI device Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-01-29test/py: usb: Add tests for USB deviceLove Kumar1-0/+626
Add the test cases for usb commands to test its various functionality such as start, stop, reset, info, tree, storage, dev, part, ls, load, and save. It also adds different file systems cases such as fat32, ext2 and ext4. Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-01-29test/py: mmc: Add tests for MMC deviceLove Kumar1-0/+671
Add the test cases for mmc commands to test its various functionality such as mmc list, dev, info, rescan, part, ls, load, and save. It also adds different file systems cases such as fat32, ext2 and ext4. Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-01-29test/py: secure: Add secure tests for Zynq & ZynqMPLove Kumar2-0/+294
Add test cases to verify the different type of secure boot images loaded at DDR location for AMD's ZynqMP SoC. It also adds tests authentication and decryption functionality using AES and RSA features for Zynq. Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-01-29test/py: gpio: Add gpio pins generic testLove Kumar1-0/+90
Add gpio pins generic test for the set of gpio pin list to test various gpio related functionality, such as the input, set, clear, and toggle, it also tests the input and output functionality for shorted gpio pins. This test depends on boardenv* configuration to define gpio pins names. Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-01-29test/py: zynqmp_rpu: Add test for loading RPU appsLove Kumar1-0/+208
Add testcases for loading RPU applications in split and lockstep mode including the negative one for AMD's ZynqMP SoC. Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-01-29pytest: update requirements.txtCaleb Connolly1-2/+2
Update pygit2 and py to their latest versions. Even in the venv pygit2 still links against the system libgit2 library which is failing on latest Arch Linux. The py library also needs updating to fix a KeyNotFound exception during test initialisation. Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-01-26test: unit test for smbios commandHeinrich Schuchardt1-0/+41
Provide a unit test for the smbios command. Provide different test functions for QEMU, sandbox, and other systems. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-01-24test: enhance unicode_test_utf8_to_utf32_stream()Heinrich Schuchardt1-3/+8
Additionally test a UTF-8 string where each code point translates to three UTF-8 bytes. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-01-18test/py: bootstage: Add test for bootstage commandLove Kumar1-0/+67
Add test cases for bootstage command to print the bootstage report, to stash the data into memory and to unstash the data from memory. Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-01-18test: Skip cleanup test if not built out of treeTobias Deiminger1-0/+5
With commit 42c0e5bb054d ("test: Find leftovers after clean/mrproper") we assume that we are performing out of tree builds. test_clean and test_mrproper fail if the assumption isn't met. However there are valid scenarios where tests run with in source builds (i.e., test.py --build-dir=.). Automatically skip cleanup tests in such scenarios to prevent false positives. Signed-off-by: Tobias Deiminger <tdmg@linutronix.de> Reviewed-by: Harald Seiler <u-boot@rahix.de>
2024-01-18Revert "test: hush: dollar: fix bugous behavior"Tom Rini1-3/+20
What we were doing here amounts to simplifying the code for the new hush parser, and the workarounds are required when using the old one. As we have returned to having the old parser be default for now, we must undo this so that the test passes again. This reverts commit 6c2f753f4ad3dcee60190949d1286736a6d51d17. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-01-18Revert "test/py: net: Add dhcp abort test"Tom Rini1-57/+0
In practice, as this test defaults to enabled rather than disabled, too many platforms now fail. This reverts commit d8364738623ff47dd2321dd68da310abb58fe861. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-01-18test: test_trace.py: Have trace-cmd report always use -lTom Rini1-16/+16
With newer versions of trace-cmd the report subcommand will have different output from before if we do or do not pass -l. However, with the -l flag passed our put is consistent here. This updates our regular expressions and comments for this as well now. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-01-17test/py/requirements.txt: Update packaging requirementTom Rini1-1/+1
Update packaging to be version 23.2 to match our Sphinx requirements. This will let us build a pip cache out of both of our requirements.txt files. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-01-17Merge tag 'efi-2024-04-rc1-2' of ↵Tom Rini1-1/+1
https://source.denx.de/u-boot/custodians/u-boot-efi Documentation: * add generated index to table of contents * create index entries for commands * update Python packages used to build the documentation * fix typos in dfu documentation UEFI: * split unrelated code from efi_bootmgr.c * rename CONFIG_BOOTEFI_BOOTMGR to CONFIG_EFI_BOOTMGR * net: tftp: remove explicit EFI configuration dependency * fs: remove explicit EFI configuration dependency Other: * Add Goldfish RTC driver and make it available on RISC-V QEMU
2024-01-17test.py: Update pycryptodomex to address CVE-2023-52323Tom Rini1-1/+1
The version of pycryptodomex that we use is vulnerable to this CVE. While not likely an issue for us, let us upgrade to be on the safe side. Reported-by: GitHub dependabot Signed-off-by: Tom Rini <trini@konsulko.com>
2024-01-17test: add test of "cp" shell commandRasmus Villemoes2-0/+169
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2024-01-17efi_loader: rename BOOTEFI_BOOTMGR to EFI_BOOTMGRAKASHI Takahiro1-1/+1
At this point, EFI boot manager interfaces is fully independent from bootefi command. So just rename the configuration parameter. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2024-01-16test/py: memtest: Add tests for mtest commandLove Kumar1-0/+68
Add the following memory tests: memtest_negative - To test mtest command by providing incorrect inputs memtest_ddr - To test memory write-read-comparision for DDR memory Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-01-16test/py: i2c: Add tests for i2c commandLove Kumar1-0/+116
Add below test cases for i2c commands: i2c_bus - To show i2c bus info, i2c_dev - To set or show the current bus, i2c_probe - To probe the i2c device, i2c_eeprom - To test i2c eeprom device, i2c_probe_all_buses - To list down all the buses and probes it Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-01-16test/py: mii: Add tests for mii commandLove Kumar1-0/+92
Add below test cases for mii commands: mii_info -To display MII PHY info mii_list - To list MII devices mii_set_device - To set MII device mii_read - To reads register from MII PHY address mii_dump - To display data from MII PHY address Signed-off-by: Love Kumar <love.kumar@amd.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2024-01-16test/py: mdio: Add tests for mdio commandLove Kumar1-0/+79
Add below test cases for mdio commands: mdio_list - To list MDIO buses mdio_read - To read PHY's register at <devad>.<reg> mdio_write - To write PHY's register at <devad>.<reg> Signed-off-by: Love Kumar <love.kumar@amd.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2024-01-16test/py: net: Add dhcp abort testLove Kumar1-0/+57
Abort the dhcp request in the middle by pressing ctrl + c on u-boot prompt and validate the abort status. Signed-off-by: Love Kumar <love.kumar@amd.com> Reviewed-by: Tom Rini <trini@konsulko.com>