diff options
| author | Marek Vasut <[email protected]> | 2025-01-27 00:57:03 +0100 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-01-27 12:46:44 -0600 |
| commit | 082b41df8abd8b2d0f2dccce8ed74fe7f5c6509e (patch) | |
| tree | fb4db2bb98d89f116c9635e9cd30d8352743ab30 /test/cmd | |
| parent | d8a7100d658eb201fa0e955667fdff298db31945 (diff) | |
test/cmd/wget.c: Fix loadaddr rewrite
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 <[email protected]>
Acked-by: Jerome Forissier <[email protected]>
Reviewed-by: Fabio Estevam <[email protected]>
Diffstat (limited to 'test/cmd')
| -rw-r--r-- | test/cmd/wget.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/test/cmd/wget.c b/test/cmd/wget.c index b020d20ad70..445750660c2 100644 --- a/test/cmd/wget.c +++ b/test/cmd/wget.c @@ -217,28 +217,26 @@ static int net_test_wget(struct unit_test_state *uts) { char *prev_ethact = env_get("ethact"); char *prev_ethrotate = env_get("ethrotate"); - char *prev_loadaddr = env_get("loadaddr"); sandbox_eth_set_tx_handler(0, sb_http_handler); sandbox_eth_set_priv(0, uts); env_set("ethact", "eth@10002000"); env_set("ethrotate", "no"); - env_set("loadaddr", "0x20000"); - ut_assertok(run_command("wget ${loadaddr} 1.1.2.2:/index.html", 0)); + env_set("wgetaddr", "0x20000"); + ut_assertok(run_command("wget ${wgetaddr} 1.1.2.2:/index.html", 0)); ut_assert_nextline_empty(); ut_assert_nextline("Packets received 5, Transfer Successful"); ut_assert_nextline("Bytes transferred = 29 (1d hex)"); sandbox_eth_set_tx_handler(0, NULL); - run_command("md5sum ${loadaddr} ${filesize}", 0); + run_command("md5sum ${wgetaddr} ${filesize}", 0); ut_assert_nextline("md5 for 00020000 ... 0002001c ==> 847d5e7320a27462e90bc1ed75eb8cd8"); ut_assert_console_end(); env_set("ethact", prev_ethact); env_set("ethrotate", prev_ethrotate); - env_set("loadaddr", prev_loadaddr); return 0; } |
