[PATCH] test: wget: validate URI for lwIP

Quentin Schulz quentin.schulz at cherry.de
Wed Apr 29 12:27:32 CEST 2026


Hi Heinrich,

On 4/28/26 6:42 PM, Heinrich Schuchardt wrote:
> 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.
> 

That requires the user to have a webserver on port 80, which requires 
root permission (or CAP_NET_BIND_SERVICE, or whatever else to allow 
non-root to open such a low port).

This actually is only used if env__efi_helloworld_net_http_test_skip = 
True (according to the cover letter in merge commit 5eb1b7843811 ("Merge 
patch series "test/py: enable HTTP testing"")) which needs to be set in 
the u-boot test hooks for it to be usable. I'm assuming most people 
won't do that and we then would rely on CI to run the tests. But even 
then, that wouldn't be enough as you need to manually run a job which 
runs the tests on a board whose test environment sets this variable. 
Many ifs, lots of hidden knowledge, test(s) run less often.

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

I'm assuming this requires us to migrate to a Python pytest test also to 
be able to access that variable that tells us whether we can contact an 
HTTP server? Another option could be to have a compile flag which is set 
if HTTP_PID is set (or something else from the host env) and return 
-EAGAIN in the C test function to skip the test, à-la

           if (!IS_ENABLED(CONFIG_OF_LIBFDT_OVERLAY))
                   return -EAGAIN;

in test/cmd/fdt.c for example?

More work than I intended to in this patch, and I'm not really 
interested in doing it. Too many shiny things to look at and this one's 
not shiny enough :)

I can also understand Marek's position, so no hard feeling if this gets 
dropped.

Cheers,
Quentin


More information about the U-Boot mailing list