diff options
author | Purushottam Kushwaha <quic_pkushwah@quicinc.com> | 2020-05-14 18:13:51 +0530 |
---|---|---|
committer | Sunil Ravi <sunilravi@google.com> | 2020-05-20 19:36:44 +0000 |
commit | 0715666c96aef01fd8d76445189446bf3b5179c3 (patch) | |
tree | 7376e0178fc077f72ddcabdd861680813b8fb340 /tests | |
parent | fc548645bcae1106c15d51b840b7a630ac8572dd (diff) |
SoftAp: Add support to configure acsShouldExcludeDfs.
This change is to make acsShouldExcludeDfs parameter configurable
using "config_wifi_softap_acs_include_dfs".
Bug: 156571063
Test: atest com.android.server.wifi.HostapdHalTest
Test: Manual - Connect STA in DFS channel and turn on SoftAp
and verify that SoftAp does't come up in DFS channel.
Change-Id: I33b527f95699e706901fe5e2d57e7dac92948ab0
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/HostapdHalTest.java | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/HostapdHalTest.java b/tests/wifitests/src/com/android/server/wifi/HostapdHalTest.java index 52a28eafe..8f8c7a52e 100644 --- a/tests/wifitests/src/com/android/server/wifi/HostapdHalTest.java +++ b/tests/wifitests/src/com/android/server/wifi/HostapdHalTest.java @@ -137,6 +137,7 @@ public class HostapdHalTest extends WifiBaseTest { mResources.setBoolean(R.bool.config_wifi_softap_ieee80211ac_supported, false); mResources.setBoolean(R.bool.config_wifiSoftapIeee80211axSupported, false); mResources.setBoolean(R.bool.config_wifiSoftap6ghzSupported, false); + mResources.setBoolean(R.bool.config_wifiSoftapAcsIncludeDfs, false); mResources.setString(R.string.config_wifiSoftap2gChannelList, ""); mResources.setString(R.string.config_wifiSoftap5gChannelList, ""); mResources.setString(R.string.config_wifiSoftap6gChannelList, ""); @@ -1040,5 +1041,43 @@ public class HostapdHalTest extends WifiBaseTest { configurationBuilder.build(), () -> mSoftApListener.onFailure())); } + + /** + * Verifies the successful addition of access point when ACS is allowed to include DFS channels. + */ + @Test + public void testAddAccessPointSuccess_WithACS_IncludeDFSChannels() throws Exception { + // Enable ACS in the config. + mResources.setBoolean(R.bool.config_wifi_softap_acs_supported, true); + mResources.setBoolean(R.bool.config_wifiSoftapAcsIncludeDfs, true); + mHostapdHal = new HostapdHalSpy(); + + executeAndValidateInitializationSequence(); + + Builder configurationBuilder = new SoftApConfiguration.Builder(); + configurationBuilder.setSsid(NETWORK_SSID); + configurationBuilder.setHiddenSsid(false); + configurationBuilder.setPassphrase(NETWORK_PSK, + SoftApConfiguration.SECURITY_TYPE_WPA2_PSK); + configurationBuilder.setBand(SoftApConfiguration.BAND_ANY); + + assertTrue(mHostapdHal.addAccessPoint(IFACE_NAME, + configurationBuilder.build(), + () -> mSoftApListener.onFailure())); + verify(mIHostapdMock).addAccessPoint(any(), any()); + + assertEquals(IFACE_NAME, mIfaceParamsCaptor.getValue().ifaceName); + assertTrue(mIfaceParamsCaptor.getValue().hwModeParams.enable80211N); + assertFalse(mIfaceParamsCaptor.getValue().hwModeParams.enable80211AC); + assertEquals(IHostapd.Band.BAND_ANY, mIfaceParamsCaptor.getValue().channelParams.band); + assertTrue(mIfaceParamsCaptor.getValue().channelParams.enableAcs); + assertFalse(mIfaceParamsCaptor.getValue().channelParams.acsShouldExcludeDfs); + + assertEquals(NativeUtil.stringToByteArrayList(NETWORK_SSID), + mNetworkParamsCaptor.getValue().ssid); + assertFalse(mNetworkParamsCaptor.getValue().isHidden); + assertEquals(IHostapd.EncryptionType.WPA2, mNetworkParamsCaptor.getValue().encryptionType); + assertEquals(NETWORK_PSK, mNetworkParamsCaptor.getValue().pskPassphrase); + } } |