List<WifiConfiguration> wifiConfigs = loadConfigurations();
printWifiConfigurations(wifiConfigs);
assertFalse("No configurations to test against", wifiConfigs.isEmpty());
boolean shouldPause = false;
for (WifiConfiguration config : wifiConfigs) {
if (shouldPause) {
logv("Pausing for %d seconds", PAUSE_DURATION_MS / 1000);
SystemClock.sleep(PAUSE_DURATION_MS);
}
logv("Start wifi connection test to: %s", config.SSID);
connectToWifi(config);
// verify that connection actually works
assertTrue("No connectivity at end of test", checkNetworkConnectivity());
// Disconnect and remove the network
assertTrue("Unable to remove network", disconnectAP());
logv("End wifi connection test to: %s", config.SSID);
shouldPause = true;
}