diff options
author | Francis Laniel <francis.laniel@amarulasolutions.com> | 2023-12-22 22:02:35 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-12-28 12:02:56 -0500 |
commit | 3ea3c57ef5c5853f54714a3df8b0d406e8d4dd1c (patch) | |
tree | fdf086ba4577ceb7d63548788da2ef5935e4cc49 /test/boot/bootflow.c | |
parent | 3b13faf9f3dc59c998c31d8a4077b7906f7f965d (diff) |
cli: add modern hush as parser for run_command*()
Enables using, in code, modern hush as parser for run_command function family.
It also enables the command run to be used by CLI user of modern hush.
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Francis Laniel <francis.laniel@amarulasolutions.com>
Diffstat (limited to 'test/boot/bootflow.c')
-rw-r--r-- | test/boot/bootflow.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c index a9b555c7794..104f49deef2 100644 --- a/test/boot/bootflow.c +++ b/test/boot/bootflow.c @@ -710,7 +710,21 @@ static int bootflow_scan_menu_boot(struct unit_test_state *uts) ut_assert_skip_to_line("(2 bootflows, 2 valid)"); ut_assert_nextline("Selected: Armbian"); - ut_assert_skip_to_line("Boot failed (err=-14)"); + + if (gd->flags & GD_FLG_HUSH_OLD_PARSER) { + /* + * With old hush, despite booti failing to boot, i.e. returning + * CMD_RET_FAILURE, run_command() returns 0 which leads bootflow_boot(), as + * we are using bootmeth_script here, to return -EFAULT. + */ + ut_assert_skip_to_line("Boot failed (err=-14)"); + } else if (gd->flags & GD_FLG_HUSH_MODERN_PARSER) { + /* + * While with modern one, run_command() propagates CMD_RET_FAILURE returned + * by booti, so we get 1 here. + */ + ut_assert_skip_to_line("Boot failed (err=1)"); + } ut_assertnonnull(std->cur_bootflow); ut_assert_console_end(); |