summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2017-05-24 17:25:57 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-05-24 17:25:57 +0000
commit2bfc3924e0c811ac7771d76d6a5c3164205add33 (patch)
tree6b77d5b20edb295b8f9cda9097c50ef6d98ef68e /tests
parent9dc9a8750ecd1ab25c5b4c7d17c8930ca2ffb6c3 (diff)
parentc66d00cefbd32ec2fbefcf1fd54c1aaf50b5ce5a (diff)
Merge "Support coexistence of wpa and wpa2 IEs in scan result" into oc-dev
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/util/InformationElementUtilTest.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/util/InformationElementUtilTest.java b/tests/wifitests/src/com/android/server/wifi/util/InformationElementUtilTest.java
index ae654468b..d94b54252 100644
--- a/tests/wifitests/src/com/android/server/wifi/util/InformationElementUtilTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/util/InformationElementUtilTest.java
@@ -299,6 +299,44 @@ public class InformationElementUtilTest {
}
/**
+ * Test Capabilities.generateCapabilitiesString() with both RSN and WPA1 IE.
+ * Expect the function to return a string with the proper security information.
+ */
+ @Test
+ public void buildCapabilities_rsnAndWpaElement() {
+ InformationElement ieRsn = new InformationElement();
+ ieRsn.id = InformationElement.EID_RSN;
+ ieRsn.bytes = new byte[] { (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x0F,
+ (byte) 0xAC, (byte) 0x02, (byte) 0x02, (byte) 0x00,
+ (byte) 0x00, (byte) 0x0F, (byte) 0xAC, (byte) 0x04,
+ (byte) 0x00, (byte) 0x0F, (byte) 0xAC, (byte) 0x02,
+ (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x0F,
+ (byte) 0xAC, (byte) 0x02, (byte) 0x00, (byte) 0x00 };
+
+ InformationElement ieWpa = new InformationElement();
+ ieWpa.id = InformationElement.EID_VSA;
+ ieWpa.bytes = new byte[] { (byte) 0x00, (byte) 0x50, (byte) 0xF2, (byte) 0x01,
+ (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x50,
+ (byte) 0xF2, (byte) 0x02, (byte) 0x02, (byte) 0x00,
+ (byte) 0x00, (byte) 0x50, (byte) 0xF2, (byte) 0x04,
+ (byte) 0x00, (byte) 0x50, (byte) 0xF2, (byte) 0x02,
+ (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x50,
+ (byte) 0xF2, (byte) 0x02, (byte) 0x00, (byte) 0x00 };
+
+ InformationElement[] ies = new InformationElement[] { ieWpa, ieRsn };
+
+ BitSet beaconCap = new BitSet(16);
+ beaconCap.set(4);
+
+ InformationElementUtil.Capabilities capabilities =
+ new InformationElementUtil.Capabilities();
+ capabilities.from(ies, beaconCap);
+ String result = capabilities.generateCapabilitiesString();
+
+ assertEquals("[WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP]", result);
+ }
+
+ /**
* Test Capabilities.generateCapabilitiesString() with a vendor specific element which
* is not WPA type 1. Beacon Capability Information field has the Privacy
* bit set.