diff options
author | Roshan Pius <rpius@google.com> | 2016-09-07 15:47:39 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-09-07 15:47:40 +0000 |
commit | 539cb96aba723b1f63649ae6cc7344ca2359d15e (patch) | |
tree | 5461f8c6fd22adbce17d7aa260a19791ca5484c4 /tests | |
parent | 9345083e1e9f40bf31cb2264d145c3174cbc78c6 (diff) | |
parent | 241605aebc6a8f55624026e8b72246bceb1c2ac2 (diff) |
Merge changes from topic 'wifi_enterprise_config'
* changes:
XmlUtil: Add couple of missing elements in WifiConfiguration
Changes in tests for the WifiEnterpriseConfig refactor
Diffstat (limited to 'tests')
4 files changed, 36 insertions, 25 deletions
diff --git a/tests/wifitests/src/android/net/wifi/WifiEnterpriseConfigTest.java b/tests/wifitests/src/android/net/wifi/WifiEnterpriseConfigTest.java index 814594df6..0d964b7c9 100644 --- a/tests/wifitests/src/android/net/wifi/WifiEnterpriseConfigTest.java +++ b/tests/wifitests/src/android/net/wifi/WifiEnterpriseConfigTest.java @@ -125,7 +125,7 @@ public class WifiEnterpriseConfigTest { } private String getCaCertField() { - return mEnterpriseConfig.getFieldValue(WifiEnterpriseConfig.CA_CERT_KEY, ""); + return mEnterpriseConfig.getFieldValue(WifiEnterpriseConfig.CA_CERT_KEY); } private void setCaCertField(String value) { diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConfigStoreDataTest.java b/tests/wifitests/src/com/android/server/wifi/WifiConfigStoreDataTest.java index f16c0748a..3fa5d3dab 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiConfigStoreDataTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiConfigStoreDataTest.java @@ -62,9 +62,12 @@ public class WifiConfigStoreDataTest { + "<null name=\"WEPKeys\" />\n" + "<int name=\"WEPTxKeyIndex\" value=\"0\" />\n" + "<boolean name=\"HiddenSSID\" value=\"false\" />\n" + + "<boolean name=\"RequirePMF\" value=\"false\" />\n" + "<byte-array name=\"AllowedKeyMgmt\" num=\"1\">01</byte-array>\n" + "<byte-array name=\"AllowedProtocols\" num=\"0\"></byte-array>\n" + "<byte-array name=\"AllowedAuthAlgos\" num=\"0\"></byte-array>\n" + + "<byte-array name=\"AllowedGroupCiphers\" num=\"0\"></byte-array>\n" + + "<byte-array name=\"AllowedPairwiseCiphers\" num=\"0\"></byte-array>\n" + "<boolean name=\"Shared\" value=\"%s\" />\n" + "<null name=\"FQDN\" />\n" + "<null name=\"ProviderFriendlyName\" />\n" diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java b/tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java index 5b4c90dc4..55ca4cea4 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java @@ -369,9 +369,12 @@ public class WifiConfigurationTestUtil { assertEquals(expected.wepKeys, actual.wepKeys); assertEquals(expected.wepTxKeyIndex, actual.wepTxKeyIndex); assertEquals(expected.hiddenSSID, actual.hiddenSSID); + assertEquals(expected.requirePMF, actual.requirePMF); assertEquals(expected.allowedKeyManagement, actual.allowedKeyManagement); assertEquals(expected.allowedProtocols, actual.allowedProtocols); assertEquals(expected.allowedAuthAlgorithms, actual.allowedAuthAlgorithms); + assertEquals(expected.allowedGroupCiphers, actual.allowedGroupCiphers); + assertEquals(expected.allowedPairwiseCiphers, actual.allowedPairwiseCiphers); assertEquals(expected.shared, actual.shared); assertEquals(expected.getIpConfiguration(), actual.getIpConfiguration()); } @@ -482,30 +485,30 @@ public class WifiConfigurationTestUtil { */ public static void assertWifiEnterpriseConfigEqualForConfigStore( WifiEnterpriseConfig expected, WifiEnterpriseConfig actual) { - assertEquals(expected.getFieldValue(WifiEnterpriseConfig.IDENTITY_KEY, ""), - actual.getFieldValue(WifiEnterpriseConfig.IDENTITY_KEY, "")); - assertEquals(expected.getFieldValue(WifiEnterpriseConfig.ANON_IDENTITY_KEY, ""), - actual.getFieldValue(WifiEnterpriseConfig.ANON_IDENTITY_KEY, "")); - assertEquals(expected.getFieldValue(WifiEnterpriseConfig.PASSWORD_KEY, ""), - actual.getFieldValue(WifiEnterpriseConfig.PASSWORD_KEY, "")); - assertEquals(expected.getFieldValue(WifiEnterpriseConfig.CLIENT_CERT_KEY, ""), - actual.getFieldValue(WifiEnterpriseConfig.CLIENT_CERT_KEY, "")); - assertEquals(expected.getFieldValue(WifiEnterpriseConfig.CA_CERT_KEY, ""), - actual.getFieldValue(WifiEnterpriseConfig.CA_CERT_KEY, "")); - assertEquals(expected.getFieldValue(WifiEnterpriseConfig.SUBJECT_MATCH_KEY, ""), - actual.getFieldValue(WifiEnterpriseConfig.SUBJECT_MATCH_KEY, "")); - assertEquals(expected.getFieldValue(WifiEnterpriseConfig.ENGINE_KEY, ""), - actual.getFieldValue(WifiEnterpriseConfig.ENGINE_KEY, "")); - assertEquals(expected.getFieldValue(WifiEnterpriseConfig.ENGINE_ID_KEY, ""), - actual.getFieldValue(WifiEnterpriseConfig.ENGINE_ID_KEY, "")); - assertEquals(expected.getFieldValue(WifiEnterpriseConfig.PRIVATE_KEY_ID_KEY, ""), - actual.getFieldValue(WifiEnterpriseConfig.PRIVATE_KEY_ID_KEY, "")); - assertEquals(expected.getFieldValue(WifiEnterpriseConfig.ALTSUBJECT_MATCH_KEY, ""), - actual.getFieldValue(WifiEnterpriseConfig.ALTSUBJECT_MATCH_KEY, "")); - assertEquals(expected.getFieldValue(WifiEnterpriseConfig.DOM_SUFFIX_MATCH_KEY, ""), - actual.getFieldValue(WifiEnterpriseConfig.DOM_SUFFIX_MATCH_KEY, "")); - assertEquals(expected.getFieldValue(WifiEnterpriseConfig.CA_PATH_KEY, ""), - actual.getFieldValue(WifiEnterpriseConfig.CA_PATH_KEY, "")); + assertEquals(expected.getFieldValue(WifiEnterpriseConfig.IDENTITY_KEY), + actual.getFieldValue(WifiEnterpriseConfig.IDENTITY_KEY)); + assertEquals(expected.getFieldValue(WifiEnterpriseConfig.ANON_IDENTITY_KEY), + actual.getFieldValue(WifiEnterpriseConfig.ANON_IDENTITY_KEY)); + assertEquals(expected.getFieldValue(WifiEnterpriseConfig.PASSWORD_KEY), + actual.getFieldValue(WifiEnterpriseConfig.PASSWORD_KEY)); + assertEquals(expected.getFieldValue(WifiEnterpriseConfig.CLIENT_CERT_KEY), + actual.getFieldValue(WifiEnterpriseConfig.CLIENT_CERT_KEY)); + assertEquals(expected.getFieldValue(WifiEnterpriseConfig.CA_CERT_KEY), + actual.getFieldValue(WifiEnterpriseConfig.CA_CERT_KEY)); + assertEquals(expected.getFieldValue(WifiEnterpriseConfig.SUBJECT_MATCH_KEY), + actual.getFieldValue(WifiEnterpriseConfig.SUBJECT_MATCH_KEY)); + assertEquals(expected.getFieldValue(WifiEnterpriseConfig.ENGINE_KEY), + actual.getFieldValue(WifiEnterpriseConfig.ENGINE_KEY)); + assertEquals(expected.getFieldValue(WifiEnterpriseConfig.ENGINE_ID_KEY), + actual.getFieldValue(WifiEnterpriseConfig.ENGINE_ID_KEY)); + assertEquals(expected.getFieldValue(WifiEnterpriseConfig.PRIVATE_KEY_ID_KEY), + actual.getFieldValue(WifiEnterpriseConfig.PRIVATE_KEY_ID_KEY)); + assertEquals(expected.getFieldValue(WifiEnterpriseConfig.ALTSUBJECT_MATCH_KEY), + actual.getFieldValue(WifiEnterpriseConfig.ALTSUBJECT_MATCH_KEY)); + assertEquals(expected.getFieldValue(WifiEnterpriseConfig.DOM_SUFFIX_MATCH_KEY), + actual.getFieldValue(WifiEnterpriseConfig.DOM_SUFFIX_MATCH_KEY)); + assertEquals(expected.getFieldValue(WifiEnterpriseConfig.CA_PATH_KEY), + actual.getFieldValue(WifiEnterpriseConfig.CA_PATH_KEY)); assertEquals(expected.getEapMethod(), actual.getEapMethod()); assertEquals(expected.getPhase2Method(), actual.getPhase2Method()); } diff --git a/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java b/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java index 89fa4a48b..777974772 100644 --- a/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java +++ b/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java @@ -187,9 +187,14 @@ public class XmlUtilTest { public void testEapWifiConfigurationSerializeDeserializeForConfigStore() throws IOException, XmlPullParserException { WifiConfiguration configuration = WifiConfigurationTestUtil.createEapNetwork(); + configuration.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP104); + configuration.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP40); + configuration.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP); + configuration.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP); configuration.linkedConfigurations = new HashMap<>(); configuration.linkedConfigurations.put(TEST_DUMMY_CONFIG_KEY, Integer.valueOf(1)); configuration.defaultGwMacAddress = TEST_STATIC_IP_GATEWAY_ADDRESS; + configuration.requirePMF = true; configuration.validatedInternetAccess = true; configuration.noInternetAccessExpected = true; configuration.userApproved = WifiConfiguration.USER_UNSPECIFIED; |