[PATCH] test/py: saveenv: Add a test for saveenv command

Tom Rini trini at konsulko.com
Fri Jan 12 17:04:24 CET 2024


On Thu, Jan 11, 2024 at 06:12:25PM +0530, Love Kumar wrote:

> Add test case for saveenv command in non-JTAG bootmode which saves the
> u-boot environment variables in persistent storage.
> 
> Signed-off-by: Love Kumar <love.kumar at amd.com>
[snip]
> +# Setup the env
> +def setup_saveenv_env(u_boot_console):
> +    if u_boot_console.config.env.get('env__saveenv_test_skip', False):
> +        pytest.skip('saveenv test is not enabled')
> +
> +    output = u_boot_console.run_command('print modeboot')
> +    m = re.search('modeboot=(.+?)boot', output)
> +    if not m:
> +        pytest.skip('bootmode cannnot be determined')
> +
> +    bootmode = m.group(1)
> +    if bootmode == 'jtag':
> +        pytest.skip('skipping saveenv test due to jtag bootmode')

This doesn't handle the case of "modeboot" being unset, which is how my
hardware is.
-- 
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/20240112/2810282a/attachment.sig>


More information about the U-Boot mailing list