[PATCH 10/15] test: dm: dsa, eth: disable tests when CONFIG_NET_LWIP=y

Tom Rini trini at konsulko.com
Thu May 23 01:10:47 CEST 2024


On Wed, May 22, 2024 at 06:00:10PM +0200, Jerome Forissier wrote:

> Some sandbox tests make strong assumptions on how the network stack is
> implemented. For example, the ping tests assume that ARP resolution
> occurs upon sending out the ICMP packet. This is not always the case
> with the lwIP stack which can cache ARP information.
> Therefore, disable these tests when CONFIG_NET_LWIP is enabled.
> 
> Signed-off-by: Jerome Forissier <jerome.forissier at linaro.org>
> ---
>  test/dm/dsa.c | 2 ++
>  test/dm/eth.c | 4 ++++
>  2 files changed, 6 insertions(+)
> 
> diff --git a/test/dm/dsa.c b/test/dm/dsa.c
> index c857106eaf..147e2a4afe 100644
> --- a/test/dm/dsa.c
> +++ b/test/dm/dsa.c
> @@ -59,6 +59,7 @@ static int dm_test_dsa_probe(struct unit_test_state *uts)
>  
>  DM_TEST(dm_test_dsa_probe, UT_TESTF_SCAN_FDT);
>  
> +#if !defined(CONFIG_NET_LWIP)
>  /* This test sends ping requests with the local address through each DSA port
>   * via the sandbox DSA master Eth.
>   */
> @@ -80,3 +81,4 @@ static int dm_test_dsa(struct unit_test_state *uts)
>  }
>  
>  DM_TEST(dm_test_dsa, UT_TESTF_SCAN_FDT);
> +#endif /* !defined(CONFIG_NET_LWIP) */
> diff --git a/test/dm/eth.c b/test/dm/eth.c
> index bb3dcc6b95..cf97b1c1ab 100644
> --- a/test/dm/eth.c
> +++ b/test/dm/eth.c
> @@ -170,6 +170,7 @@ static int dm_test_ip6_make_lladdr(struct unit_test_state *uts)
>  DM_TEST(dm_test_ip6_make_lladdr, UT_TESTF_SCAN_FDT);
>  #endif
>  
> +#if !defined(CONFIG_NET_LWIP)
>  static int dm_test_eth(struct unit_test_state *uts)
>  {
>  	net_ping_ip = string_to_ip("1.1.2.2");
> @@ -298,6 +299,7 @@ static int dm_test_eth_act(struct unit_test_state *uts)
>  	return 0;
>  }
>  DM_TEST(dm_test_eth_act, UT_TESTF_SCAN_FDT);
> +#endif /* !CONFIG_NET_LWIP */
>  
>  /* Ensure that all addresses are loaded properly */
>  static int dm_test_ethaddr(struct unit_test_state *uts)
> @@ -332,6 +334,7 @@ static int dm_test_ethaddr(struct unit_test_state *uts)
>  }
>  DM_TEST(dm_test_ethaddr, UT_TESTF_SCAN_FDT);
>  
> +#if !defined(CONFIG_NET_LWIP)
>  /* The asserts include a return on fail; cleanup in the caller */
>  static int _dm_test_eth_rotate1(struct unit_test_state *uts)
>  {
> @@ -616,6 +619,7 @@ static int dm_test_eth_async_ping_reply(struct unit_test_state *uts)
>  }
>  
>  DM_TEST(dm_test_eth_async_ping_reply, UT_TESTF_SCAN_FDT);
> +#endif /* !CONFIG_NET_LWIP */
>  
>  #if IS_ENABLED(CONFIG_IPV6_ROUTER_DISCOVERY)

This seems like a lot of test disabling to me. And since a medium term
goal would be to then drop the old network stack, a more nuanced
approach is needed here. If not if/else'ing within the test, rewriting
tests to cover the concept being tested needs to be done I think.

-- 
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/20240522/908ca818/attachment.sig>


More information about the U-Boot mailing list