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>
diff --git a/test/test-main.c b/test/test-main.c
index 72aa3a0..9d0f664 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 @@
 		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