From eb0e095e16cc1d40c0f9cc60287876bac6b1be98 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Wed, 7 Jun 2017 15:56:56 -0700 Subject: [PATCH] WifiManagerTest: Set key mgmt field in testWifiManagerNetWork By default |allowedKeyMgmt| is set to WPA_PSK, however the |preSharedKey| is not set for this WifiConfiguration. So, the new |validate| method added in ag/2339612, will reject the network update (rightly so, because it's an invalid configuration). So, set the key mgmt to |NONE| to indicate that this is an open network and hence does not need the |preSharedKey| field. Bug: 62418044 Test: Failing test passes now. Change-Id: If979b909f2fb7d7b4e2626b57eff407ba6a019ab --- tests/cts/net/src/android/net/wifi/cts/WifiManagerTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/cts/net/src/android/net/wifi/cts/WifiManagerTest.java b/tests/cts/net/src/android/net/wifi/cts/WifiManagerTest.java index cbf3e93e1d..b1e9e30b89 100644 --- a/tests/cts/net/src/android/net/wifi/cts/WifiManagerTest.java +++ b/tests/cts/net/src/android/net/wifi/cts/WifiManagerTest.java @@ -385,6 +385,7 @@ public class WifiManagerTest extends AndroidTestCase { wifiConfiguration = new WifiConfiguration(); wifiConfiguration.SSID = SSID1; + wifiConfiguration.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE); int netId = mWifiManager.addNetwork(wifiConfiguration); assertTrue(existSSID(SSID1));