]> Git Repo - J-u-boot.git/commitdiff
test/cmd/wget.c: Fix loadaddr rewrite
authorMarek Vasut <[email protected]>
Sun, 26 Jan 2025 23:57:03 +0000 (00:57 +0100)
committerTom Rini <[email protected]>
Mon, 27 Jan 2025 18:46:44 +0000 (12:46 -0600)
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]>
test/cmd/wget.c

index b020d20ad70beecc50db9600fb0582635bd45822..445750660c28550e888954693147461c42b062c2 100644 (file)
@@ -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;
 }
This page took 0.039217 seconds and 4 git commands to generate.