From: Simon Glass <sjg@chromium.org>
The PXE tests set kernel_addr_r to 0x2000000 and do not restore the
original value. When bootflow_extlinux_localboot or
bootflow_scan_extlinux run later, they read the wrong address from
the environment and fail.
Restore kernel_addr_r and ramdisk_addr_r to their default values at
the start of each test so they do not depend on test ordering.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
test/boot/bootflow.c | 10 ++++++++++
1 file changed, 10 insertions(+)
@@ -1677,6 +1677,11 @@ static int bootflow_scan_extlinux(struct unit_test_state *uts)
const void *fdt;
int node;
+ /* restore default addresses in case PXE tests changed them */
+ ut_assertok(env_set("kernel_addr_r", "1000000"));
+ ut_assertok(env_set("ramdisk_addr_r", "2000000"));
+ ut_assertok(env_set("fdt_addr_r", "c00000"));
+
ut_assertok(run_command("bootflow scan", 0));
ut_assert_console_end();
ut_assertok(bootstd_get_priv(&std));
@@ -1745,6 +1750,11 @@ static int bootflow_extlinux_localboot(struct unit_test_state *uts)
const char **old_order;
struct bootflow *bflow;
+ /* restore default addresses in case PXE tests changed them */
+ ut_assertok(env_set("kernel_addr_r", "1000000"));
+ ut_assertok(env_set("ramdisk_addr_r", "2000000"));
+ ut_assertok(env_set("fdt_addr_r", "c00000"));
+
ut_assertok(prep_mmc_bootdev(uts, "mmc9", false, &old_order));
ut_assertok(run_command("bootflow scan", 0));