<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/test/cmd/wget.c, branch next</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>test: wget: add a test case for validating URI</title>
<updated>2025-07-03T08:34:20+00:00</updated>
<author>
<name>Sughosh Ganu</name>
<email>sughosh.ganu@linaro.org</email>
</author>
<published>2025-07-03T06:43:08+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=46a564d689b61660919f11be332d47a206ed24d5'/>
<id>46a564d689b61660919f11be332d47a206ed24d5</id>
<content type='text'>
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 &lt;sughosh.ganu@linaro.org&gt;
Reviewed-by: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
Signed-off-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;sughosh.ganu@linaro.org&gt;
Reviewed-by: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
Signed-off-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test/cmd/wget.c: Fix loadaddr rewrite</title>
<updated>2025-01-27T18:46:44+00:00</updated>
<author>
<name>Marek Vasut</name>
<email>marek.vasut+renesas@mailbox.org</email>
</author>
<published>2025-01-26T23:57:03+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=082b41df8abd8b2d0f2dccce8ed74fe7f5c6509e'/>
<id>082b41df8abd8b2d0f2dccce8ed74fe7f5c6509e</id>
<content type='text'>
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 &lt;marek.vasut+renesas@mailbox.org&gt;
Acked-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
Reviewed-by: Fabio Estevam &lt;festevam@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;marek.vasut+renesas@mailbox.org&gt;
Acked-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
Reviewed-by: Fabio Estevam &lt;festevam@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test/cmd/wget: replace bogus response with an actual response from the HTTP server</title>
<updated>2024-12-28T17:59:42+00:00</updated>
<author>
<name>Mikhail Kshevetskiy</name>
<email>mikhail.kshevetskiy@iopsys.eu</email>
</author>
<published>2024-12-28T10:46:34+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ece1631f5e1d12477a9fd439570a3f05e4e8fb1e'/>
<id>ece1631f5e1d12477a9fd439570a3f05e4e8fb1e</id>
<content type='text'>
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&lt;html&gt;&lt;body&gt;Hi&lt;/body&gt;&lt;/html&gt;\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-&gt;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 "&lt;html&gt;&lt;body&gt;Hi&lt;/body&gt;&lt;/html&gt;\n" &gt; ~/public_html/test.html
  echo -ne "GET /~${USER}/test.html HTTP/1.0\r\n\r\n" | netcat localhost 80 &gt;reply.txt

Signed-off-by: Mikhail Kshevetskiy &lt;mikhail.kshevetskiy@iopsys.eu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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&lt;html&gt;&lt;body&gt;Hi&lt;/body&gt;&lt;/html&gt;\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-&gt;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 "&lt;html&gt;&lt;body&gt;Hi&lt;/body&gt;&lt;/html&gt;\n" &gt; ~/public_html/test.html
  echo -ne "GET /~${USER}/test.html HTTP/1.0\r\n\r\n" | netcat localhost 80 &gt;reply.txt

Signed-off-by: Mikhail Kshevetskiy &lt;mikhail.kshevetskiy@iopsys.eu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test/cmd/wget: fix the test</title>
<updated>2024-12-28T17:59:42+00:00</updated>
<author>
<name>Mikhail Kshevetskiy</name>
<email>mikhail.kshevetskiy@iopsys.eu</email>
</author>
<published>2024-12-28T10:46:33+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=fa3ae38b837e24d468b59f0c96b8172f47ba0ceb'/>
<id>fa3ae38b837e24d468b59f0c96b8172f47ba0ceb</id>
<content type='text'>
Changes:
 * update to new tcp stack
 * fix zero values for ISS and IRS issue (see RFC 9293)

Signed-off-by: Mikhail Kshevetskiy &lt;mikhail.kshevetskiy@iopsys.eu&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Changes:
 * update to new tcp stack
 * fix zero values for ISS and IRS issue (see RFC 9293)

Signed-off-by: Mikhail Kshevetskiy &lt;mikhail.kshevetskiy@iopsys.eu&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test/cmd/wget.c: move net_test_wget() to the cmd test suite</title>
<updated>2024-11-29T13:51:57+00:00</updated>
<author>
<name>Jerome Forissier</name>
<email>jerome.forissier@linaro.org</email>
</author>
<published>2024-11-15T16:45:14+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=20f641987f83c4679a1181d79a546a098f11f5ad'/>
<id>20f641987f83c4679a1181d79a546a098f11f5ad</id>
<content type='text'>
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 &lt;sjg@chromium.org&gt;
Signed-off-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;sjg@chromium.org&gt;
Signed-off-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test: Tidy up checking for console end</title>
<updated>2024-08-27T00:51:49+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2024-08-22T13:58:03+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=e6f498e70bec1cec5db81b62d544e9cba3607504'/>
<id>e6f498e70bec1cec5db81b62d544e9cba3607504</id>
<content type='text'>
Use the ut_assert_console_end() function provided, rather than doing it
separately.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use the ut_assert_console_end() function provided, rather than doing it
separately.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test: cmd: Drop unnecessary console_record_reset_enable()</title>
<updated>2024-08-27T00:51:49+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2024-08-22T13:57:58+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=0af38d12d98070bc09001e200b15c7e0d6a80388'/>
<id>0af38d12d98070bc09001e200b15c7e0d6a80388</id>
<content type='text'>
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 &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test: cmd: Use UTF_CONSOLE in tests</title>
<updated>2024-08-27T00:51:49+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2024-08-22T13:57:57+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=0e77c2b6117c1a8497676b33de85766c3f3a904c'/>
<id>0e77c2b6117c1a8497676b33de85766c3f3a904c</id>
<content type='text'>
Set this flag rather than doing things manually in the test.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Set this flag rather than doing things manually in the test.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test: Drop the blank line before test macros</title>
<updated>2024-08-27T00:51:49+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2024-08-22T13:57:49+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b073d48e8dd7d178ebd237089be730d15c72ddfc'/>
<id>b073d48e8dd7d178ebd237089be730d15c72ddfc</id>
<content type='text'>
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 &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>sandbox: fix wget test failure after fixing wget issue</title>
<updated>2024-08-15T17:32:12+00:00</updated>
<author>
<name>Yasuharu Shibata</name>
<email>yasuharu.shibata@gmail.com</email>
</author>
<published>2024-08-14T12:41:07+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=dbb6b5a01098ea2b981cc35d21edd52d33b03f50'/>
<id>dbb6b5a01098ea2b981cc35d21edd52d33b03f50</id>
<content type='text'>
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 &lt;yasuharu.shibata@gmail.com&gt;
Reported-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;yasuharu.shibata@gmail.com&gt;
Reported-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
