[PATCH 28/39] test: Update bootm test to restore silent_console

Simon Glass sjg at chromium.org
Tue Nov 19 14:18:33 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>
---

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

diff --git a/test/boot/bootm.c b/test/boot/bootm.c
index 52b83f149cb..db024bb1b0b 100644
--- a/test/boot/bootm.c
+++ b/test/boot/bootm.c
@@ -121,6 +121,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);
@@ -226,6 +229,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);
@@ -243,6 +248,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