aboutsummaryrefslogtreecommitdiff
path: root/test/py/tests
AgeCommit message (Collapse)Author
2024-07-18Merge patch series "bootstd: Add Android support"Tom Rini
Mattijs Korpershoek <mkorpershoek@baylibre.com> says: Android boot flow is a bit different than a regular Linux distro. Android relies on multiple partitions in order to boot. A typical boot flow would be: 1. Parse the Bootloader Control Block (BCB, misc partition) 2. If BCB requested bootonce-bootloader, start fastboot and wait. 3. If BCB requested recovery or normal android, run the following: a. Get slot (A/B) from BCB b. Run AVB (Android Verified Boot) on boot partitions c. Load boot and vendor_boot partitions d. Load device-tree, ramdisk and boot The AOSP documentation has more details at [1], [2], [3] This has been implemented via complex boot scripts such as [4]. However, these boot script are neither very maintainable nor generic. Moreover, DISTRO_DEFAULTS is being deprecated [5]. Add a generic Android bootflow implementation for bootstd. For this initial version, only boot image v4 is supported. This has been tested on sandbox using: $ ./test/py/test.py --bd sandbox --build -k test_ut This has also been tested on the AM62X SK EVM using TI's Android SDK[6] To test on TI board, the following (WIP) patch is needed as well: https://gitlab.baylibre.com/baylibre/ti/ti-u-boot/-/commit/84cceb912bccd7cdd7f9dd69bca0e5d987a1fd04 [1] https://source.android.com/docs/core/architecture/bootloader [2] https://source.android.com/docs/core/architecture/partitions [3] https://source.android.com/docs/core/architecture/partitions/generic-boot [4] https://source.denx.de/u-boot/u-boot/-/blob/master/include/configs/meson64_android.h [5] https://lore.kernel.org/r/all/20230914165615.1058529-17-sjg@chromium.org/ [6] https://software-dl.ti.com/processor-sdk-android/esd/AM62X/09_02_00/docs/android/Overview.html
2024-07-18Merge patch series "finish using .dtso for overlay source files"Tom Rini
Rasmus Villemoes <rasmus.villemoes@prevas.dk> says: This is a followup to the patches that landed in 2024.01 and nearly made sure that source files for producing .dtbo files use the .dtso extension. In the same release, a few new .dts files snuck in, and there was also some test code involving .dtbo -> .dtbo.S -> .dtbo.o I didn't really know how to handle at the time. This should finish the job, bring us in sync with linux (at least in this respect), and drop the .dts -> .dtbo build rule.
2024-07-18bootstd: Add test for bootmeth_androidMattijs Korpershoek
Add a unit test for testing the Android bootmethod. This requires another mmc image (mmc7) to contain the following partitions: - misc: contains the Bootloader Control Block (BCB) - boot_a: contains a fake generic kernel image - vendor_boot_a: contains a fake vendor_boot image Also add BOOTMETH_ANDROID as a dependency on sandbox so that we can test this with: $ ./test/py/test.py --bd sandbox --build -k test_ut # build the mmc7.img $ ./test/py/test.py --bd sandbox --build -k bootflow_android Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Reviewed-by: Julien Masson <jmasson@baylibre.com> Reviewed-by: Guillaume La Roque <glaroque@baylibre.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2024-07-18test/py: efi_capsule: rename device tree overlay source to .dtsoRasmus Villemoes
Distinguish more clearly between source files meant for producing .dtb from those meant for producing .dtbo. Note that in the linux tree, all device tree overlay sources have been renamed to .dtso, and the .dts->.dtbo rule is gone since v6.5 (commit 81d362732bac). So this is also a step towards staying closer to linux with respect to both Kbuild and device tree sources, and eventually eliminating all .dts -> .dtbo instances. This also matches the documentation update done in commit 4fb7e570d6b. Cc: Masahisa Kojima <kojima.masahisa@socionext.com> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2024-07-14test: test for ignore OsIndicationsIlias Apalodimas
The tests we currently have expect the firmware update to fail when OsIndications is not set properly. However, we have a Kconfig flag that explicitly ignores that variable. Adjust the tests accordingly Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-07-11test/py/tests/test_fpga.py: Correct check for legacy image format supportTom Rini
The build option to support images of type 'IMAGE_FORMAT_LEGACY' is CONFIG_LEGACY_IMAGE_FORMAT so update the pytest to check for the correct option. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-07-04test/py/tests: Update some network dependenciesTom Rini
On tests which require "tftpboot" we need to depend not on cmd_net but rather cmd_tftpboot. And on tests which require cmd_pxe we do not need to also depend on cmd_net as this should be handled already via Kconfig logic. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-07-04test: Check help outputSimon Glass
The current test doesn't check anything about the output. If a bug results in junk before the output, this is not currently detected. Add a check for the first line being the one expected. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-04test: dm: Show failing driver nameSimon Glass
When a driver is not registered properly it is not clear which one it is. Adjust test_dm_compat() to show this. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-04log: Allow tests to pass with CONFIG_LOGF_FUNC_PAD setSimon Glass
This setting pads out the function names. Adjust the test to handle this, since some boards use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-04test: Make bootstd init run only on sandboxSimon Glass
Tests for standard boot need disks to be set up, which can only be done on sandbox, since adjusting disks on real hardware is not currently supported. Mark the init function as sandbox-only. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-04initcall: Correct use of relocation offsetSimon Glass
The relocation offset can change in some initcall sequences. Handle this and make sure it is used for all debugging statements in init_run_list() Update the trace test to match. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-07-04trace: Update test to tolerate different trace-cmd versionSimon Glass
Some versions of trace-cmd (or some machines?) show one less dot in the CPU list. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-06-24Merge tag 'v2024.07-rc5' into nextTom Rini
Prepare v2024.07-rc5
2024-06-13test/py: net_boot: Add test cases for net bootLove Kumar
Add tests for booting image using tftpboot/pxe boot commands, tftpboot boot case loads the FIT image into DDR and boots using bootm command whereas pxe boot cases downloads the pxe configuration file from the TFTP server and interprets it to boot the images mentioned in the pxe configurations file. This test relies on boardenv_* containing configuration values including the parameter 'pattern'. tftpboot/pxe boot cases boots the Linux till the boot log pattern value is matched. For example, if the parameter 'pattern' is defined as 'login:', it will boot till login prompt. Signed-off-by: Love Kumar <love.kumar@amd.com> Tested-by: Tom Rini <trini@konsulko.com>
2024-06-10efi_loader: Fix EFI_VARIABLE_APPEND_WRITE hash checkWeizhao Ouyang
According to UEFI v2.10 spec section 8.2.6, if a caller invokes the SetVariables() service, it will produce a digest from hash(VariableName, VendorGuid, Attributes, TimeStamp, DataNew_variable_content), then the firmware that implements the SetVariable() service will compare the digest with the result of applying the signer’s public key to the signature. For EFI variable append write, efitools sign-efi-sig-list has an option "-a" to add EFI_VARIABLE_APPEND_WRITE attr, and u-boot will drop this attribute in efi_set_variable_int(). So if a caller uses "sign-efi-sig-list -a" to create the authenticated variable, this append write will fail in the u-boot due to "hash check failed". This patch resumes writing the EFI_VARIABLE_APPEND_WRITE attr to ensure that the hash check is correct. And also update the "test_efi_secboot" test case to compliance with the change. Signed-off-by: Weizhao Ouyang <o451686892@gmail.com>
2024-05-27tpm-v2: allow algorithm name to be configured for pcr_read and pcr_extendTim Harvey
For pcr_read and pcr_extend commands allow the digest algorithm to be specified by an additional argument. If not specified it will default to SHA256 for backwards compatibility. Additionally update test_tpm2.py for the changes in output in pcr_read which now shows the algo and algo length in the output. A follow-on to this could be to extend all PCR banks with the detected algo when the <digest_algo> argument is 'auto'. Signed-off-by: Tim Harvey <tharvey@gateworks.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-05-01efi_loader: improve error handling in try_load_entry()Heinrich Schuchardt
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 Opaniuk
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 Schuchardt
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 Schuchardt
Using uclass_get_name() reduces the code size. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-04-08sandbox: capsule: binman: generate some capsules as part of buildSughosh Ganu
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-19test/py: reset: Add a test for reset commandLove Kumar
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 Kumar
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-01test/py: net: Add dhcp abort testLove Kumar
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-15avb: move SPDX license identifiers to the first lineIgor Opaniuk
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-29test/py: scsi: Add test for scsi commandsLove Kumar
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 Kumar
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 Kumar
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 Kumar
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 Kumar
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 Kumar
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-26test: unit test for smbios commandHeinrich Schuchardt
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-18test/py: bootstage: Add test for bootstage commandLove Kumar
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 Deiminger
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/py: net: Add dhcp abort test"Tom Rini
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 Rini
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-16test/py: memtest: Add tests for mtest commandLove Kumar
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 Kumar
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 Kumar
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 Kumar
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 Kumar
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>
2024-01-11Merge patch series "net fixes prior lwip"Tom Rini
Maxim Uvarov <maxim.uvarov@linaro.org> says: Add small net fixes prior lwip patches.
2024-01-11test_net: print out net listMaxim Uvarov
Printing net list is useful in CI log files. Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-12-28test: hush: Test hush variable expansionFrancis Laniel
Verifies shell variables are replaced by their values. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Francis Laniel <francis.laniel@amarulasolutions.com>
2023-12-28test/py: hush_if_test: Remove the test fileFrancis Laniel
5804ebfeb1ce ("test: hush: Test hush if/else") translated this test to a C test, so this python file is no more needed. Signed-off-by: Francis Laniel <francis.laniel@amarulasolutions.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-12-20bootm: Fix flags used for bootargs string substitutionPiotr Kubik
Commit 51bb33846ad2 ("bootm: Support string substitution in bootargs") introduced a feature of bootargs string substitution and changed a flag used in bootm_process_cmdline_env() call to be either true or false. With this flag value, condition in bootm_process_cmdline() `if (flags & BOOTM_CL_SUBST)` is never true and process_subst() is never called. Add a simple test to verify if substitution works OK. Signed-off-by: Piotr Kubik <piotr.kubik@iopsys.eu> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-12-13test: vboot: Using variable 'old_dtb' before assignmentHeinrich Schuchardt
old_dtb can only be assumed initialized in the finally block if it is assigned a value before the try statement. Avoid a pylint error reported by current pylint. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-12-13test: fit: Using variable 'old_dtb' before assignmentHeinrich Schuchardt
old_dtb can only be assumed initialized in the finally block if it is assigned a value before the try statement. Avoid a pylint error reported by current pylint. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-12-09test/py: Disable error E0611 in two cases for pylintTom Rini
Recently pylint has started to complain about: No name 'fs_helper' in module 'tests' (no-name-in-module) Due to: from tests import fs_helper However, we have: test/py/tests/fs_helper.py And since we do not want to add a dummy test/py/tests/__init__.py to silence this warning we instead just disable it as needed. Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>