Update wifi test to permit VirtWifi SSID
If we import newer common kernels into cuttlefish-4.4 (where we get the
stable cuttlefish kernel from) the e2e test can fail because it
*requires* the SSID to be "AndroidWifi", but the wifi driver we
upstreamed uses "VirtWifi" instead, to be less Android-y.
Update the e2e test to search for either network and succeed if
connection to either occurs.
Bug: 120682817
Bug: 122616497
Change-Id: I8823daa9b11f7635961864b1280234ed1df452a9
Signed-off-by: Alistair Strachan <astrachan@google.com>
(cherry picked from commit 56210a42aba453c6fcd25501f646e06132395b5b)
diff --git a/tests/wifi/src/com/android/cuttlefish/wifi/tests/WifiE2eTests.java b/tests/wifi/src/com/android/cuttlefish/wifi/tests/WifiE2eTests.java
index 9669abb..e3d9e70 100644
--- a/tests/wifi/src/com/android/cuttlefish/wifi/tests/WifiE2eTests.java
+++ b/tests/wifi/src/com/android/cuttlefish/wifi/tests/WifiE2eTests.java
@@ -100,6 +100,16 @@
}
+ private void enableNetwork(String SSID) {
+ WifiConfiguration conf = new WifiConfiguration();
+ conf.SSID = SSID;
+ conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
+ int networkId = mWifiManager.addNetwork(conf);
+ Assert.assertTrue(networkId >= 0);
+ mWifiManager.enableNetwork(networkId, false);
+ }
+
+
/**
* Initialize wifi, erase all settings.
*/
@@ -143,12 +153,8 @@
// - Enable network,
// - Scan for network
Log.i(TAG, "Configuring WIFI...");
- WifiConfiguration conf = new WifiConfiguration();
- conf.SSID = "\"AndroidWifi\"";
- conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
- int networkId = mWifiManager.addNetwork(conf);
- Assert.assertTrue(networkId >= 0);
- mWifiManager.enableNetwork(networkId, false);
+ enableNetwork("\"VirtWifi\"");
+ enableNetwork("\"AndroidWifi\"");
mWifiManager.startScan();
// 4. Wait until connected.