aboutsummaryrefslogtreecommitdiff
path: root/test/py
diff options
context:
space:
mode:
authorPiotr Kubik <piotr.kubik@iopsys.eu>2023-11-24 17:30:46 +0100
committerTom Rini <trini@konsulko.com>2023-12-20 10:46:54 -0500
commit7481632b192f61b5bcb028c885a460d8b9c2731c (patch)
treed9324601c3458c8d2efc1ea41d83ffbdb40f75fe /test/py
parent785834d62ef3c4121601a4a68a032d96100b7475 (diff)
bootm: Fix flags used for bootargs string substitution
Commit 51bb33846ad2 ("bootm: Support string substitution in bootargs") introduced a feature of bootargs string substitution and changed a flag used in bootm_process_cmdline_env() call to be either true or false. With this flag value, condition in bootm_process_cmdline() `if (flags & BOOTM_CL_SUBST)` is never true and process_subst() is never called. Add a simple test to verify if substitution works OK. Signed-off-by: Piotr Kubik <piotr.kubik@iopsys.eu> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/py')
-rwxr-xr-xtest/py/tests/test_fit.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/py/tests/test_fit.py b/test/py/tests/test_fit.py
index 04f64fd4bc..8f9c4b2641 100755
--- a/test/py/tests/test_fit.py
+++ b/test/py/tests/test_fit.py
@@ -339,6 +339,14 @@ def test_fit(u_boot_console):
'U-Boot loaded FDT from offset %#x, FDT is actually at %#x' %
(fit_offset, real_fit_offset))
+ # Check if bootargs strings substitution works
+ output = cons.run_command_list([
+ 'env set bootargs \\\"\'my_boot_var=${foo}\'\\\"',
+ 'env set foo bar',
+ 'bootm prep',
+ 'env print bootargs'])
+ assert 'bootargs="my_boot_var=bar"' in output, "Bootargs strings not substituted"
+
# Now a kernel and an FDT
with cons.log.section('Kernel + FDT load'):
params['fdt_load'] = 'load = <%#x>;' % params['fdt_addr']