summaryrefslogtreecommitdiff
path: root/test/py
AgeCommit message (Collapse)Author
2024-11-01test/py: spi: prevent overwriting relocation memoryPadmarao Begari
Update spi negative test case to prevent SF command from overwriting relocation memory area. Signed-off-by: Padmarao Begari <padmarao.begari@amd.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Love Kumar <love.kumar@amd.com>
2024-10-30cmd/eficonfig: capitalize 'enter description'Heinrich Schuchardt
To conform with other messages capitalize the first letter: %s/enter description/Enter description/g Adjust the unit tests accordingly. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-10-27test: efi_loader: Fix dependency for http testAndrew Goodbody
The config setting CMD_BOOTEFI_HELLO_COMPILE was removed in favour of BOOTEFI_HELLO_COMPILE but the dependency for test_efi_helloworld_net_http was not updated and so is now incorrect preventing the test from ever running. Fix it. Fixes: 6fe80876dcc7 ("efi_loader: Rename and move CMD_BOOTEFI_HELLO_COMPILE") Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-10-27Merge patch series "Implement ACPI on aarch64"Tom Rini
Patrick Rudolph <patrick.rudolph@9elements.com> says: Based on the existing work done by Simon Glass this series adds support for booting aarch64 devices using ACPI only. As first target QEMU SBSA support is added, which relies on ACPI only to boot an OS. As secondary target the Raspberry Pi4 was used, which is broadly available and allows easy testing of the proposed solution. The series is split into ACPI cleanups and code movements, adding Arm specific ACPI tables and finally SoC and mainboard related changes to boot a Linux on the QEMU SBSA and RPi4. Currently only the mandatory ACPI tables are supported, allowing to boot into Linux without errors. The QEMU SBSA support is feature complete and provides the same functionality as the EDK2 implementation. The changes were tested on real hardware as well on QEMU v9.0: qemu-system-aarch64 -machine sbsa-ref -nographic -cpu cortex-a57 \ -pflash secure-world.rom \ -pflash unsecure-world.rom qemu-system-aarch64 -machine raspi4b -kernel u-boot.bin -cpu cortex-a72 \ -smp 4 -m 2G -drive file=raspbian.img,format=raw,index=0 \ -dtb bcm2711-rpi-4-b.dtb -nographic Tested against FWTS V24.03.00. Known issues: - The QEMU rpi4 support is currently limited as it doesn't emulate PCI, USB or ethernet devices! - The SMP bringup doesn't work on RPi4, but works in QEMU (Possibly cache related). - PCI on RPI4 isn't working on real hardware since the pcie_brcmstb Linux kernel module doesn't support ACPI yet. Link: https://lore.kernel.org/r/20241023132116.970117-1-patrick.rudolph@9elements.com
2024-10-27acpi: Allocate and write ACPI tablesPatrick Rudolph
Allocate memory for ACPI tables in generic acpi code. When ACPI wasn't installed in other places, install the ACPI table using BLOBLISTs. This allows non x86 platforms to boot using ACPI only in case the EFI loader is being used, since EFI is necessary to advertise the location of the ACPI tables in memory. TEST: Booted QEMU SBSA (no QFW) using EFI and ACPI only. Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-by: Simon Glass <sjg@chromium.org> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com>
2024-10-24cmd: bcb: introduce 'ab_dump' command to print BCB block contentDmitry Rokosov
It's really helpful to have the ability to dump BCB block for debugging A/B logic on the board supported this partition schema. Command 'bcb ab_dump' prints all fields of bootloader_control struct including slot_metadata for all presented slots. Output example: ===== > board# bcb ab_dump ubi 0#misc > Read 512 bytes from volume misc to 000000000bf07580 > Read 512 bytes from volume misc to 000000000bf42f40 > Bootloader Control: [misc] > Active Slot: _a > Magic Number: 0x42414342 > Version: 1 > Number of Slots: 2 > Recovery Tries Remaining: 0 > CRC: 0x2c8b50bc (Valid) > > Slot[0] Metadata: > - Priority: 15 > - Tries Remaining: 0 > - Successful Boot: 1 > - Verity Corrupted: 0 > > Slot[1] Metadata: > - Priority: 14 > - Tries Remaining: 7 > - Successful Boot: 0 > - Verity Corrupted: 0 ==== The ab_dump command allows you to display ABC data directly on the U-Boot console. During an A/B test execution, this test verifies the accuracy of each field within the ABC data. Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # vim3_android Link: https://lore.kernel.org/r/20241017-android_ab_master-v5-5-43bfcc096d95@salutedevices.com Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2024-10-24treewide: bcb: move ab_select command to bcb subcommandsDmitry Rokosov
To enhance code organization, it is beneficial to consolidate all A/B BCB management routines into a single super-command. The 'bcb' command is an excellent candidate for this purpose. This patch integrates the separate 'ab_select' command into the 'bcb' group as the 'ab_select' subcommand, maintaining the same parameter list for consistency. Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # vim3_android Link: https://lore.kernel.org/r/20241017-android_ab_master-v5-3-43bfcc096d95@salutedevices.com Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2024-10-15test: Fix skip check for sleep command testAndrew Goodbody
When the config option CMD_MISC was renamed to CMD_SLEEP the check in the test for the sleep command was not updated. Do that now. Fixes: 16060854095 ("cmd: Rename CMD_MISC to CMD_SLEEP") Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2024-10-15test: Fix mulptiplex_log typoSimon Glass
Fix a typo in a comment. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-15test: Tidy up remaining exceptionsSimon Glass
Use the new handle_exception() function from ConsoleBase also. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-15test: Detect dead connectionsSimon Glass
When the connection to a board dies, assume it is dead forever until some user action is taken. Skip all remaining tests. This avoids CI runs taking an hour, with hundreds of 30-second timeouts all to no avail. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-15test: Separate out the exception handlingSimon Glass
The tests currently catch a very broad Exception in each case. This is thrown even in the event of a coding error. We want to handle exceptions differently depending on their severity, so that we can avoid hour-long delays waiting for a board that is clearly broken. As a first step, create some new exception types, separating out those which are simply an unexpected result from executed a command, from those which indicate some kind of hardware failure. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-15test: Move the receive code into a functionSimon Glass
There is quite a bit of code to deal with receiving data from the target so move it into its own receive() function. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-15test: Create a common function to get the configSimon Glass
The settings are decoded in two places. Combine them into a new function, before (in a future patch) expanding the number of items. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-15test: Use a constant for the test timeoutSimon Glass
Declare a constant rather than open-coding the same value twice. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2024-10-09test: don't call restart_uboot in EFI watchdog testHeinrich Schuchardt
Calling u_boot_console.restart_uboot() in test_efi_selftest_watchdog_reboot() may lead to incorrect results. While the watchdog triggered reboot is running thee test environment may need some time before triggering a reboot itself. This may lead to duplicate output of the U-Boot greeter which is recorded as an error. Reported-by: Tom Rini <trini@konsulko.com> Fixes: df172e117d1d ("test/py: test reboot by EFI watchdog") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-10-09efi_loader: Rename and move CMD_BOOTEFI_HELLO_COMPILESimon Glass
This is not actually a command so the name is confusing. Use BOOTEFI_HELLO_COMPILE instead. Put it in the efi_loader directory with the other such config options. The link rule (for $(obj)/%_efi.so) in scripts/Makefile.lib handles pulling in efi_crt0.o and efi_reloc.o so drop the 'extra' rules. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-09-24Merge patch series "Miscellaneous fixes"Tom Rini
Jerome Forissier <jerome.forissier@linaro.org> says: Miscellaneous fixes made when developing the lwIP series [1]. They are posted separately since they make sense on their own. Subsequent versions of the lwIP series will contain a squashed version of this one. [1] http://patchwork.ozlabs.org/project/uboot/list/?series=420712&state=%2A&archive=both
2024-09-24test/py: test_efi_loader: add HTTP (wget) test for the EFI loaderJerome Forissier
Add a test to test_efi_loader.py similar to the TFTP test but for HTTP with the wget command. Suggested-by: Tom Rini <trini@konsulko.com> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Tom Rini <trini@konsulko.com> Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
2024-09-24test/py: test_efi_loader: add missing dependency on cmd_tftpbootJerome Forissier
test_efi_helloworld_net() and test_efi_grub_net() depend on cmd_tftpboot so add the missing annotations. Reported-by: Tom Rini <trini@konsulko.com> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Peter Robinson <pbrobinson@gmail.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-09-24test/py: net_boot: fix commentJerome Forissier
If env__pxe_boot_test_skip is not present, it defaults to True not False. Therefore fix the comment. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Peter Robinson <pbrobinson@gmail.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-09-24test/py/tests/test_bootstage.py: Combine stash/unstash testsTom Rini
When running the bootstage tests currently we get a warning like: tests/test_bootstage.py::test_bootstage_stash ...PytestReturnNotNoneWarning: Expected None, but tests/test_bootstage.py::test_bootstage_stash returned (37748736, 4096), which will be an error in a future version of pytest. Did you mean to use `assert` in stead of `return`? This is because the unstash test will run the stash test and fetch the addr / size from that. Rework the test to be stash and unstash and then run the unstash command at the end of the current stash test. Acked-by: Michal Simek <michal.simek@amd.com> Reviewed-by: Love Kumar <love.kumar@amd.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-09-18Merge patch series "Fix various bugs"Tom Rini
Simon Glass <sjg@chromium.org> says: This series includes the patches needed to make make the EFI 'boot' test work. That test has now been split off into a separate series along with the EFI patches. This series fixes these problems: - sandbox memory-mapping conflict with PCI - the fix for that causes the mbr test to crash as it sets up pointers instead of addresses for its 'mmc' commands - the mmc and read commands which cast addresses to pointers - a tricky bug to do with USB keyboard and stdio - a few other minor things
2024-09-18test/py: Fix some pylint warnings in test_ut.pySimon Glass
Tidy up most of these warnings. Remaining are four of these: R0914: Too many local variables which can only by fixed by splitting things into functions, so that is left for another time. Part of this change was done by the flynt tool. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-09-12sandbox: switch to dynamic UUIDsCaleb Connolly
Migrate sandbox over to generating it's capsule update image GUIDs dynamically from the namespace and board/image info. Update the reference and tests to use the new GUIDs. Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-09-10test/py: spi: Set the expected error messageLove Kumar
If erase/write/read size is 0 then it throws the mentioned error message when debug message ie enabled as per 899fb5aa8bec ("cmd: sf/nand: Print and return failure when 0 length is passed"), setting it to None as debug message is not enabled by default for testing. Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-09-02Merge tag 'v2024.10-rc4' into nextTom Rini
Prepare v2024.10-rc4
2024-08-27test/py: spi: Add tests for SPI flash deviceLove Kumar
Add test cases for sf commands to verify various SPI flash operations such as erase, write and read. It also adds qspi lock unlock cases. This test relies on boardenv_* configurations to run it for different SPI flash family such as single SPI, QSPI, and OSPI. Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-08-21pytest: requirements.txt: Resync with the rest of the projectTom Rini
In order to build the docker container, which contains a download cache of python modules, we need to have our versions be in sync in each requirements file. Update some of the cases where which are older than the rest of the project. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-08-09upl: Add an end-to-end testSimon Glass
Now that sandbox_vpl supports UPL, add a test that checks that the payload can be loaded by SPL and the handoff information passed through to U-Boot proper. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-09sandbox_vpl: Enable Universal PayloadSimon Glass
Use the sandbox_vpl build to test UPL since it supports a real devicetree in SPL. The sandbox_spl build uses OF_PLATDATA. Enable writing the UPL handoff in SPL and reading it in U-Boot proper. Provide a test to check that this handoff works. Note that the test uses the standard devicetree rather than the test one, since it is a lot smaller and fits in the existing bloblist. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-20test/py/requirements.txt: Bump setuptools to 70.3.0Tom Rini
There is some potential security issue resolved by upgrading to v70.0.0 here and the latest is now v70.3.0. Reported-by: GitHub dependabot Suggested-by: Sebastian Kropatsch <seb-dev@mail.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
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-18test/py/requirements.txt: Bump zipp to current releaseTom Rini
A security issue exists with zipp before v3.19.1, and the current release is now v3.19.2. While the change in versions numbers is large, a manual inspection of the changelog shows that it's not as big as might be implied. Reported-by: GitHub dependabot Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
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: Decode exceptions only with sandboxSimon Glass
When a real board fails we don't want to decode the exception. Reserve that behaviour for sandbox. Also avoid raising a new exception on failure - just re-raise the existing one. 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-13test/py: Add support to enable check for bad patternLove Kumar
Executing a u-boot command may raise an error or extra bad pattern, beyond the default bad patterns. Providing a way to enable the console output error check in test. For example, description for OS boot test: import re check_type = 'kernel_boot_error' check_pattern = re.compile('ERROR -2: can't get kernel image!') with u_boot_console.enable_check(check_type, check_pattern): u_boot_console.run_command('<boot command>') Signed-off-by: Love Kumar <love.kumar@amd.com>