Revert "Temporarily ignore ethernet tests until prebuilts are updated"

This reverts commit 14f45a3e98.

Reason for revert: Reenabling tests after prebuilts are updated.

Bug: 233824546
Change-Id: I6883ea55dd390e7fe102b735e0b757e838d9eff6
Merged-In: I8e806b3b884f2e0b6c1a1d2fffdb9a99c5dd60e8
This commit is contained in:
Patrick Rohr
2022-05-26 02:13:09 +00:00
parent 9c5f92f0f1
commit 3a7645fc75
4 changed files with 0 additions and 74 deletions

View File

@@ -65,7 +65,6 @@ import com.android.testutils.waitForIdle
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 @@ class EthernetManagerTest {
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 @@ class EthernetManagerTest {
listener.assertNoCallback()
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
fun testGetInterfaceList() {
setIncludeTestInterfaces(true)
@@ -434,7 +431,6 @@ class EthernetManagerTest {
removeInterface(iface2)
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
fun testNetworkRequest_withSingleExistingInterface() {
setIncludeTestInterfaces(true)
@@ -453,7 +449,6 @@ class EthernetManagerTest {
listenerCb.eventuallyExpectLost(network)
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
fun testNetworkRequest_beforeSingleInterfaceIsUp() {
setIncludeTestInterfaces(true)
@@ -472,7 +467,6 @@ class EthernetManagerTest {
releaseNetwork(cb)
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
fun testNetworkRequest_withMultipleInterfaces() {
setIncludeTestInterfaces(true)
@@ -495,7 +489,6 @@ class EthernetManagerTest {
releaseNetwork(cb)
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
fun testNetworkRequest_withInterfaceBeingReplaced() {
setIncludeTestInterfaces(true)
@@ -516,7 +509,6 @@ class EthernetManagerTest {
releaseNetwork(cb)
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
fun testNetworkRequest_withMultipleInterfacesAndRequests() {
setIncludeTestInterfaces(true)

View File

@@ -68,7 +68,6 @@ import com.android.testutils.DevSdkIgnoreRule;
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 @@ public class EthernetNetworkFactoryTest {
clearInvocations(mNetworkAgent);
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateInterfaceLinkStateForActiveProvisioningInterface() throws Exception {
initEthernetNetworkFactory();
@@ -314,7 +312,6 @@ public class EthernetNetworkFactoryTest {
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 @@ public class EthernetNetworkFactoryTest {
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 @@ public class EthernetNetworkFactoryTest {
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 @@ public class EthernetNetworkFactoryTest {
listener.expectOnError();
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateInterfaceLinkStateWithNoChanges() throws Exception {
initEthernetNetworkFactory();
@@ -377,7 +371,6 @@ public class EthernetNetworkFactoryTest {
listener.expectOnError();
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testProvisioningLoss() throws Exception {
initEthernetNetworkFactory();
@@ -390,7 +383,6 @@ public class EthernetNetworkFactoryTest {
verify(mIpClient).startProvisioning(any());
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testProvisioningLossForDisappearedInterface() throws Exception {
initEthernetNetworkFactory();
@@ -412,7 +404,6 @@ public class EthernetNetworkFactoryTest {
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 @@ public class EthernetNetworkFactoryTest {
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 @@ public class EthernetNetworkFactoryTest {
verifyStop();
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testNetworkUnwantedWithStaleNetworkAgent() throws Exception {
initEthernetNetworkFactory();
@@ -460,7 +449,6 @@ public class EthernetNetworkFactoryTest {
verify(mNetworkAgent, never()).unregister();
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testTransportOverrideIsCorrectlySet() throws Exception {
initEthernetNetworkFactory();
@@ -482,7 +470,6 @@ public class EthernetNetworkFactoryTest {
ConnectivityManager.TYPE_NONE);
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testReachabilityLoss() throws Exception {
initEthernetNetworkFactory();
@@ -503,7 +490,6 @@ public class EthernetNetworkFactoryTest {
return staleIpClientCallbacks;
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testIgnoreOnIpLayerStartedCallbackForStaleCallback() throws Exception {
initEthernetNetworkFactory();
@@ -516,7 +502,6 @@ public class EthernetNetworkFactoryTest {
verify(mNetworkAgent, never()).register();
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testIgnoreOnIpLayerStoppedCallbackForStaleCallback() throws Exception {
initEthernetNetworkFactory();
@@ -529,7 +514,6 @@ public class EthernetNetworkFactoryTest {
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 @@ public class EthernetNetworkFactoryTest {
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 @@ public class EthernetNetworkFactoryTest {
}
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateInterfaceCallsListenerCorrectlyOnSuccess() throws Exception {
initEthernetNetworkFactory();
@@ -627,7 +609,6 @@ public class EthernetNetworkFactoryTest {
}
@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 @@ public class EthernetNetworkFactoryTest {
}
@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 @@ public class EthernetNetworkFactoryTest {
}
@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 @@ public class EthernetNetworkFactoryTest {
failedListener.expectOnError();
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateInterfaceRestartsAgentCorrectly() throws Exception {
initEthernetNetworkFactory();
@@ -702,7 +680,6 @@ public class EthernetNetworkFactoryTest {
verifyRestart(ipConfiguration);
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateInterfaceForNonExistingInterface() throws Exception {
initEthernetNetworkFactory();
@@ -717,7 +694,6 @@ public class EthernetNetworkFactoryTest {
listener.expectOnError();
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateInterfaceWithNullIpConfiguration() throws Exception {
initEthernetNetworkFactory();

View File

@@ -45,7 +45,6 @@ import androidx.test.filters.SmallTest;
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 @@ public class EthernetServiceImplTest {
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 @@ public class EthernetServiceImplTest {
});
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateConfigurationRejectsWhenEthNotStarted() {
mEthernetServiceImpl.mStarted.set(false);
@@ -113,7 +110,6 @@ public class EthernetServiceImplTest {
});
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testConnectNetworkRejectsWhenEthNotStarted() {
mEthernetServiceImpl.mStarted.set(false);
@@ -122,7 +118,6 @@ public class EthernetServiceImplTest {
});
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testDisconnectNetworkRejectsWhenEthNotStarted() {
mEthernetServiceImpl.mStarted.set(false);
@@ -131,7 +126,6 @@ public class EthernetServiceImplTest {
});
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateConfigurationRejectsNullIface() {
assertThrows(NullPointerException.class, () -> {
@@ -139,7 +133,6 @@ public class EthernetServiceImplTest {
});
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testConnectNetworkRejectsNullIface() {
assertThrows(NullPointerException.class, () -> {
@@ -147,7 +140,6 @@ public class EthernetServiceImplTest {
});
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testDisconnectNetworkRejectsNullIface() {
assertThrows(NullPointerException.class, () -> {
@@ -155,7 +147,6 @@ public class EthernetServiceImplTest {
});
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateConfigurationWithCapabilitiesRejectsWithoutAutomotiveFeature() {
toggleAutomotiveFeature(false);
@@ -164,7 +155,6 @@ public class EthernetServiceImplTest {
});
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateConfigurationWithCapabilitiesWithAutomotiveFeature() {
toggleAutomotiveFeature(false);
@@ -175,7 +165,6 @@ public class EthernetServiceImplTest {
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 @@ public class EthernetServiceImplTest {
});
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testDisconnectNetworkRejectsWithoutAutomotiveFeature() {
toggleAutomotiveFeature(false);
@@ -205,7 +193,6 @@ public class EthernetServiceImplTest {
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 @@ public class EthernetServiceImplTest {
});
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testConnectNetworkRejectsWithoutManageEthPermission() {
denyManageEthPermission();
@@ -223,7 +209,6 @@ public class EthernetServiceImplTest {
});
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testDisconnectNetworkRejectsWithoutManageEthPermission() {
denyManageEthPermission();
@@ -236,7 +221,6 @@ public class EthernetServiceImplTest {
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 @@ public class EthernetServiceImplTest {
});
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testConnectNetworkRejectsTestRequestWithoutTestPermission() {
enableTestInterface();
@@ -256,7 +239,6 @@ public class EthernetServiceImplTest {
});
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testDisconnectNetworkRejectsTestRequestWithoutTestPermission() {
enableTestInterface();
@@ -266,7 +248,6 @@ public class EthernetServiceImplTest {
});
}
@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 @@ public class EthernetServiceImplTest {
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 @@ public class EthernetServiceImplTest {
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 @@ public class EthernetServiceImplTest {
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 @@ public class EthernetServiceImplTest {
.setNetworkCapabilities(nc).build();
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testUpdateConfigurationForTestRequestDoesNotRequireAutoOrEthernetPermission() {
enableTestInterface();
@@ -348,7 +323,6 @@ public class EthernetServiceImplTest {
eq(request.getNetworkCapabilities()), eq(NULL_LISTENER));
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testConnectNetworkForTestRequestDoesNotRequireAutoOrNetPermission() {
enableTestInterface();
@@ -359,7 +333,6 @@ public class EthernetServiceImplTest {
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 @@ public class EthernetServiceImplTest {
}
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testSetEthernetEnabled() {
denyPermissions(android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK);

View File

@@ -60,7 +60,6 @@ import com.android.testutils.HandlerUtils;
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 @@ public class EthernetTrackerTest {
/**
* 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 @@ public class EthernetTrackerTest {
/**
* 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 @@ public class EthernetTrackerTest {
/**
* 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 @@ public class EthernetTrackerTest {
configTransports).build());
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testCreateEthernetTrackerConfigReturnsCorrectValue() {
final String capabilities = "2";
@@ -335,14 +330,12 @@ public class EthernetTrackerTest {
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 @@ public class EthernetTrackerTest {
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 @@ public class EthernetTrackerTest {
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 @@ public class EthernetTrackerTest {
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 @@ public class EthernetTrackerTest {
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 @@ public class EthernetTrackerTest {
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 @@ public class EthernetTrackerTest {
return ifaceParcel;
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testListenEthernetStateChange() throws Exception {
tracker.setIncludeTestInterfaces(true);
@@ -487,7 +474,6 @@ public class EthernetTrackerTest {
anyInt(), any());
}
@Ignore("TODO: temporarily ignore tests until prebuilts are updated")
@Test
public void testListenEthernetStateChange_unsolicitedEventListener() throws Exception {
when(mNetd.interfaceGetList()).thenReturn(new String[] {});