diff options
author | Simon Glass <sjg@chromium.org> | 2023-01-17 20:48:07 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-01-24 02:11:41 +0300 |
commit | 79a7d4a61ff34c7745811c7b3090a60b230c2ef9 (patch) | |
tree | c695ce097337e6cf870d2e013d436ed50df3e3c7 /test | |
parent | d73420e4fe7c7e22a41ed140c6be9c11db6b9503 (diff) | |
download | u-boot-79a7d4a61ff34c7745811c7b3090a60b230c2ef9.tar.xz |
bootstd: Allow hunting for bootdevs of a given priority
Add a way to run the hunter function for a particular priority, so that
new bootdevs can be found.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/boot/bootdev.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/boot/bootdev.c b/test/boot/bootdev.c index e6045b05d8..f9653633a6 100644 --- a/test/boot/bootdev.c +++ b/test/boot/bootdev.c @@ -363,3 +363,28 @@ static int bootdev_test_bootable(struct unit_test_state *uts) return 0; } BOOTSTD_TEST(bootdev_test_bootable, UT_TESTF_DM | UT_TESTF_SCAN_FDT); + +/* Check hunting for bootdev of a particular priority */ +static int bootdev_test_hunt_prio(struct unit_test_state *uts) +{ + test_set_skip_delays(true); + + console_record_reset_enable(); + ut_assertok(bootdev_hunt_prio(BOOTDEVP_2_SCAN_FAST, false)); + ut_assert_nextline("scanning bus for devices..."); + ut_assert_skip_to_line(" Type: Hard Disk"); + ut_assert_nextlinen(" Capacity:"); + ut_assert_console_end(); + + /* now try a different priority, verbosely */ + ut_assertok(bootdev_hunt_prio(BOOTDEVP_3_SCAN_SLOW, true)); + ut_assert_nextline("Hunting with: ide"); + ut_assert_nextline("Bus 0: not available "); + ut_assert_nextline("Hunting with: usb"); + ut_assert_nextline( + "Bus usb@1: scanning bus usb@1 for devices... 5 USB Device(s) found"); + ut_assert_console_end(); + + return 0; +} +BOOTSTD_TEST(bootdev_test_hunt_prio, UT_TESTF_DM | UT_TESTF_SCAN_FDT); |