summaryrefslogtreecommitdiff
path: root/wifi/tests
diff options
context:
space:
mode:
authorJimmy Chen <jimmycmchen@google.com>2020-12-14 08:55:03 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-12-14 08:55:03 +0000
commitea1b4b22999bf657faa56007fc8face833bed859 (patch)
treede38e97d6b2a84e7b82c5837492d659558413cc4 /wifi/tests
parent1e2d5e889f5ff8f73a8972004779a0f44fa3fbae (diff)
parent3f8b46ebf8e92722098b700c27656d39dbba7069 (diff)
Merge "wifi: create security type for Passpoint R1/R2 and R3"
Diffstat (limited to 'wifi/tests')
-rw-r--r--wifi/tests/src/android/net/wifi/SecurityParamsTest.java47
1 files changed, 39 insertions, 8 deletions
diff --git a/wifi/tests/src/android/net/wifi/SecurityParamsTest.java b/wifi/tests/src/android/net/wifi/SecurityParamsTest.java
index e581b77c14ad..2f6b7245795f 100644
--- a/wifi/tests/src/android/net/wifi/SecurityParamsTest.java
+++ b/wifi/tests/src/android/net/wifi/SecurityParamsTest.java
@@ -85,11 +85,28 @@ public class SecurityParamsTest {
expectedAllowedGroupCiphers, expectedRequirePmf);
}
- /** Verify EAP Passpoint params creator. */
+ /** Verify Passpoint R1 params creator. */
@Test
- public void testEapPasspointCreator() throws Exception {
- SecurityParams p = SecurityParams.createPasspointParams(false);
- int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_EAP;
+ public void testEapPasspointR1Creator() throws Exception {
+ SecurityParams p = SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R1);
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_PASSPOINT_R1_R2;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.WPA_EAP, KeyMgmt.IEEE8021X};
+ int[] expectedAllowedProtocols = new int[] {};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {};
+ int[] expectedAllowedGroupCiphers = new int[] {};
+ boolean expectedRequirePmf = false;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
+
+ /** Verify Passpoint R2 params creator. */
+ @Test
+ public void testEapPasspointR2Creator() throws Exception {
+ SecurityParams p = SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R2);
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_PASSPOINT_R1_R2;
int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.WPA_EAP, KeyMgmt.IEEE8021X};
int[] expectedAllowedProtocols = new int[] {};
int[] expectedAllowedAuthAlgorithms = new int[] {};
@@ -100,9 +117,19 @@ public class SecurityParamsTest {
expectedAllowedKeyManagement, expectedAllowedProtocols,
expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
- p = SecurityParams.createPasspointParams(true);
- expectedRequirePmf = true;
+ /** Verify Passpoint R3 params creator. */
+ @Test
+ public void testEapPasspointR3Creator() throws Exception {
+ SecurityParams p = SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R3);
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_PASSPOINT_R3;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.WPA_EAP, KeyMgmt.IEEE8021X};
+ int[] expectedAllowedProtocols = new int[] {};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {};
+ int[] expectedAllowedGroupCiphers = new int[] {};
+ boolean expectedRequirePmf = true;
verifySecurityParams(p, expectedSecurityType,
expectedAllowedKeyManagement, expectedAllowedProtocols,
expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
@@ -408,7 +435,9 @@ public class SecurityParamsTest {
SecurityParams[] nonOpenSecurityParams = new SecurityParams[] {
SecurityParams.createWpaWpa2EnterpriseParams(),
- SecurityParams.createPasspointParams(false),
+ SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R1),
+ SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R2),
+ SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R3),
SecurityParams.createOsenParams(),
SecurityParams.createWapiCertParams(),
SecurityParams.createWapiPskParams(),
@@ -428,7 +457,9 @@ public class SecurityParamsTest {
public void testIsEnterpriseNetwork() {
SecurityParams[] enterpriseSecurityParams = new SecurityParams[] {
SecurityParams.createWpaWpa2EnterpriseParams(),
- SecurityParams.createPasspointParams(false),
+ SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R1),
+ SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R2),
+ SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R3),
SecurityParams.createWapiCertParams(),
SecurityParams.createWpa3Enterprise192BitParams(),
SecurityParams.createWpa3EnterpriseParams(),