summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-01-17 20:47:28 +0300
committerTom Rini <trini@konsulko.com>2023-01-24 02:11:39 +0300
commit70dd88657b45e5439bf762507f2e1c44c2dee289 (patch)
tree5328a26970a170591162b9b316409e6820069201 /test
parentf43b2df3e068cc7be1aa5656c0c3223e270bba63 (diff)
downloadu-boot-70dd88657b45e5439bf762507f2e1c44c2dee289.tar.xz
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 <sjg@chromium.org>
Diffstat (limited to 'test')
-rw-r--r--test/test-main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/test-main.c b/test/test-main.c
index 72aa3a0aa8..9d0f6643d5 100644
--- a/test/test-main.c
+++ b/test/test-main.c
@@ -10,6 +10,7 @@
#include <cyclic.h>
#include <dm.h>
#include <event.h>
+#include <net.h>
#include <of_live.h>
#include <os.h>
#include <dm/ofnode.h>
@@ -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