From: Mattijs Korpershoek Date: Fri, 22 Nov 2024 14:11:34 +0000 (+0100) Subject: test: boot: Set DM|SCAN_FDT flags for bootmeth_{cros,android} X-Git-Url: http://git.dujemihanovic.xyz/html/%7B%7B%20.RelPermalink%20%7D%7D?a=commitdiff_plain;h=e92b5d0ddfbe95b0d6bf5277f06d00b1acfa0b83;p=u-boot.git test: boot: Set DM|SCAN_FDT flags for bootmeth_{cros,android} We make fewer calls to dm_test_restore() since commit fbdac8155c89 ("test: Expand implementation of ut_list_has_dm_tests()") Because of this some valid test combinations are now broken: $ ./test/py/test.py --bd sandbox --build -k test_ut $ ./test/py/test.py --bd sandbox --build -k "bootflow_android or bootflow_cros" Shows: Expected ' 2 cros ready mmc 4 mmc5.bootdev.part_4 ', got ' 2 cros ready mmc 2 mmc5.bootdev.part_2 ' Here prep_mmc_bootdev() is called twice and it will bind bootmeth_cros twice. Since bootmeth_cros is bound twice, 'bootflow scan' will find 2x the expected bootflows. Before commit fbdac8155c89 ("test: Expand implementation of ut_list_has_dm_tests()") this did not happen because a cleanup was called each time. Add UTF_DM and UTF_SCAN_FDT flags to both tests to make sure that the bootmeths are unbound after the test finishes. Fixes: fbdac8155c89 ("test: Expand implementation of ut_list_has_dm_tests()") Signed-off-by: Mattijs Korpershoek --- diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c index 9397328609..da713d8ed7 100644 --- a/test/boot/bootflow.c +++ b/test/boot/bootflow.c @@ -1197,7 +1197,7 @@ static int bootflow_cros(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootflow_cros, UTF_CONSOLE); +BOOTSTD_TEST(bootflow_cros, UTF_CONSOLE | UTF_DM | UTF_SCAN_FDT); /* Test Android bootmeth */ static int bootflow_android(struct unit_test_state *uts) @@ -1220,7 +1220,7 @@ static int bootflow_android(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootflow_android, UTF_CONSOLE); +BOOTSTD_TEST(bootflow_android, UTF_CONSOLE | UTF_DM | UTF_SCAN_FDT); /* Test EFI bootmeth */ static int bootflow_efi(struct unit_test_state *uts)