summaryrefslogtreecommitdiff
path: root/include/test/suites.h
AgeCommit message (Collapse)Author
2025-02-11test: Drop suites.hSimon Glass
This file is empty now. Remove it and its uses. Signed-off-by: Simon Glass <[email protected]>
2025-02-11test: Make cmd_ut_category() staticSimon Glass
This function is not used outside the cmd_ut file anymore, so make it static. Signed-off-by: Simon Glass <[email protected]>
2025-02-11test: Drop support for test commandsSimon Glass
Now that everything is using the new test-suite features, drop support for running commands. Fix a missing closing-bracket while we are here. Signed-off-by: Simon Glass <[email protected]>
2025-02-11test: Drop the function for running optee testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-02-11test: Drop the function for running bootstd testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-02-11test: Drop the function for running fdt_overlay testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-02-11test: Tweak FDT-overlay testsSimon Glass
Use fdt_overlay consistently in the identifiers and file/dir names. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Pass the test state to cmd_ut_category()Simon Glass
Update this function to access a unit-test state, so that the caller can collect results from running multiple suites. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running upl testsSimon Glass
Use the new suite-runner to run these tests instead. It is not clear that these actually work, since they are not enabled on sandbox for some reason. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running seama testsSimon Glass
Use the new suite-runner to run these tests instead. It is not clear that these actually work, since they are not enabled on sandbox for some reason. Signed-off-by: Simon Glass <[email protected]> Acked-by: Linus Walleij <[email protected]>
2025-01-24test: Drop the function for running pci_mps testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running loadm testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running hush testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running addrmap testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running bootm testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running bloblist testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running measurement testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running setexpr testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running mem testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running mbr testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running log testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running lib testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running font testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running fdt testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running exit testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running env testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running dm testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running common testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running cmd testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop the function for running bdinfo testsSimon Glass
Use the new suite-runner to run these tests instead. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Introduce a better array of test suitesSimon Glass
The current cmd_ut_sub[] array was fine when there were only a few test suites. But is quite unwieldy now: - it requires a separate do_ut_xxx for each suite, even though the code for most is almost identical - running more than one suite requires running multiple commands, and there is no record of which suites passed or failed - 'ut all' runs all suites but reports their results individually - we need lots of #ifdefs in the array, mirroring those in the makefile but maintained in a separate place In fact the tests are all in the same linker list. The suites are grouped, so it is possible to access the information without a command. Introduce a 'suite' array, which holds the cmd_ut_...() function to call, but can also support running a suite without that function. This means that the array of struct cmd_tbl is transformed into an array of 'struct suite'. This will allow removal of many of the functions, particularly those without test-specific init. Signed-off-by: Simon Glass <[email protected]>
2025-01-24test: Drop unused suite prototypesSimon Glass
Drop some the prototypes for functions which were removed in earlier series. Signed-off-by: Simon Glass <[email protected]>
2024-08-09upl: Add basic testsSimon Glass
Add some unit tests to check that we can write a UPL handoff and read it back. Signed-off-by: Simon Glass <[email protected]>
2023-12-28test: Add framework to test hush behaviorFrancis Laniel
Introduce a new subcommand to ut: ut hush. For the moment, this command does nothing, future commits will add tests which will be run on command call. Note that CONFIG_HUSH_PARSER must be defined to compile this new subcommand. Signed-off-by: Francis Laniel <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-12-13test: Add a new suite for commandsSimon Glass
Add a new suite for 'cmd' tests, used for testing commands. These are kept in the test/cmd directory. For now it is empty, but it will be used for coreboot-command tests. Signed-off-by: Simon Glass <[email protected]>
2023-10-27Merge tag 'tpm-next-27102023' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-tpm bootX measurements and measurement API moved to u-boot core: Up to now, U-Boot could perform measurements and EventLog creation as described by the TCG spec when booting via EFI. The EFI code was residing in lib/efi_loader/efi_tcg2.c and contained both EFI specific code + the API needed to access the TPM, extend PCRs and create an EventLog. The non-EFI part proved modular enough and moving it around to the TPM subsystem was straightforward. With that in place we can have a common API for measuring binaries regardless of the boot command, EFI or boot(m|i|z), and contructing an EventLog. I've tested all of the EFI cases -- booting with an empty EventLog and booting with a previous stage loader providing one and found no regressions. Eddie tested the bootX part. Eddie also fixed the sandbox TPM which couldn't be used for the EFI code and it now supports all the required capabilities. This had a slight sideeffect in our testing since the EFI subsystem initializes the TPM early and 'tpm2 init' failed during some python tests. That code only opens the device though, so we can replace it with 'tpm2 autostart' which doesn't error out and still allows you to perfom the rest of the tests but doesn't report an error if the device is already opened. There's a few minor issues with this PR as well but since testing and verifying the changes takes a considerable amount of time, I prefer merging it now. Heinrich has already sent a PR for -master containing "efi_loader: fix EFI_ENTRY point on get_active_pcr_banks" and I am not sure if that will cause any conflicts, but in any case they should be trivial to resolve. Both the EFI and non-EFI code have a Kconfig for measuring the loaded Device Tree. The reason this is optional is that we can't reason when/if devices add random info like kaslr-seed, mac addresses etc in the DT. In that case measurements are random, board specific and eventually useless. The reason it was difficult to fix it prior to this patchset is because the EFI subsystem and thus measurements was brought up late and DT fixups might have already been applied. With this patchset we can measure the DT really early in the future. Heinrich also pointed out that the two Kconfigs for the DTB measurements can be squashed in a single one and that the documentation only explains the non-EFI case. I agree on both but as I said this is a sane working version, so let's pull this first it's aleady big enough and painful to test.
2023-10-27test: Add sandbox TPM boot measurementEddie James
Use the sandbox TPM driver to measure some boot images in a unit test case. Signed-off-by: Eddie James <[email protected]> Reviewed-by: Simon Glass <[email protected]> Acked-by: Ilias Apalodimas <[email protected]> Signed-off-by: Ilias Apalodimas <[email protected]>
2023-10-24cmd: mbr: Allow 4 MBR partitions without need for extendedAlexander Gendin
Current code allows up to 3 MBR partitions without extended one. If more than 3 partitions are required, then extended partition(s) must be used. This commit allows up to 4 primary MBR partitions without the need for extended partition. Add mbr test unit. In order to run the test manually, mmc6.img file of size 12 MiB or greater is required in the same directory as u-boot. Test also runs automatically via ./test/py/test.py tool. Running mbr test is only supported in sandbox mode. Signed-off-by: Alex Gendin <[email protected]> [ And due to some further changes for testing ] Signed-off-by: Simon Glass <[email protected]>
2023-06-20test: bdinfo: Add test for command bdinfoMarek Vasut
Add test for command bdinfo . Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-03-30test: Add test for new command pci_mpsStephen Carlson
Adds a test for the new pci_mps command to ensure that it can set the Maximum Payload Size (MPS) of all devices to 256 bytes in the sandbox environment. Enables the pci_mps command in the sandbox environment so that this test can be run. Signed-off-by: Stephen Carlson <[email protected]>
2023-02-06cmd: Add a SEAMA image load commandLinus Walleij
Add a command to load SEAMA (Seattle Image), a NAND flash on-flash storage format. This type of flash image is found in some D-Link routers such as DIR-645, DIR-842, DIR-859, DIR-860L, DIR-885L, DIR890L and DCH-M225, as well as in WD and NEC routers on the ath79 (MIPS), Broadcom BCM53xx, and RAMIPS platforms. This U-Boot command will read and decode a SEAMA image from raw NAND flash on any platform. As it is always using big endian format for the data decoding is always necessary on platforms such as ARM. The command is needed to read a SEAMA-encoded boot image on the D-Link DIR-890L router for boot from NAND flash in an upcoming port of U-Boot to the Broadcom Northstar (BCM4709, BCM53xx) architecture. A basic test and documentation is added as well. The test must be run on a target with NAND flash support and at least one resident SEAMA image in flash. Cc: Rafał Miłecki <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2023-01-11test: cmd: exit: Add unit test for exit and partly run commandsMarek Vasut
Add a test which validates that exit from environment script works as expected, including return value propagation and clipping to positive integers. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Marek Vasut <[email protected]>
2022-10-30video: Add commands to list and change fontsSimon Glass
Add a new 'font' command which allows the fonts to be listed as well as selecting a different font and size. Allow the test to run on sandbox, where multiple font/size combinations are supported, as well as sandbox_flattree, where they are not. Signed-off-by: Simon Glass <[email protected]>
2022-07-26fdt: Start a test for the fdt commandSimon Glass
Add a basic test of the 'fdt addr' command, to kick things off. This includes a new convenience function to run a command from a printf() string. Signed-off-by: Simon Glass <[email protected]>
2022-06-22cmd: load: add load command for memory mappedRui Miguel Silva
cp.b is used a lot as a way to load binaries to memory and execute them, however we may need to integrate this with the efi subsystem to set it up as a bootdev. So, introduce a loadm command that will be consistent with the other loadX commands and will call the efi API's. ex: loadm $kernel_addr $kernel_addr_r $kernel_size with this a kernel with CONFIG_EFI_STUB enabled will be loaded and then subsequently booted with bootefi command. Signed-off-by: Rui Miguel Silva <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2022-04-25bootstd: Add tests for bootstd including all uclassesSimon Glass
Add a set of combined tests for the bootdev, bootflow and bootmeth commands, along with associated functionality. Expand the sandbox console-recording limit so that these can work. These tests rely on a filesystem script which is not yet added to the Python tests. It is included here as a shell script. Signed-off-by: Simon Glass <[email protected]>
2022-01-19doc: replace @return by Return:Heinrich Schuchardt
Sphinx expects Return: and not @return to indicate a return value. find . -name '*.c' -exec \ sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \; find . -name '*.h' -exec \ sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \; Signed-off-by: Heinrich Schuchardt <[email protected]>
2021-07-23test: add first autoboot unit testsSteffen Jaeckel
This adds tests for the crypt-based and plain SHA256-based password hashing algorithms in the autoboot flow. Signed-off-by: Steffen Jaeckel <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2021-06-08test: Convert print tests to use ut frameworkSimon Glass
This test predates the test framework in U-Boot. It uses #define DEBUG and assert() to check the result. Update it to use the framework so it can report failure constitent with other tests. Signed-off-by: Simon Glass <[email protected]>
2021-03-05test: cmd: Add a basic test for 'addrmap' commandBin Meng
This adds a basic test for the newly introduced 'addrmap' command. Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Simon Glass <[email protected]> [Rebase] Signed-off-by: Priyanka Jain <[email protected]>