Add CTS for systemReady() & getIpSecNetIdRange()
Bug: 182963354
Test: 1. atest CtsNetTestCases:ConnectivityManagerTest
2. atest CtsNetTestCasesLatestSdk:ConnectivityManagerTest
Original-Change: https://android-review.googlesource.com/1676425
Merged-In: I0b286f32389501402e552010546c62f3e56833d6
Change-Id: I0b286f32389501402e552010546c62f3e56833d6
This commit is contained in:
committed by
Remi NGUYEN VAN
parent
611bc021e6
commit
03a1a97bf9
@@ -2156,6 +2156,24 @@ public class ConnectivityManagerTest {
|
|||||||
null /* listener */));
|
null /* listener */));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSystemReady() {
|
||||||
|
assumeTrue(TestUtils.shouldTestSApis());
|
||||||
|
assertThrows(SecurityException.class, () -> mCm.systemReady());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGetIpSecNetIdRange() {
|
||||||
|
assumeTrue(TestUtils.shouldTestSApis());
|
||||||
|
// The lower refers to ConnectivityManager.TUN_INTF_NETID_START.
|
||||||
|
final long lower = 64512;
|
||||||
|
// The upper refers to ConnectivityManager.TUN_INTF_NETID_START
|
||||||
|
// + ConnectivityManager.TUN_INTF_NETID_RANGE - 1
|
||||||
|
final long upper = 65535;
|
||||||
|
assertEquals(lower, (long) ConnectivityManager.getIpSecNetIdRange().getLower());
|
||||||
|
assertEquals(upper, (long) ConnectivityManager.getIpSecNetIdRange().getUpper());
|
||||||
|
}
|
||||||
|
|
||||||
private void verifySettings(int expectedAirplaneMode, int expectedPrivateDnsMode,
|
private void verifySettings(int expectedAirplaneMode, int expectedPrivateDnsMode,
|
||||||
int expectedAvoidBadWifi) throws Exception {
|
int expectedAvoidBadWifi) throws Exception {
|
||||||
assertEquals(expectedAirplaneMode, Settings.Global.getInt(
|
assertEquals(expectedAirplaneMode, Settings.Global.getInt(
|
||||||
|
|||||||
Reference in New Issue
Block a user