Hi Denis, On 2026-06-23T01:49:28, None <[email protected]> wrote: > test: bootdev: scan with a broken high-priority device > > Add bootdev_hunt_fallthrough() test to verify that 'bootflow scan -l' > falls back to a lower-priority bootdev when a higher-priority hunter > fails. > > Introduce a simple 'sandbox-bootdev' device for the test. The new > bootdev can be configured to produce an error at the hunting stage. > > Introduce new host_set_flags_by_label() API and a flags field to > 'host_sb_plat' to simulate a bootdev hunter failure for the test. > > Adjust boot{dev,flow} tests which depend on bootdev hunters. > > Signed-off-by: Denis Mukhin <[email protected]> > > drivers/block/Makefile | 2 +- > drivers/block/host-uclass.c | 15 +++++++++ > drivers/block/sandbox-bootdev.c | 73 > +++++++++++++++++++++++++++++++++++++++++ > include/sandbox_host.h | 18 ++++++++++ > test/boot/bootdev.c | 23 ++++++------- > test/boot/bootflow.c | 46 ++++++++++++++++++++++++++ > test/boot/bootstd_common.h | 5 ++- > 7 files changed, 169 insertions(+), 13 deletions(-)
Reviewed-by: Simon Glass <[email protected]> code-style nits below > diff --git a/drivers/block/sandbox-bootdev.c b/drivers/block/sandbox-bootdev.c > @@ -0,0 +1,73 @@ > +/** > + * sandbox_bootdev_hunt() - Hunt host bootdev. > + * > + * Note, this hunter exists for bootdev testing to simulate a fail > + * mode. Do not use as an example of a real hunter. > + * > + * @info: Hunder details. > + * @show: Enable extra printouts. > + * > + * Returns: 0 if OK, -ve on error (expected by the test) > + */ Typo: Hunder -> Hunter. Also 'a fail mode' reads better as 'a failure mode'. > diff --git a/drivers/block/sandbox-bootdev.c b/drivers/block/sandbox-bootdev.c > @@ -0,0 +1,73 @@ > + if (plat->flags & HOST_FLAG_BROKEN) { > + ret = -ETIME; > + log_debug("cannot hunt sandbox device '%s': %d\n", > + plat->label, ret); > + return ret; > + } Please align the continuation with the character after the open parenthesis (tab + spaces) (patman will check this for you) > diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c > @@ -1532,3 +1534,47 @@ static int bootstd_images(struct unit_test_state *uts) > + ut_assert(!(std->hunters_used & BIT(HOST_HUNTER))); > + > + /* USB was hunted despite the sandbox hunter failure */ > + ut_assert(std->hunters_used & BIT(USB_HUNTER)); > + ut_assert_skip_to_line("Bus usb@1: 5 USB Device(s) found"); It might be worth asserting that 'Hunting with: host' appears before the USB one, so we know the host hunter was attempted? Regards, Simon

