test_efi_loader

Note: This test relies on boardenv_* containing configuration values to define which network environment is available for testing. Without this, the parts that rely on network will be automatically skipped.

For example:

# Boolean indicating whether the Ethernet device is attached to USB, and hence
# USB enumeration needs to be performed prior to network tests.
# This variable may be omitted if its value is False.
env__net_uses_usb = False

# Boolean indicating whether the Ethernet device is attached to PCI, and hence
# PCI enumeration needs to be performed prior to network tests.
# This variable may be omitted if its value is False.
env__net_uses_pci = True

# True if a DHCP server is attached to the network, and should be tested.
# If DHCP testing is not possible or desired, this variable may be omitted or
# set to False.
env__net_dhcp_server = True

# A list of environment variables that should be set in order to configure a
# static IP. If solely relying on DHCP, this variable may be omitted or set to
# an empty list.
env__net_static_env_vars = [
    ('ipaddr', '10.0.0.100'),
    ('netmask', '255.255.255.0'),
    ('serverip', '10.0.0.1'),
]

# Details regarding a file that may be read from a TFTP server. This variable
# may be omitted or set to None if TFTP testing is not possible or desired.
env__efi_loader_helloworld_file = {
    'fn': 'lib/efi_loader/helloworld.efi', # file name
    'size': 5058624,                       # file length in bytes
    'crc32': 'c2244b26',                   # CRC32 check sum
    'addr': 0x40400000,                    # load address
}

# False if the helloworld EFI over HTTP boot test should be performed.
# If HTTP boot testing is not possible or desired, set this variable to True or
# ommit it.
env__efi_helloworld_net_http_test_skip = True
test_efi_loader.test_efi_pre_commands(ubman)

Execute any commands required to enable network hardware.

These commands are provided by the boardenv_* file; see the comment at the beginning of this file.

test_efi_loader.test_efi_setup_dhcp(ubman)

Set up the network using DHCP.

The boardenv_* file may be used to enable/disable this test; see the comment at the beginning of this file.

test_efi_loader.test_efi_setup_static(ubman)

Set up the network using a static IP configuration.

The configuration is provided by the boardenv_* file; see the comment at the beginning of this file.

test_efi_loader.fetch_file(ubman, env_conf, proto)

Grab an env described file via TFTP or HTTP and return its address

A file as described by an env config <env_conf> is downloaded from the server. The address to that file is returned.

test_efi_loader.do_test_efi_helloworld_net(ubman, proto)

Download and execute the helloworld appliation

The helloworld.efi file is downloaded based on the value passed to us as a protocol and is executed using the fallback device tree at $fdtcontroladdr.

test_efi_loader.test_efi_helloworld_net_tftp(ubman)

Run the helloworld.efi binary via TFTP.

Call the do_test_efi_helloworld_net function to execute the test via TFTP.

test_efi_loader.test_efi_helloworld_net_http(ubman)

Run the helloworld.efi binary via HTTP.

Call the do_test_efi_helloworld_net function to execute the test via HTTP.

test_efi_loader.test_efi_helloworld_builtin(ubman)

Run the builtin helloworld.efi binary.

The helloworld.efi file is included in U-Boot, execute it using the special “bootefi hello” command.

test_efi_loader.test_efi_grub_net(ubman)

Run the grub.efi binary via TFTP.

The grub.efi file is downloaded from the TFTP server and gets executed.