[PATCH v3] test/py: net_boot: Add test cases for net boot

Tom Rini trini at konsulko.com
Tue Apr 30 21:28:39 CEST 2024


On Tue, Apr 30, 2024 at 02:24:55PM +0530, Love Kumar wrote:

> 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 at amd.com>
[snip]
> +def setup_tftpboot_boot(u_boot_console):
> +    f = u_boot_console.config.env.get('env__net_tftp_bootable_file', None)
> +    if not f:
> +        pytest.skip('No TFTP bootable file to read')
> +
> +    test_net.test_net_dhcp(u_boot_console)
> +    if not test_net.net_set_up:
> +        test_net.test_net_setup_static(u_boot_console)
> +
> +    addr = f.get('addr', None)
> +    if not addr:
> +        addr = u_boot_utils.find_ram_base(u_boot_console)
> +
> +    fn = f['fn']
> +    output = u_boot_console.run_command('tftpboot %x %s' % (addr, fn))
> +    expected_text = 'Bytes transferred = '
> +    sz = f.get('size', None)
> +    if sz:
> +        expected_text += '%d' % sz
> +    assert expected_text in output
> +
> +    expected_crc = f.get('crc32', None)
> +    output = u_boot_console.run_command('crc32 %x $filesize' % addr)
> +    if expected_crc:
> +        assert expected_crc in output
> +
> +    pattern = f.get('pattern')
> +    config = f.get('config', None)
> +    timeout = f.get('timeout', 50000)
> +
> +    return addr, pattern, timeout, config

The problem here is that we don't get the configured timeout and then
use it while running "tftpboot" nor "crc32". For me this leads to
failure on hardware as I'm tossing it a 83MiB FIT image and it just
doesn't load in the default timeout period.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20240430/92901cb4/attachment.sig>


More information about the U-Boot mailing list