diff options
author | Randy Pan <zpan@google.com> | 2016-11-10 18:23:15 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-11-10 18:23:15 +0000 |
commit | 7767bd5078d33afd4cfed9ab4c161ed89ab92c5f (patch) | |
tree | 678cea65b6070f6a9a415290d9c9e7a2e71119cd /tests | |
parent | deae681b9e79cbbd5eb7dfcc5ad3bcef51c8f901 (diff) | |
parent | 836fdd6fdf021f058eb9f9d5dfd40e39f75d4ca0 (diff) |
Merge "WNS: feed filtered scan results to network evaluators"
am: 836fdd6fdf
Change-Id: I798d8072503c293b3c4431f318e083a474567026
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiNetworkSelectorTest.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiNetworkSelectorTest.java b/tests/wifitests/src/com/android/server/wifi/WifiNetworkSelectorTest.java index 5a1645915..3127a0132 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiNetworkSelectorTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiNetworkSelectorTest.java @@ -487,4 +487,37 @@ public class WifiNetworkSelectorTest { WifiNetworkSelectorTestUtil.verifySelectedScanResult(mWifiConfigManager, chosenScanResult, candidate); } + + /** + * No network selection if the currently connected on is already sufficient. + * + * WifiStateMachine is disconnected. + * scanDetails contains a network which is blacklisted. + * + * Expected behavior: no network recommended by Network Selector + */ + @Test + public void filterOutBlacklistedBssid() { + String[] ssids = {"\"test1\""}; + String[] bssids = {"6c:f3:7f:ae:8c:f3"}; + int[] freqs = {5180}; + String[] caps = {"[WPA2-EAP-CCMP][ESS]"}; + int[] levels = {mThresholdQualifiedRssi5G + 8}; + int[] securities = {SECURITY_PSK}; + + ScanDetailsAndWifiConfigs scanDetailsAndConfigs = + WifiNetworkSelectorTestUtil.setupScanDetailsAndConfigStore(ssids, bssids, + freqs, caps, levels, securities, mWifiConfigManager, mClock); + List<ScanDetail> scanDetails = scanDetailsAndConfigs.getScanDetails(); + + // Disable this network for BSSID_BLACKLIST_THRESHOLD times so it gets + // blacklisted by WNS. + for (int i = 0; i < WifiNetworkSelector.BSSID_BLACKLIST_THRESHOLD; i++) { + mWifiNetworkSelector.enableBssidForNetworkSelection(bssids[0], false); + } + + WifiConfiguration candidate = mWifiNetworkSelector.selectNetwork(scanDetails, + mWifiInfo, false, true, false); + assertEquals("Expect null configuration", null, candidate); + } } |