Do not call EthernetManager APIs when tests are skipped
Calling setIncludeTestInterfaces(false) in tearDown() is not needed as super.tearDown() already takes care of it. In addition, the parent class's tearDown method also checks whether ethernet is supported and the tests actually ran. Leaving the setIncludeTestInterfaces(true) in setup is fine, as super.setUp() fails with an assumption violation if ethernet is not supported.
Note that this is a bit of a hack. NsdManagerDownstreamTetheringTest should not use EthernetTetheringTestBase as a base class (and EthernetTetheringTestBase should be deleted).
Change-Id: Ie1557250166fbf30c98e87dc2ffb4c3e001be167
Test: TH
Bug: 341063340
diff --git a/tests/cts/net/src/android/net/cts/NsdManagerDownstreamTetheringTest.kt b/tests/cts/net/src/android/net/cts/NsdManagerDownstreamTetheringTest.kt
index 284fcae..f45f881 100644
--- a/tests/cts/net/src/android/net/cts/NsdManagerDownstreamTetheringTest.kt
+++ b/tests/cts/net/src/android/net/cts/NsdManagerDownstreamTetheringTest.kt
@@ -59,7 +59,6 @@
@After
override fun tearDown() {
super.tearDown()
- setIncludeTestInterfaces(false)
}
@Test
@@ -107,7 +106,6 @@
@Test
fun testMdnsDiscoveryWorkOnTetheringInterface() {
assumeFalse(isInterfaceForTetheringAvailable())
- setIncludeTestInterfaces(true)
var downstreamIface: TestNetworkInterface? = null
var tetheringEventCallback: MyTetheringEventCallback? = null