Loading tests/integration/src/android/net/ip/IpClientIntegrationTest.java +15 −0 Original line number Diff line number Diff line Loading @@ -130,6 +130,7 @@ import com.android.networkstack.arp.ArpPacket; import com.android.server.NetworkObserverRegistry; import com.android.server.NetworkStackService.NetworkStackServiceManager; import com.android.server.connectivity.ipmemorystore.IpMemoryStoreService; import com.android.testutils.DevSdkIgnoreRule.IgnoreUpTo; import com.android.testutils.HandlerUtilsKt; import com.android.testutils.TapPacketReader; Loading Loading @@ -660,6 +661,12 @@ public class IpClientIntegrationTest { null /* captivePortalApiUrl */, null /* displayName */, null /* scanResultInfo */); } private List<DhcpPacket> performDhcpHandshake() throws Exception { return performDhcpHandshake(true /* isSuccessLease */, TEST_LEASE_DURATION_S, false /* isDhcpLeaseCacheEnabled */, false /* shouldReplyRapidCommitAck */, TEST_DEFAULT_MTU, false /* isDhcpIpConflictDetectEnabled */); } private DhcpPacket getNextDhcpPacket() throws ParseException { byte[] packet; while ((packet = mPacketReader.popPacket(PACKET_TIMEOUT_MS)) != null) { Loading Loading @@ -1047,6 +1054,14 @@ public class IpClientIntegrationTest { assertTrue(packet instanceof DhcpDiscoverPacket); } @Test @IgnoreUpTo(Build.VERSION_CODES.Q) public void testDhcpServerInLinkProperties() throws Exception { performDhcpHandshake(); ArgumentCaptor<LinkProperties> captor = ArgumentCaptor.forClass(LinkProperties.class); verify(mCb, timeout(TEST_TIMEOUT_MS)).onProvisioningSuccess(captor.capture()); assertEquals(SERVER_ADDR, captor.getValue().getDhcpServerAddress()); } @Test public void testRestoreInitialInterfaceMtu() throws Exception { doRestoreInitialMtuTest(true /* shouldChangeMtu */, false /* shouldRemoveTapInterface */); Loading Loading
tests/integration/src/android/net/ip/IpClientIntegrationTest.java +15 −0 Original line number Diff line number Diff line Loading @@ -130,6 +130,7 @@ import com.android.networkstack.arp.ArpPacket; import com.android.server.NetworkObserverRegistry; import com.android.server.NetworkStackService.NetworkStackServiceManager; import com.android.server.connectivity.ipmemorystore.IpMemoryStoreService; import com.android.testutils.DevSdkIgnoreRule.IgnoreUpTo; import com.android.testutils.HandlerUtilsKt; import com.android.testutils.TapPacketReader; Loading Loading @@ -660,6 +661,12 @@ public class IpClientIntegrationTest { null /* captivePortalApiUrl */, null /* displayName */, null /* scanResultInfo */); } private List<DhcpPacket> performDhcpHandshake() throws Exception { return performDhcpHandshake(true /* isSuccessLease */, TEST_LEASE_DURATION_S, false /* isDhcpLeaseCacheEnabled */, false /* shouldReplyRapidCommitAck */, TEST_DEFAULT_MTU, false /* isDhcpIpConflictDetectEnabled */); } private DhcpPacket getNextDhcpPacket() throws ParseException { byte[] packet; while ((packet = mPacketReader.popPacket(PACKET_TIMEOUT_MS)) != null) { Loading Loading @@ -1047,6 +1054,14 @@ public class IpClientIntegrationTest { assertTrue(packet instanceof DhcpDiscoverPacket); } @Test @IgnoreUpTo(Build.VERSION_CODES.Q) public void testDhcpServerInLinkProperties() throws Exception { performDhcpHandshake(); ArgumentCaptor<LinkProperties> captor = ArgumentCaptor.forClass(LinkProperties.class); verify(mCb, timeout(TEST_TIMEOUT_MS)).onProvisioningSuccess(captor.capture()); assertEquals(SERVER_ADDR, captor.getValue().getDhcpServerAddress()); } @Test public void testRestoreInitialInterfaceMtu() throws Exception { doRestoreInitialMtuTest(true /* shouldChangeMtu */, false /* shouldRemoveTapInterface */); Loading