diff options
author | Tom Rini <trini@konsulko.com> | 2025-05-11 08:36:37 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2025-05-11 08:36:37 -0600 |
commit | fa51a4d57d910df4f3beffa5d3e1d61a1d5d824b (patch) | |
tree | 02a816537f5f381c7a43ca342f9f02872d04592e /test/py/tests/test_net_boot.py | |
parent | feb55165233623648cb0a74953735b00ec6e322e (diff) | |
parent | 8fdb8740b39b01d182137d437f2d1d16b526a4b5 (diff) |
Merge tag 'efi-2025-07-rc3' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull-request efi-2025-07-rc3
CI:
* https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/26146
Documentation:
* Improve the pytest documentation
* u-boot-test-reset: mention power cycling
* describe u-boot-test-release
* correct link to QEMU
* describe that RISC-V supports semihosting
UEFI:
* link libggc via PLATFORM_LIBGCC to EFI binaries
* allow suppressing ANSI output in dtbdump.efi
* test/py/test_efi_fit: test fdt and initrd
# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEK7wKXt3/btL6/yA+hO4vgnE3U0sFAmggj+IACgkQhO4vgnE3
# U0sjTBAAkWySSBNFoj12AyjO2h4kJecxiJJxyoMYTcsr3xdgV0WTPQFaWcSBqTsL
# NgKq5KFNe+ywUdDIqU1VLOTcQf298hofRrcp5Gfhv+syZaRCorCSoSJI6ZveZ5Bi
# 9N2pPvhEVrlFBF2XannJ5ilYtLAbiqIvVFmdLmFwRPbODv/gfEkSudSy0Za7t1tM
# c7RoRegpXziY4Y1XPfr3MpXgKpUQkOPnvXKUwtHhL055X/1Ggg87dzPg1fiU+DiQ
# AGAgvGD/KF/ym4aWQ3jWyji8Kxc5BLsurv083it7JAmL82wqNbU9j5cx3mS/f2Le
# uL7YWv1GANbq+MoBC5O3nkB+yUtHSLylFC3KKFiehmKhc/JO+Uj3cJY/Q/25+lxs
# aahG3C/5xgBTgM6YEqJfSqKYQVFsC2V/a7gWAFlX7OidYXm6oDBu4TeAHmAtBgcj
# pz0AVCYMWyhKE+zb+4U2mlKEQ8bJpFdC2Q+pTMciGAM3YyztotJ1yoM4IndDrh4q
# ScrIpXHSqWLlZfev+NnJDw1UKLWEJIMeXh0uzfpaT5M0cLEDeHTOSX9Fp3ZPj9Af
# +T3nNWSXWlOW0wc6C5igj4p0UiGSbHMMPOa54f/D0gdl/UkPZ1YPBYVBa/eX1yBy
# NlaJziLCmLqyWpYIVhaigKDtGWfgjoHGaABfyuSIj/HxmIHhD5w=
# =NbGi
# -----END PGP SIGNATURE-----
# gpg: Signature made Sun 11 May 2025 05:54:10 AM CST
# gpg: using RSA key 2BBC0A5EDDFF6ED2FAFF203E84EE2F827137534B
# gpg: Can't check signature: No public key
Diffstat (limited to 'test/py/tests/test_net_boot.py')
-rw-r--r-- | test/py/tests/test_net_boot.py | 177 |
1 files changed, 103 insertions, 74 deletions
diff --git a/test/py/tests/test_net_boot.py b/test/py/tests/test_net_boot.py index abf6dfbaf5e..72086a74637 100644 --- a/test/py/tests/test_net_boot.py +++ b/test/py/tests/test_net_boot.py @@ -1,11 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 # (C) Copyright 2023, Advanced Micro Devices, Inc. -import pytest -import utils -import test_net -import re - """ Note: This test relies on boardenv_* containing configuration values to define which the network environment available for testing. Without this, this test @@ -13,77 +8,88 @@ will be automatically skipped. For example: -# Details regarding a boot image file that may be read from a TFTP server. This -# variable may be omitted or set to None if TFTP boot testing is not possible -# or desired. -env__net_tftp_bootable_file = { - 'fn': 'image.ub', - 'addr': 0x10000000, - 'size': 5058624, - 'crc32': 'c2244b26', - 'pattern': 'Linux', - 'config': 'config@2', - 'timeout': 50000, - 'check_type': 'boot_error', - 'check_pattern': 'ERROR', -} - -# False or omitted if a TFTP boot test should be tested. -# If TFTP boot testing is not possible or desired, set this variable to True. -# For example: If FIT image is not proper to boot -env__tftp_boot_test_skip = False - -# Here is the example of FIT image configurations: -configurations { - default = "config@1"; - config@1 { - description = "Boot Linux kernel with config@1"; - kernel = "kernel@0"; - fdt = "fdt@0"; - ramdisk = "ramdisk@0"; - hash@1 { - algo = "sha1"; - }; - }; - config@2 { - description = "Boot Linux kernel with config@2"; - kernel = "kernel@1"; - fdt = "fdt@1"; - ramdisk = "ramdisk@1"; - hash@1 { - algo = "sha1"; - }; - }; -}; - -# Details regarding a file that may be read from a TFTP server. This variable -# may be omitted or set to None if PXE testing is not possible or desired. -env__net_pxe_bootable_file = { - 'fn': 'default', - 'addr': 0x10000000, - 'size': 74, - 'timeout': 50000, - 'pattern': 'Linux', - 'valid_label': '1', - 'invalid_label': '2', - 'exp_str_invalid': 'Skipping install for failure retrieving', - 'local_label': '3', - 'exp_str_local': 'missing environment variable: localcmd', - 'empty_label': '4', - 'exp_str_empty': 'No kernel given, skipping boot', - 'check_type': 'boot_error', - 'check_pattern': 'ERROR', -} - -# False if a PXE boot test should be tested. -# If PXE boot testing is not possible or desired, set this variable to True. -# For example: If pxe configuration file is not proper to boot -env__pxe_boot_test_skip = False - -# Here is the example of pxe configuration file ordered based on the execution -# flow: +.. code-block:: python + + # Details regarding a boot image file that may be read from a TFTP server. This + # variable may be omitted or set to None if TFTP boot testing is not possible + # or desired. + env__net_tftp_bootable_file = { + 'fn': 'image.ub', + 'addr': 0x10000000, + 'size': 5058624, + 'crc32': 'c2244b26', + 'pattern': 'Linux', + 'config': 'config@2', + 'timeout': 50000, + 'check_type': 'boot_error', + 'check_pattern': 'ERROR', + } + + # False or omitted if a TFTP boot test should be tested. + # If TFTP boot testing is not possible or desired, set this variable to True. + # For example: If FIT image is not proper to boot + env__tftp_boot_test_skip = False + + +Here is the example of FIT image configurations: + +.. code-block:: devicetree + + configurations { + default = "config@1"; + config@1 { + description = "Boot Linux kernel with config@1"; + kernel = "kernel@0"; + fdt = "fdt@0"; + ramdisk = "ramdisk@0"; + hash@1 { + algo = "sha1"; + }; + }; + config@2 { + description = "Boot Linux kernel with config@2"; + kernel = "kernel@1"; + fdt = "fdt@1"; + ramdisk = "ramdisk@1"; + hash@1 { + algo = "sha1"; + }; + }; + }; + +.. code-block:: python + + # Details regarding a file that may be read from a TFTP server. This variable + # may be omitted or set to None if PXE testing is not possible or desired. + env__net_pxe_bootable_file = { + 'fn': 'default', + 'addr': 0x10000000, + 'size': 74, + 'timeout': 50000, + 'pattern': 'Linux', + 'valid_label': '1', + 'invalid_label': '2', + 'exp_str_invalid': 'Skipping install for failure retrieving', + 'local_label': '3', + 'exp_str_local': 'missing environment variable: localcmd', + 'empty_label': '4', + 'exp_str_empty': 'No kernel given, skipping boot', + 'check_type': 'boot_error', + 'check_pattern': 'ERROR', + } + + # False if a PXE boot test should be tested. + # If PXE boot testing is not possible or desired, set this variable to True. + # For example: If pxe configuration file is not proper to boot + env__pxe_boot_test_skip = False + +Here is the example of pxe configuration file ordered based on the execution +flow: + 1) /tftpboot/pxelinux.cfg/default-arm-zynqmp +.. code-block:: + menu include pxelinux.cfg/default-arm timeout 50 @@ -91,6 +97,8 @@ env__pxe_boot_test_skip = False 2) /tftpboot/pxelinux.cfg/default-arm +.. code-block:: + menu title Linux boot selections menu include pxelinux.cfg/default @@ -110,6 +118,8 @@ env__pxe_boot_test_skip = False 3) /tftpboot/pxelinux.cfg/default +.. code-block:: + label Linux menu label Boot kernel kernel Image @@ -117,12 +127,27 @@ env__pxe_boot_test_skip = False initrd rootfs.cpio.gz.u-boot """ +import pytest +import utils +import test_net +import re + def setup_networking(ubman): + """Setup networking + + Making use of the test_net test, first try and configure networking via + DHCP. If this fails, fall back to static configuration. + """ test_net.test_net_dhcp(ubman) if not test_net.net_set_up: test_net.test_net_setup_static(ubman) def setup_tftpboot_boot(ubman): + """Setup for the tftpboot 'boot' test + + We check that a file to use has been configured. If it has, we download it + and ensure it has the expected crc32 value. + """ f = ubman.config.env.get('env__net_tftp_bootable_file', None) if not f: pytest.skip('No TFTP bootable file to read') @@ -198,6 +223,10 @@ def test_net_tftpboot_boot(ubman): ubman.cleanup_spawn() def setup_pxe_boot(ubman): + """Setup for the PXE 'boot' test + + Make sure that the file to load via PXE boot has been configured. + """ f = ubman.config.env.get('env__net_pxe_bootable_file', None) if not f: pytest.skip('No PXE bootable file to read') |