[PATCH] test: wget: validate URI for lwIP

Heinrich Schuchardt xypron.glpk at gmx.de
Tue Apr 28 18:42:07 CEST 2026


On 4/28/26 17:55, Quentin Schulz wrote:
> From: Quentin Schulz <quentin.schulz at cherry.de>
> 
> We've had wget support in lwIP for almost a year now, so let's do *some*
> checks in the form of validating URIs.
> 
> The other test in test/cmd/wget.c currently requires structures only
> defined for CONFIG_NET_LEGACY so it's left out for now until someone
> ports the test to lwIP.
> 
> This was tested with:
> 
> ./test/py/test.py --bd sandbox64_lwip --build -k net_test_wget

In the CI we already run a HTTP server:
python3 -m http.server 80 --directory "${UBOOT_TRAVIS_BUILD_DIR}" > 
/dev/null 2>&1 &

In the test we should load a page from there.

Let's use the sandbox host network interface and remove all sandbox code 
that is emulating a HTTP server.

This allows to make the net_test_wget() executable on non-sandbox platforms.

Best regards

Heinrich


> 
> Signed-off-by: Quentin Schulz <quentin.schulz at cherry.de>
> ---
>   test/cmd/Makefile | 2 --
>   test/cmd/wget.c   | 2 ++
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/test/cmd/Makefile b/test/cmd/Makefile
> index 5f2815b1bb6..28bb8a82ca4 100644
> --- a/test/cmd/Makefile
> +++ b/test/cmd/Makefile
> @@ -39,9 +39,7 @@ obj-$(CONFIG_CMD_PWM) += pwm.o
>   obj-$(CONFIG_CMD_READ) += rw.o
>   obj-$(CONFIG_CMD_SETEXPR) += setexpr.o
>   obj-$(CONFIG_CMD_TEMPERATURE) += temperature.o
> -ifdef CONFIG_NET_LEGACY
>   obj-$(CONFIG_CMD_WGET) += wget.o
> -endif
>   obj-$(CONFIG_ARM_FFA_TRANSPORT) += armffa.o
>   endif
>   obj-$(CONFIG_CMD_SPAWN) += spawn.o
> diff --git a/test/cmd/wget.c b/test/cmd/wget.c
> index 1005392b952..15c2a854e09 100644
> --- a/test/cmd/wget.c
> +++ b/test/cmd/wget.c
> @@ -23,6 +23,7 @@
>   #include <test/test.h>
>   #include <test/ut.h>
>   
> +#if CONFIG_IS_ENABLED(NET_LEGACY)
>   #define SHIFT_TO_TCPHDRLEN_FIELD(x) ((x) << 4)
>   #define LEN_B_TO_DW(x) ((x) >> 2)
>   #define GET_TCP_HDR_LEN_IN_BYTES(x) ((x) >> 2)
> @@ -241,6 +242,7 @@ static int net_test_wget(struct unit_test_state *uts)
>   	return 0;
>   }
>   CMD_TEST(net_test_wget, UTF_CONSOLE);
> +#endif
>   
>   static int net_test_wget_uri_validate(struct unit_test_state *uts)
>   {
> 
> ---
> base-commit: 4433253ecf2041f9362a763bb6cb79960921ac7e
> change-id: 20260428-wget-test-lwip-9e18a85cb2f9
> 
> Best regards,
> --
> Quentin Schulz <quentin.schulz at cherry.de>
> 



More information about the U-Boot mailing list