[U-Boot] [RFC PATCH v3 13/14] dm: eth: Add testing for netretry env var
Simon Glass
sjg at chromium.org
Sun Feb 15 16:50:13 CET 2015
On 10 February 2015 at 18:30, Joe Hershberger <joe.hershberger at ni.com> wrote:
> Make sure that the retry behavior occurs as expected.
>
> Signed-off-by: Joe Hershberger <joe.hershberger at ni.com>
Reviewed-by: Simon Glass <sjg at chromium.org>
Nit below.
>
> ---
>
> Changes in v3:
> -Added testing for netretry
>
> Changes in v2: None
>
> test/dm/eth.c | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/test/dm/eth.c b/test/dm/eth.c
> index b39a94a..831a994 100644
> --- a/test/dm/eth.c
> +++ b/test/dm/eth.c
> @@ -83,3 +83,28 @@ static int dm_test_eth_prime(struct dm_test_state *dms)
> }
>
> DM_TEST(dm_test_eth_prime, DM_TESTF_SCAN_FDT);
> +
> +static int dm_test_eth_retry(struct dm_test_state *dms)
> +{
> + char ethaddr[18];
> +
> + NetPingIP = string_to_ip("1.1.2.2");
> + strcpy(ethaddr, getenv("eth1addr"));
> + setenv("ethact", "eth at 10004000");
> + setenv("eth1addr", NULL);
> + ut_assertok(NetLoop(PING));
> + ut_asserteq_str("eth at 10002000", getenv("ethact"));
> +
> + setenv("ethact", "eth at 10004000");
> + setenv("netretry", "no");
> + ut_asserteq(-1, NetLoop(PING));
> + ut_asserteq_str("eth at 10004000", getenv("ethact"));
> +
> + /* Restore the env */
> + setenv("eth1addr", ethaddr);
> + setenv("netretry", NULL);
> +
> + return 0;
> +}
> +
Remove blank line again
> +DM_TEST(dm_test_eth_retry, DM_TESTF_SCAN_FDT);
> --
> 1.7.11.5
>
More information about the U-Boot
mailing list