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>
This commit is contained in:
Simon Glass
2023-01-17 10:47:28 -07:00
committed by Tom Rini
parent f43b2df3e0
commit 70dd88657b
4 changed files with 48 additions and 2 deletions

View File

@@ -71,6 +71,7 @@ enum {
* since it cannot access the flags.
*/
UT_TESTF_MANUAL = BIT(8),
UT_TESTF_ETH_BOOTDEV = BIT(9), /* enable Ethernet bootdevs */
};
/**
@@ -194,4 +195,15 @@ static inline bool test_eth_enabled(void)
return enabled;
}
/* Allow ethernet bootdev to be ignored for testing purposes */
static inline bool test_eth_bootdev_enabled(void)
{
bool enabled = true;
#ifdef CONFIG_SANDBOX
enabled = sandbox_eth_enabled();
#endif
return enabled;
}
#endif /* __TEST_TEST_H */