From 70dd88657b45e5439bf762507f2e1c44c2dee289 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 17 Jan 2023 10:47:28 -0700 Subject: sandbox: Allow ethernet bootdevs to be disabled for tests Most tests don't want these and can create a lot of noise. Add a way to disable them. Use that in tests, with a flag provided to enable them for tests that need this feature. Signed-off-by: Simon Glass --- test/test-main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/test-main.c b/test/test-main.c index 72aa3a0aa8f..9d0f6643d5e 100644 --- a/test/test-main.c +++ b/test/test-main.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -303,8 +304,13 @@ static int test_pre_run(struct unit_test_state *uts, struct unit_test *test) ut_assertok(do_autoprobe(uts)); if (!CONFIG_IS_ENABLED(OF_PLATDATA) && - (test->flags & UT_TESTF_SCAN_FDT)) + (test->flags & UT_TESTF_SCAN_FDT)) { + /* + * only set this if we know the ethernet uclass will be created + */ + eth_set_enable_bootdevs(test->flags & UT_TESTF_ETH_BOOTDEV); ut_assertok(dm_extended_scan(false)); + } /* * Do this after FDT scan since dm_scan_other() in bootstd-uclass.c -- cgit v1.3.1