test_net_boot

Note: This test relies on boardenv_* containing configuration values to define which the network environment available for testing. Without this, this test 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:

  1. /tftpboot/pxelinux.cfg/default-arm-zynqmp

menu include pxelinux.cfg/default-arm
timeout 50

default Linux
  1. /tftpboot/pxelinux.cfg/default-arm

menu title Linux boot selections
menu include pxelinux.cfg/default

label install
    menu label Invalid boot
    kernel kernels/install.bin
    append console=ttyAMA0,38400 debug earlyprintk
    initrd initrds/uzInitrdDebInstall

label local
    menu label Local boot
    append root=/dev/sdb1
    localboot 1

label boot
    menu label Empty boot
  1. /tftpboot/pxelinux.cfg/default

label Linux
    menu label Boot kernel
    kernel Image
    fdt system.dtb
    initrd rootfs.cpio.gz.u-boot
test_net_boot.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_boot.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.

test_net_boot.test_net_tftpboot_boot(ubman)

Boot the loaded image

A boot file (fit image) is downloaded from the TFTP server and booted using bootm command with the default fit configuration, its boot log pattern are validated.

The details of the file to download are provided by the boardenv_* file; see the comment at the beginning of this file.

test_net_boot.setup_pxe_boot(ubman)

Setup for the PXE ‘boot’ test

Make sure that the file to load via PXE boot has been configured.

test_net_boot.test_net_pxe_boot(ubman)

Test the pxe boot command.

A pxe configuration file is downloaded from the TFTP server and interpreted to boot the images mentioned in pxe configuration file.

The details of the file to download are provided by the boardenv_* file; see the comment at the beginning of this file.

test_net_boot.test_net_pxe_boot_config(ubman)

Test the pxe boot command by selecting different combination of labels

A pxe configuration file is downloaded from the TFTP server and interpreted to boot the images mentioned in pxe configuration file.

The details of the file to download are provided by the boardenv_* file; see the comment at the beginning of this file.

test_net_boot.test_net_pxe_boot_config_invalid(ubman)

Test the pxe boot command by selecting invalid label

A pxe configuration file is downloaded from the TFTP server and interpreted to boot the images mentioned in pxe configuration file.

The details of the file to download are provided by the boardenv_* file; see the comment at the beginning of this file.