Merge "cts: skip wifi related tests if wifi is unsupported" into oc-dev am: 73a81b18cd

am: 5383b735d5

Change-Id: I8722208a779603fe761d0e9ffb71b442ef525682
This commit is contained in:
Huihong Luo
2017-06-21 00:49:40 +00:00
committed by android-build-merger
2 changed files with 28 additions and 0 deletions

View File

@@ -789,24 +789,40 @@ public class ConnectivityManagerTest extends AndroidTestCase {
/** Verify that accept_ra_rt_info_min_plen exists and is set to the expected value */
public void testAcceptRaRtInfoMinPlen() throws Exception {
if (!mPackageManager.hasSystemFeature(PackageManager.FEATURE_WIFI)) {
Log.i(TAG, "testConnectivityChanged_manifestRequestOnlyPreN_shouldReceiveIntent cannot execute unless device supports WiFi");
return;
}
Scanner s = makeWifiSysctlScanner("accept_ra_rt_info_min_plen");
assertEquals(IPV6_WIFI_ACCEPT_RA_RT_INFO_MIN_PLEN, s.nextInt());
}
/** Verify that accept_ra_rt_info_max_plen exists and is set to the expected value */
public void testAcceptRaRtInfoMaxPlen() throws Exception {
if (!mPackageManager.hasSystemFeature(PackageManager.FEATURE_WIFI)) {
Log.i(TAG, "testConnectivityChanged_manifestRequestOnlyPreN_shouldReceiveIntent cannot execute unless device supports WiFi");
return;
}
Scanner s = makeWifiSysctlScanner("accept_ra_rt_info_max_plen");
assertEquals(IPV6_WIFI_ACCEPT_RA_RT_INFO_MAX_PLEN, s.nextInt());
}
/** Verify that router_solicitations exists and is set to the expected value */
public void testRouterSolicitations() throws Exception {
if (!mPackageManager.hasSystemFeature(PackageManager.FEATURE_WIFI)) {
Log.i(TAG, "testConnectivityChanged_manifestRequestOnlyPreN_shouldReceiveIntent cannot execute unless device supports WiFi");
return;
}
Scanner s = makeWifiSysctlScanner("router_solicitations");
assertEquals(IPV6_WIFI_ROUTER_SOLICITATIONS, s.nextInt());
}
/** Verify that router_solicitation_max_interval exists and is in an acceptable interval */
public void testRouterSolicitationMaxInterval() throws Exception {
if (!mPackageManager.hasSystemFeature(PackageManager.FEATURE_WIFI)) {
Log.i(TAG, "testConnectivityChanged_manifestRequestOnlyPreN_shouldReceiveIntent cannot execute unless device supports WiFi");
return;
}
Scanner s = makeWifiSysctlScanner("router_solicitation_max_interval");
int interval = s.nextInt();
// Verify we're in the interval [15 minutes, 60 minutes]. Lower values may adversely

View File

@@ -583,6 +583,10 @@ public class WifiManagerTest extends AndroidTestCase {
* @throws Exception
*/
public void testAddPasspointConfigWithUserCredential() throws Exception {
if (!WifiFeature.isWifiSupported(getContext())) {
// skip the test if WiFi is not supported
return;
}
testAddPasspointConfig(generatePasspointConfig(generateUserCredential()));
}
@@ -593,6 +597,10 @@ public class WifiManagerTest extends AndroidTestCase {
* @throws Exception
*/
public void testAddPasspointConfigWithCertCredential() throws Exception {
if (!WifiFeature.isWifiSupported(getContext())) {
// skip the test if WiFi is not supported
return;
}
testAddPasspointConfig(generatePasspointConfig(generateCertCredential()));
}
@@ -603,6 +611,10 @@ public class WifiManagerTest extends AndroidTestCase {
* @throws Exception
*/
public void testAddPasspointConfigWithSimCredential() throws Exception {
if (!WifiFeature.isWifiSupported(getContext())) {
// skip the test if WiFi is not supported
return;
}
testAddPasspointConfig(generatePasspointConfig(generateSimCredential()));
}