summaryrefslogtreecommitdiff
path: root/test/cmd/wget.c
AgeCommit message (Collapse)Author
2025-07-03test: wget: add a test case for validating URISughosh Ganu
The wget module has a function wget_validate_uri() which is used for validating the URI to be used by wget. Add a basic test case for this function. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-01-27test/cmd/wget.c: Fix loadaddr rewriteMarek Vasut
The $loadaddr variable is a hexadecimal value, not a string, it must be assigned using env_set_hex(). This may break follow up tests, like the dm_test_cmd_hash_md5 in CI. To avoid any interference with other tests, set $wgetaddr variable which is specific to this test and use it in the test. Fixes: 20f641987f83 ("test/cmd/wget.c: move net_test_wget() to the cmd test suite") Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Fabio Estevam <festevam@gmail.com>
2024-12-28test/cmd/wget: replace bogus response with an actual response from the HTTP ↵Mikhail Kshevetskiy
server According to HTTP/1.0 standard the HTTP reply consist of * Status Line + CRLF * Zero or more Response Header Fields (each ended with CRLF) * CRLF on new line (Response Header Fields end marker) * Optional Entity Body. Thus in response headers we state: Content-Length = 30 but actual transferred file data is: "\r\n<html><body>Hi</body></html>\r\n". This is 32 bytes of data. So we get and check for correctness 32 bytes of data, but * The response we are used is incorrect, real server will set Content-Length to 32. * default_wget_info->hdr_cont_len will be set to wrong value 30 (used for efi http booting). Fix an issue by: * replace bogus response with an actual response from the HTTP server * format response to show HTTP response structure * recalculate md5sum as transferred file data has been changed. The server response was captured with the commands echo -ne "<html><body>Hi</body></html>\n" > ~/public_html/test.html echo -ne "GET /~${USER}/test.html HTTP/1.0\r\n\r\n" | netcat localhost 80 >reply.txt Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
2024-12-28test/cmd/wget: fix the testMikhail Kshevetskiy
Changes: * update to new tcp stack * fix zero values for ISS and IRS issue (see RFC 9293) Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> Reviewed-by: Simon Glass <sjg@chromium.org>
2024-11-29test/cmd/wget.c: move net_test_wget() to the cmd test suiteJerome Forissier
Since net_test_wget() is testing a command and is in test/cmd it should be in the 'cmd' test suite, not 'lib'. Saving and restoring the values of the environment variables that the test manipulates is necessary to avoid a regression when running the whole ut test suite. A minimal reproducer is: $ ./u-boot -T -c "ut cmd net_test_wget; ut dm dm_test_eth_act" | \ grep -E "(Test:|Failures:)" Reported-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2024-08-26test: Tidy up checking for console endSimon Glass
Use the ut_assert_console_end() function provided, rather than doing it separately. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-26test: cmd: Drop unnecessary console_record_reset_enable()Simon Glass
It is seldom necessary to call this function. Drop its use in the command tests. Add a few extra checks to the wget test so that resetting is not needed. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-26test: cmd: Use UTF_CONSOLE in testsSimon Glass
Set this flag rather than doing things manually in the test. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-26test: Drop the blank line before test macrosSimon Glass
Most tests don't have this. It helps to keep the test declaration clearly associated with the function it relates to, rather than the next one in the file. Remove the extra blank line and mention this in the docs. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-15sandbox: fix wget test failure after fixing wget issueYasuharu Shibata
After applying the following patch, wget test on sandbox failed[1]. Commit: cab7867cff ("net: wget: Support retransmission a dropped packet") Here are two reasons why the test is failed and how to fix it: 1. tcp_ack is calculated by the wrong value. tcp_ack needs to be calculated by the received TCP payload size. 2. wget command may have a problem that HTTP response from server must be divided into more than two packets. In this commit, HTTP response is divided into two packets. In addition, I fixed the HTTP response returned at the correct timing. [1] https://lore.kernel.org/u-boot/CAFLszThEbk2Jr8OZ6Hj21wPSnJjgJhaDe037RqwHvwt1KjB3_A@mail.gmail.com/ Signed-off-by: Yasuharu Shibata <yasuharu.shibata@gmail.com> Reported-by: Simon Glass <sjg@chromium.org>
2024-05-20Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"Tom Rini
As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-19Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""Tom Rini
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-06test: Remove <common.h> and add needed includesTom Rini
Remove <common.h> from all "test/" files and when needed add missing include files directly. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-11-28test: cmd: add test for wget command.Ying-Chun Liu (PaulLiu)
Simulate a TCP HTTP server's response for testing wget command. Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org> Cc: Christian Gmeiner <christian.gmeiner@gmail.com> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Michal Simek <michal.simek@xilinx.com> Cc: Ramon Fried <rfried.dev@gmail.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>