summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2022-09-15 00:29:48 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2022-09-15 00:29:48 +0000
commit175881c63b435cea6f06d64828855c76e83f46ef (patch)
treeff890d6d19e58f95bef1fcc4996c88c682c9642a
parent4fdc5fda4aa9c6253148d408d78c478d31783347 (diff)
parentbfeb1580a7c21f787ecb6ebb7b87a8112eaf4713 (diff)
downloadConnectivity-175881c63b435cea6f06d64828855c76e83f46ef.tar.gz
Merge "ethernet: skip tests on devices without support" into android13-tests-dev
-rw-r--r--tests/cts/net/src/android/net/cts/EthernetManagerTest.kt6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/cts/net/src/android/net/cts/EthernetManagerTest.kt b/tests/cts/net/src/android/net/cts/EthernetManagerTest.kt
index db24b4493b..8b5774c225 100644
--- a/tests/cts/net/src/android/net/cts/EthernetManagerTest.kt
+++ b/tests/cts/net/src/android/net/cts/EthernetManagerTest.kt
@@ -64,6 +64,7 @@ import com.android.testutils.runAsShell
import com.android.testutils.waitForIdle
import org.junit.After
import org.junit.Assume.assumeFalse
+import org.junit.Assume.assumeTrue
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
@@ -227,15 +228,20 @@ class EthernetManagerTest {
}
}
+ private fun isEthernetSupported() = em != null
+
@Before
fun setUp() {
+ assumeTrue(isEthernetSupported())
setIncludeTestInterfaces(true)
addInterfaceStateListener(ifaceListener)
}
@After
fun tearDown() {
+ if (!isEthernetSupported()) return
setIncludeTestInterfaces(false)
+
for (iface in createdIfaces) {
iface.destroy()
ifaceListener.eventuallyExpect(iface, STATE_ABSENT, ROLE_NONE)