summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRebecca Silberstein <silberst@google.com>2017-01-05 13:27:51 -0800
committerRebecca Silberstein <silberst@google.com>2017-01-05 14:02:31 -0800
commitc4d0de0346332a43155580c28097c3bdc9976875 (patch)
tree4141719775f64b6bb1a5eafa91c80c141b89054d /tests
parent02938a0a735da7fafaaed84e31e1aa93cdf80a56 (diff)
WifiApConfigStore: randomize default soft ap SSID
Add a suffix to the default SSID for SoftAp configurations. This results in the default SSID name (currently AndroidAP) followed by and underscore and four randomized ints. The WifiApConfigStoreTest methods were also updated to reflect this change. Bug: 31076622 Test: manually tested with a newly flashed device Test: frameworks/base/wifi/tests/runtests.sh Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: If3032ff97d76cbd0bf24950aeb01a9d30568496f
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiApConfigStoreTest.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiApConfigStoreTest.java b/tests/wifitests/src/com/android/server/wifi/WifiApConfigStoreTest.java
index a942a0828..42161fa54 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiApConfigStoreTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiApConfigStoreTest.java
@@ -49,6 +49,8 @@ public class WifiApConfigStoreTest {
private static final String TEST_DEFAULT_2G_CHANNEL_LIST = "1,2,3,4,5,6";
private static final String TEST_DEFAULT_AP_SSID = "TestAP";
private static final String TEST_CONFIGURED_AP_SSID = "ConfiguredAP";
+ private static final int RAND_SSID_INT_MIN = 1000;
+ private static final int RAND_SSID_INT_MAX = 9999;
@Mock Context mContext;
@Mock BackupManagerProxy mBackupManagerProxy;
@@ -106,7 +108,11 @@ public class WifiApConfigStoreTest {
}
private void verifyDefaultApConfig(WifiConfiguration config) {
- assertEquals(TEST_DEFAULT_AP_SSID, config.SSID);
+ String[] splitSsid = config.SSID.split("_");
+ assertEquals(2, splitSsid.length);
+ assertEquals(TEST_DEFAULT_AP_SSID, splitSsid[0]);
+ int randomPortion = Integer.parseInt(splitSsid[1]);
+ assertTrue(randomPortion >= RAND_SSID_INT_MIN && randomPortion <= RAND_SSID_INT_MAX);
assertTrue(config.allowedKeyManagement.get(KeyMgmt.WPA2_PSK));
}