[RESEND PATCH v5 4/4] test: env: add test for env info sub-command

Stephen Warren swarren at wwwdotorg.org
Mon Jun 22 20:50:38 CEST 2020


On 6/19/20 6:03 AM, Patrick Delaunay wrote:
> Add a pytest for testing the env info sub-command:
> 
> test_env_info: test command with several option that
> can be executed on real hardware device without assumption
> 
> test_env_info_sandbox: test the result on sandbox
> with a known ENV configuration: ready & default & persistent
> 
> The quiet option '-q' is used for support in shell test;
> for example:
>   if env info -p -d -q; then env save; fi

Acked-by: Stephen Warren <swarren at nvidia.com>

> +def test_env_info(state_test_env):
...
> +    for l in response.split('\n'):
> +        if 'env_valid = ' in l:
> +            assert '= invalid' in l or '= valid' in l or '= redundant' in l
> +            nb_line += 1
> +        elif 'env_ready =' in l or 'env_use_default =' in l:
> +            assert '= true' in l or '= false' in l
> +            nb_line += 1
> +        else:
> +            assert true

Those last two lines don't seem terribly useful:-)


More information about the U-Boot mailing list