diff options
author | xshu <xshu@google.com> | 2020-03-12 16:52:37 -0700 |
---|---|---|
committer | xshu <xshu@google.com> | 2020-03-12 17:06:17 -0700 |
commit | d08f40266aa4177211aeb1f315e96d7c591feef4 (patch) | |
tree | 5f17f491e5c3d8d1ddf1e91b6c7af55747be7eca /tests | |
parent | 544e531dc8534bbf197c2abe58748c897a0f5a75 (diff) |
Support enhanced MAC randomization Passpoint
Check the whitelist for FQDN if the network is passpoint.
Bug: 151373955
Test: atest com.android.server.wifi
Change-Id: I75cacbfd7ac9d838a112b20740d81731b6d4634e
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java b/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java index 88bf786e6..20aefe958 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java @@ -2132,6 +2132,27 @@ public class WifiConfigManagerTest extends WifiBaseTest { } /** + * Verify that the aggressive randomization whitelist works for passpoints. (by checking FQDN) + */ + @Test + public void testShouldUseAggressiveRandomizationPasspoint() { + WifiConfiguration c = WifiConfigurationTestUtil.createPasspointNetwork(); + // Adds SSID to the whitelist. + Set<String> ssidList = new HashSet<>(); + ssidList.add(c.SSID); + when(mDeviceConfigFacade.getAggressiveMacRandomizationSsidAllowlist()) + .thenReturn(ssidList); + + // Verify that if for passpoint networks we don't check for the SSID to be in the whitelist + assertFalse(mWifiConfigManager.shouldUseAggressiveRandomization(c)); + + // instead we check for the FQDN + ssidList.clear(); + ssidList.add(c.FQDN); + assertTrue(mWifiConfigManager.shouldUseAggressiveRandomization(c)); + } + + /** * Verifies that getRandomizedMacAndUpdateIfNeeded updates the randomized MAC address and * |randomizedMacExpirationTimeMs| correctly. * |