summaryrefslogtreecommitdiffstats
path: root/tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java
diff options
context:
space:
mode:
authorGlen Kuhne <kuh@google.com>2017-02-03 13:36:11 -0800
committerRoshan Pius <rpius@google.com>2017-02-09 14:26:39 -0800
commit66e9f4ab597136cbf4accadb8e009fc68ff071a7 (patch)
tree6d08fad8debbc7dcaca5d2b7d551f68225219334 /tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java
parent7c2c34319905b2122f124134a9f6f2064f1a2ea5 (diff)
downloadandroid_frameworks_opt_net_wifi-66e9f4ab597136cbf4accadb8e009fc68ff071a7.tar.gz
android_frameworks_opt_net_wifi-66e9f4ab597136cbf4accadb8e009fc68ff071a7.tar.bz2
android_frameworks_opt_net_wifi-66e9f4ab597136cbf4accadb8e009fc68ff071a7.zip
ISupplicantStaNetwork save & load WifiConfigs
Methods to set/get network variables from wpa_supplicant to WifiConfiguration & vice versa. TODO: Enterprise config params will be added in a further CL. Test: Unit tests Bug: 33383725 Change-Id: Ib002266a93b4738d0634cd1bbc925b61a86c1df7
Diffstat (limited to 'tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java b/tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java
index ca2569b5c..96fd180df 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java
@@ -468,6 +468,29 @@ public class WifiConfigurationTestUtil {
}
/**
+ * Asserts that the 2 WifiConfigurations are equal. This compares all the elements that are
+ * saved into wpa_supplicant by SupplicantStaNetwork.
+ */
+ public static void assertConfigurationEqualForSupplicant(
+ WifiConfiguration expected, WifiConfiguration actual) {
+ assertNotNull(expected);
+ assertNotNull(actual);
+ assertEquals(expected.SSID, actual.SSID);
+ assertEquals(expected.getNetworkSelectionStatus().getNetworkSelectionBSSID(),
+ actual.getNetworkSelectionStatus().getNetworkSelectionBSSID());
+ assertEquals(expected.preSharedKey, actual.preSharedKey);
+ 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);
+ }
+
+ /**
* Asserts that the 2 WifiConfigurations are equal. This is a generic version of the comparator
* which is used in QNS tests for comparing the network selections.
* This importantly checks that the networkId's of the 2 configs are equal.