[PATCH] test: wget: validate URI for lwIP

Quentin Schulz foss+uboot at 0leil.net
Tue Apr 28 17:55:42 CEST 2026


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

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