Revert "Temporarily ignore ethernet tests until prebuilts are updated"
This reverts commit 14f45a3e988e948bb0fda178f184aa4563b1f4eb.
Reason for revert: Reenabling tests after prebuilts are updated.
Bug: 233824546
Change-Id: I6883ea55dd390e7fe102b735e0b757e838d9eff6
Merged-In: I8e806b3b884f2e0b6c1a1d2fffdb9a99c5dd60e8
diff --git a/tests/cts/net/src/android/net/cts/EthernetManagerTest.kt b/tests/cts/net/src/android/net/cts/EthernetManagerTest.kt
index a694f01..db24b44 100644
--- a/tests/cts/net/src/android/net/cts/EthernetManagerTest.kt
+++ b/tests/cts/net/src/android/net/cts/EthernetManagerTest.kt
@@ -65,7 +65,6 @@
import org.junit.After
import org.junit.Assume.assumeFalse
import org.junit.Before
-import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
import java.net.Inet6Address
@@ -321,7 +320,6 @@
private fun TestableNetworkCallback.assertNotLost(n: Network? = null) =
assertNoCallbackThat() { it is Lost && (n?.equals(it.network) ?: true) }
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
fun testCallbacks() {
// If an interface exists when the callback is registered, it is reported on registration.
@@ -411,7 +409,6 @@
listener.assertNoCallback()
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
fun testGetInterfaceList() {
setIncludeTestInterfaces(true)
@@ -434,7 +431,6 @@
removeInterface(iface2)
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
fun testNetworkRequest_withSingleExistingInterface() {
setIncludeTestInterfaces(true)
@@ -453,7 +449,6 @@
listenerCb.eventuallyExpectLost(network)
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
fun testNetworkRequest_beforeSingleInterfaceIsUp() {
setIncludeTestInterfaces(true)
@@ -472,7 +467,6 @@
releaseNetwork(cb)
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
fun testNetworkRequest_withMultipleInterfaces() {
setIncludeTestInterfaces(true)
@@ -495,7 +489,6 @@
releaseNetwork(cb)
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
fun testNetworkRequest_withInterfaceBeingReplaced() {
setIncludeTestInterfaces(true)
@@ -516,7 +509,6 @@
releaseNetwork(cb)
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
fun testNetworkRequest_withMultipleInterfacesAndRequests() {
setIncludeTestInterfaces(true)
diff --git a/tests/unit/java/com/android/server/ethernet/EthernetNetworkFactoryTest.java b/tests/unit/java/com/android/server/ethernet/EthernetNetworkFactoryTest.java
index 8e43253..568d40f 100644
--- a/tests/unit/java/com/android/server/ethernet/EthernetNetworkFactoryTest.java
+++ b/tests/unit/java/com/android/server/ethernet/EthernetNetworkFactoryTest.java
@@ -68,7 +68,6 @@
import org.junit.After;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
@@ -298,7 +297,6 @@
clearInvocations(mNetworkAgent);
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateInterfaceLinkStateForActiveProvisioningInterface() throws Exception {
initEthernetNetworkFactory();
@@ -314,7 +312,6 @@
assertEquals(listener.expectOnResult(), TEST_IFACE);
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateInterfaceLinkStateForProvisionedInterface() throws Exception {
initEthernetNetworkFactory();
@@ -329,7 +326,6 @@
assertEquals(listener.expectOnResult(), TEST_IFACE);
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateInterfaceLinkStateForUnprovisionedInterface() throws Exception {
initEthernetNetworkFactory();
@@ -347,7 +343,6 @@
assertEquals(listener.expectOnResult(), TEST_IFACE);
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateInterfaceLinkStateForNonExistingInterface() throws Exception {
initEthernetNetworkFactory();
@@ -362,7 +357,6 @@
listener.expectOnError();
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateInterfaceLinkStateWithNoChanges() throws Exception {
initEthernetNetworkFactory();
@@ -377,7 +371,6 @@
listener.expectOnError();
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testProvisioningLoss() throws Exception {
initEthernetNetworkFactory();
@@ -390,7 +383,6 @@
verify(mIpClient).startProvisioning(any());
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testProvisioningLossForDisappearedInterface() throws Exception {
initEthernetNetworkFactory();
@@ -412,7 +404,6 @@
verify(mIpClient, never()).startProvisioning(any());
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testLinkPropertiesChanged() throws Exception {
initEthernetNetworkFactory();
@@ -424,7 +415,6 @@
verify(mNetworkAgent).sendLinkPropertiesImpl(same(lp));
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testNetworkUnwanted() throws Exception {
initEthernetNetworkFactory();
@@ -435,7 +425,6 @@
verifyStop();
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testNetworkUnwantedWithStaleNetworkAgent() throws Exception {
initEthernetNetworkFactory();
@@ -460,7 +449,6 @@
verify(mNetworkAgent, never()).unregister();
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testTransportOverrideIsCorrectlySet() throws Exception {
initEthernetNetworkFactory();
@@ -482,7 +470,6 @@
ConnectivityManager.TYPE_NONE);
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testReachabilityLoss() throws Exception {
initEthernetNetworkFactory();
@@ -503,7 +490,6 @@
return staleIpClientCallbacks;
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testIgnoreOnIpLayerStartedCallbackForStaleCallback() throws Exception {
initEthernetNetworkFactory();
@@ -516,7 +502,6 @@
verify(mNetworkAgent, never()).register();
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testIgnoreOnIpLayerStoppedCallbackForStaleCallback() throws Exception {
initEthernetNetworkFactory();
@@ -529,7 +514,6 @@
verify(mIpClient, never()).startProvisioning(any());
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testIgnoreLinkPropertiesCallbackForStaleCallback() throws Exception {
initEthernetNetworkFactory();
@@ -542,7 +526,6 @@
verify(mNetworkAgent, never()).sendLinkPropertiesImpl(eq(lp));
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testIgnoreNeighborLossCallbackForStaleCallback() throws Exception {
initEthernetNetworkFactory();
@@ -611,7 +594,6 @@
}
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateInterfaceCallsListenerCorrectlyOnSuccess() throws Exception {
initEthernetNetworkFactory();
@@ -627,7 +609,6 @@
}
@DevSdkIgnoreRule.IgnoreUpTo(SC_V2) // TODO: Use to Build.VERSION_CODES.SC_V2 when available
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateInterfaceAbortsOnConcurrentRemoveInterface() throws Exception {
initEthernetNetworkFactory();
@@ -637,7 +618,6 @@
}
@DevSdkIgnoreRule.IgnoreUpTo(SC_V2) // TODO: Use to Build.VERSION_CODES.SC_V2 when available
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateInterfaceAbortsOnConcurrentUpdateInterfaceLinkState() throws Exception {
initEthernetNetworkFactory();
@@ -647,7 +627,6 @@
}
@DevSdkIgnoreRule.IgnoreUpTo(SC_V2) // TODO: Use to Build.VERSION_CODES.SC_V2 when available
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateInterfaceCallsListenerCorrectlyOnConcurrentRequests() throws Exception {
initEthernetNetworkFactory();
@@ -684,7 +663,6 @@
failedListener.expectOnError();
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateInterfaceRestartsAgentCorrectly() throws Exception {
initEthernetNetworkFactory();
@@ -702,7 +680,6 @@
verifyRestart(ipConfiguration);
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateInterfaceForNonExistingInterface() throws Exception {
initEthernetNetworkFactory();
@@ -717,7 +694,6 @@
listener.expectOnError();
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateInterfaceWithNullIpConfiguration() throws Exception {
initEthernetNetworkFactory();
diff --git a/tests/unit/java/com/android/server/ethernet/EthernetServiceImplTest.java b/tests/unit/java/com/android/server/ethernet/EthernetServiceImplTest.java
index e8e54f8..dd1f1ed 100644
--- a/tests/unit/java/com/android/server/ethernet/EthernetServiceImplTest.java
+++ b/tests/unit/java/com/android/server/ethernet/EthernetServiceImplTest.java
@@ -45,7 +45,6 @@
import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@@ -94,7 +93,6 @@
doReturn(shouldTrack).when(mEthernetTracker).isTrackingInterface(iface);
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testSetConfigurationRejectsWhenEthNotStarted() {
mEthernetServiceImpl.mStarted.set(false);
@@ -103,7 +101,6 @@
});
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateConfigurationRejectsWhenEthNotStarted() {
mEthernetServiceImpl.mStarted.set(false);
@@ -113,7 +110,6 @@
});
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testConnectNetworkRejectsWhenEthNotStarted() {
mEthernetServiceImpl.mStarted.set(false);
@@ -122,7 +118,6 @@
});
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testDisconnectNetworkRejectsWhenEthNotStarted() {
mEthernetServiceImpl.mStarted.set(false);
@@ -131,7 +126,6 @@
});
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateConfigurationRejectsNullIface() {
assertThrows(NullPointerException.class, () -> {
@@ -139,7 +133,6 @@
});
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testConnectNetworkRejectsNullIface() {
assertThrows(NullPointerException.class, () -> {
@@ -147,7 +140,6 @@
});
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testDisconnectNetworkRejectsNullIface() {
assertThrows(NullPointerException.class, () -> {
@@ -155,7 +147,6 @@
});
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateConfigurationWithCapabilitiesRejectsWithoutAutomotiveFeature() {
toggleAutomotiveFeature(false);
@@ -164,7 +155,6 @@
});
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateConfigurationWithCapabilitiesWithAutomotiveFeature() {
toggleAutomotiveFeature(false);
@@ -175,7 +165,6 @@
eq(UPDATE_REQUEST_WITHOUT_CAPABILITIES.getNetworkCapabilities()), isNull());
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testConnectNetworkRejectsWithoutAutomotiveFeature() {
toggleAutomotiveFeature(false);
@@ -184,7 +173,6 @@
});
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testDisconnectNetworkRejectsWithoutAutomotiveFeature() {
toggleAutomotiveFeature(false);
@@ -205,7 +193,6 @@
eq(Manifest.permission.MANAGE_TEST_NETWORKS), anyString());
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateConfigurationRejectsWithoutManageEthPermission() {
denyManageEthPermission();
@@ -214,7 +201,6 @@
});
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testConnectNetworkRejectsWithoutManageEthPermission() {
denyManageEthPermission();
@@ -223,7 +209,6 @@
});
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testDisconnectNetworkRejectsWithoutManageEthPermission() {
denyManageEthPermission();
@@ -236,7 +221,6 @@
when(mEthernetTracker.isValidTestInterface(eq(TEST_IFACE))).thenReturn(true);
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateConfigurationRejectsTestRequestWithoutTestPermission() {
enableTestInterface();
@@ -246,7 +230,6 @@
});
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testConnectNetworkRejectsTestRequestWithoutTestPermission() {
enableTestInterface();
@@ -256,7 +239,6 @@
});
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testDisconnectNetworkRejectsTestRequestWithoutTestPermission() {
enableTestInterface();
@@ -266,7 +248,6 @@
});
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateConfiguration() {
mEthernetServiceImpl.updateConfiguration(TEST_IFACE, UPDATE_REQUEST, NULL_LISTENER);
@@ -276,21 +257,18 @@
eq(UPDATE_REQUEST.getNetworkCapabilities()), eq(NULL_LISTENER));
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testConnectNetwork() {
mEthernetServiceImpl.connectNetwork(TEST_IFACE, NULL_LISTENER);
verify(mEthernetTracker).connectNetwork(eq(TEST_IFACE), eq(NULL_LISTENER));
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testDisconnectNetwork() {
mEthernetServiceImpl.disconnectNetwork(TEST_IFACE, NULL_LISTENER);
verify(mEthernetTracker).disconnectNetwork(eq(TEST_IFACE), eq(NULL_LISTENER));
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateConfigurationAcceptsTestRequestWithNullCapabilities() {
enableTestInterface();
@@ -304,7 +282,6 @@
eq(request.getNetworkCapabilities()), isNull());
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateConfigurationAcceptsRequestWithNullIpConfiguration() {
mEthernetServiceImpl.updateConfiguration(TEST_IFACE, UPDATE_REQUEST_WITHOUT_IP_CONFIG,
@@ -314,7 +291,6 @@
eq(UPDATE_REQUEST_WITHOUT_IP_CONFIG.getNetworkCapabilities()), isNull());
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateConfigurationRejectsInvalidTestRequest() {
enableTestInterface();
@@ -333,7 +309,6 @@
.setNetworkCapabilities(nc).build();
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateConfigurationForTestRequestDoesNotRequireAutoOrEthernetPermission() {
enableTestInterface();
@@ -348,7 +323,6 @@
eq(request.getNetworkCapabilities()), eq(NULL_LISTENER));
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testConnectNetworkForTestRequestDoesNotRequireAutoOrNetPermission() {
enableTestInterface();
@@ -359,7 +333,6 @@
verify(mEthernetTracker).connectNetwork(eq(TEST_IFACE), eq(NULL_LISTENER));
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testDisconnectNetworkForTestRequestDoesNotRequireAutoOrNetPermission() {
enableTestInterface();
@@ -377,7 +350,6 @@
}
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testSetEthernetEnabled() {
denyPermissions(android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK);
diff --git a/tests/unit/java/com/android/server/ethernet/EthernetTrackerTest.java b/tests/unit/java/com/android/server/ethernet/EthernetTrackerTest.java
index e90d55d..93789ca 100644
--- a/tests/unit/java/com/android/server/ethernet/EthernetTrackerTest.java
+++ b/tests/unit/java/com/android/server/ethernet/EthernetTrackerTest.java
@@ -60,7 +60,6 @@
import org.junit.After;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
@@ -114,7 +113,6 @@
/**
* Test: Creation of various valid static IP configurations
*/
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void createStaticIpConfiguration() {
// Empty gives default StaticIPConfiguration object
@@ -147,7 +145,6 @@
/**
* Test: Attempt creation of various bad static IP configurations
*/
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void createStaticIpConfiguration_Bad() {
assertStaticConfigurationFails("ip=192.0.2.1/24 gateway= blah=20.20.20.20"); // Unknown key
@@ -191,7 +188,6 @@
/**
* Test: Attempt to create a capabilties with various valid sets of capabilities/transports
*/
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void createNetworkCapabilities() {
@@ -318,7 +314,6 @@
configTransports).build());
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testCreateEthernetTrackerConfigReturnsCorrectValue() {
final String capabilities = "2";
@@ -335,14 +330,12 @@
assertEquals(transport, config.mTransport);
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testCreateEthernetTrackerConfigThrowsNpeWithNullInput() {
assertThrows(NullPointerException.class,
() -> EthernetTracker.createEthernetTrackerConfig(null));
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateConfiguration() {
final NetworkCapabilities capabilities = new NetworkCapabilities.Builder().build();
@@ -360,7 +353,6 @@
eq(TEST_IFACE), eq(ipConfig), eq(capabilities), eq(listener));
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testConnectNetworkCorrectlyCallsFactory() {
tracker.connectNetwork(TEST_IFACE, NULL_LISTENER);
@@ -370,7 +362,6 @@
eq(NULL_LISTENER));
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testDisconnectNetworkCorrectlyCallsFactory() {
tracker.disconnectNetwork(TEST_IFACE, NULL_LISTENER);
@@ -380,7 +371,6 @@
eq(NULL_LISTENER));
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testIsValidTestInterfaceIsFalseWhenTestInterfacesAreNotIncluded() {
final String validIfaceName = TEST_TAP_PREFIX + "123";
@@ -392,7 +382,6 @@
assertFalse(isValidTestInterface);
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testIsValidTestInterfaceIsFalseWhenTestInterfaceNameIsInvalid() {
final String invalidIfaceName = "123" + TEST_TAP_PREFIX;
@@ -404,7 +393,6 @@
assertFalse(isValidTestInterface);
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testIsValidTestInterfaceIsTrueWhenTestInterfacesIncludedAndValidName() {
final String validIfaceName = TEST_TAP_PREFIX + "123";
@@ -434,7 +422,6 @@
return ifaceParcel;
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testListenEthernetStateChange() throws Exception {
tracker.setIncludeTestInterfaces(true);
@@ -487,7 +474,6 @@
anyInt(), any());
}
- @Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testListenEthernetStateChange_unsolicitedEventListener() throws Exception {
when(mNetd.interfaceGetList()).thenReturn(new String[] {});