ethernet: skip tests on devices without support

Test: atest EthernetManagerTest
Bug: 239521025
Change-Id: Ie39cc371315899ead8c6991ef8d5e8b95cc0e3a8
This commit is contained in:
Patrick Rohr 2022-07-29 08:21:35 -07:00
commit 29d4aaabcf

View file

@ -306,14 +306,18 @@ class EthernetManagerTest {
}
}
private fun isEthernetSupported() = em != null
@Before
fun setUp() {
assumeTrue(isEthernetSupported())
setIncludeTestInterfaces(true)
addInterfaceStateListener(ifaceListener)
}
@After
fun tearDown() {
if (!isEthernetSupported()) return
// Reenable ethernet, so ABSENT callbacks are received.
setEthernetEnabled(true)