[PATCH v3 34/46] test: Update bootm test to restore silent_console

Simon Glass sjg at chromium.org
Fri Dec 6 03:36:13 CET 2024


Unset this environment variable at the end of bootm_test_silent() et al
to avoid affecting subsequent tests.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

(no changes since v1)

 test/boot/bootm.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/test/boot/bootm.c b/test/boot/bootm.c
index 9455f44884c..0dd8bc2979f 100644
--- a/test/boot/bootm.c
+++ b/test/boot/bootm.c
@@ -122,6 +122,9 @@ static int bootm_test_silent(struct unit_test_state *uts)
 	ut_assertok(bootm_process_cmdline(buf, BUF_SIZE, BOOTM_CL_SILENT));
 	ut_asserteq_str("console=ttynull something", buf);
 
+	/* restore settings */
+	env_set("silent_linux", NULL);
+
 	return 0;
 }
 BOOTM_TEST(bootm_test_silent, 0);
@@ -229,6 +232,8 @@ static int bootm_test_subst_var(struct unit_test_state *uts)
 	ut_assertok(bootm_process_cmdline_env(BOOTM_CL_SILENT));
 	ut_asserteq_str("some${var}thing console=ttynull", env_get("bootargs"));
 
+	env_set("silent_linux", NULL);
+
 	return 0;
 }
 BOOTM_TEST(bootm_test_subst_var, 0);
@@ -246,6 +251,8 @@ static int bootm_test_subst_both(struct unit_test_state *uts)
 	ut_assertok(bootm_process_cmdline_env(BOOTM_CL_ALL));
 	ut_asserteq_str("some1234567890thing console=ttynull", env_get("bootargs"));
 
+	env_set("silent_linux", NULL);
+
 	return 0;
 }
 BOOTM_TEST(bootm_test_subst_both, 0);
-- 
2.34.1



More information about the U-Boot mailing list