1#!/usr/bin/env python3.4 2# 3# Copyright 2018 - The Android Open Source Project 4# 5# Licensed under the Apache License, Version 2.0 (the "License"); 6# you may not use this file except in compliance with the License. 7# You may obtain a copy of the License at 8# 9# http://www.apache.org/licenses/LICENSE-2.0 10# 11# Unless required by applicable law or agreed to in writing, software 12# distributed under the License is distributed on an "AS IS" BASIS, 13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14# See the License for the specific language governing permissions and 15# limitations under the License. 16 17import itertools 18import pprint 19import sys 20import time 21 22import acts.base_test 23import acts.signals as signals 24import acts_contrib.test_utils.wifi.wifi_test_utils as wutils 25import acts.utils as utils 26 27from acts import asserts 28from acts.controllers.ap_lib import hostapd_constants 29from acts.test_decorators import test_tracker_info 30from acts_contrib.test_utils.tel.tel_wifi_utils import WIFI_CONFIG_APBAND_2G 31from acts_contrib.test_utils.tel.tel_wifi_utils import WIFI_CONFIG_APBAND_5G 32from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest 33from threading import Thread 34 35WifiEnums = wutils.WifiEnums 36WIFI_CONFIG_APBAND_AUTO = WifiEnums.WIFI_CONFIG_SOFTAP_BAND_2G_5G 37GET_FREQUENCY_NUM_RETRIES = 3 38 39 40class WifiSoftApAcsTest(WifiBaseTest): 41 """Tests for Automatic Channel Selection. 42 43 Test Bed Requirement: 44 * Two Android devices and an AP. 45 * 2GHz and 5GHz Wi-Fi network visible to the device. 46 """ 47 48 def setup_class(self): 49 super().setup_class() 50 51 self.dut = self.android_devices[0] 52 self.dut_client = self.android_devices[1] 53 utils.require_sl4a((self.dut, self.dut_client)) 54 utils.sync_device_time(self.dut) 55 utils.sync_device_time(self.dut_client) 56 # Enable verbose logging on the duts 57 self.dut.droid.wifiEnableVerboseLogging(1) 58 asserts.assert_equal( 59 self.dut.droid.wifiGetVerboseLoggingLevel(), 1, 60 "Failed to enable WiFi verbose logging on the softap dut.") 61 self.dut_client.droid.wifiEnableVerboseLogging(1) 62 asserts.assert_equal( 63 self.dut_client.droid.wifiGetVerboseLoggingLevel(), 1, 64 "Failed to enable WiFi verbose logging on the client dut.") 65 req_params = [ 66 "wifi6_models", 67 ] 68 opt_param = [ 69 "iperf_server_address", "reference_networks", "iperf_server_port", 70 "pixel_models" 71 ] 72 self.unpack_userparams(req_param_names=req_params, 73 opt_param_names=opt_param) 74 self.chan_map = { 75 v: k 76 for k, v in hostapd_constants.CHANNEL_MAP.items() 77 } 78 self.pcap_procs = None 79 80 def setup_test(self): 81 super().setup_test() 82 if hasattr(self, 'packet_capture'): 83 chan = self.test_name.split('_')[-1] 84 if chan.isnumeric(): 85 band = '2G' if self.chan_map[int(chan)] < 5000 else '5G' 86 self.packet_capture[0].configure_monitor_mode(band, int(chan)) 87 self.pcap_procs = wutils.start_pcap(self.packet_capture[0], 88 band, self.test_name) 89 self.dut.droid.wakeLockAcquireBright() 90 self.dut.droid.wakeUpNow() 91 92 def teardown_test(self): 93 super().teardown_test() 94 self.dut.droid.wakeLockRelease() 95 self.dut.droid.goToSleepNow() 96 wutils.stop_wifi_tethering(self.dut) 97 wutils.reset_wifi(self.dut) 98 wutils.reset_wifi(self.dut_client) 99 if hasattr(self, 'packet_capture') and self.pcap_procs: 100 wutils.stop_pcap(self.packet_capture[0], self.pcap_procs, False) 101 self.pcap_procs = None 102 try: 103 if "AccessPoint" in self.user_params: 104 del self.user_params["reference_networks"] 105 del self.user_params["open_network"] 106 except: 107 pass 108 self.access_points[0].close() 109 110 """Helper Functions""" 111 112 def run_iperf_client(self, params): 113 """Run iperf traffic after connection. 114 115 Args: 116 params: A tuple of network info and AndroidDevice object. 117 118 """ 119 if "iperf_server_address" in self.user_params: 120 network, ad = params 121 SSID = network[WifiEnums.SSID_KEY] 122 self.log.info("Starting iperf traffic through {}".format(SSID)) 123 port_arg = "-p {} -t {}".format(self.iperf_server_port, 3) 124 success, data = ad.run_iperf_client(self.iperf_server_address, 125 port_arg) 126 self.log.debug(pprint.pformat(data)) 127 asserts.assert_true(success, "Error occurred in iPerf traffic.") 128 self.log.info("Finished iperf traffic through {}".format(SSID)) 129 130 def start_softap_and_verify(self, band): 131 """Bring-up softap and verify AP mode and in scan results. 132 133 Args: 134 band: The band to use for softAP. 135 136 """ 137 config = wutils.create_softap_config() 138 wutils.start_wifi_tethering(self.dut, 139 config[wutils.WifiEnums.SSID_KEY], 140 config[wutils.WifiEnums.PWD_KEY], 141 band=band) 142 asserts.assert_true(self.dut.droid.wifiIsApEnabled(), 143 "SoftAp is not reported as running") 144 wutils.start_wifi_connection_scan_and_ensure_network_found( 145 self.dut_client, config[wutils.WifiEnums.SSID_KEY]) 146 return config 147 148 def get_softap_acs(self, softap): 149 """Connect to the softap on client-dut and get the softap channel 150 information. 151 152 Args: 153 softap: The softap network configuration information. 154 155 """ 156 wutils.connect_to_wifi_network(self.dut_client, 157 softap, 158 check_connectivity=False) 159 for _ in range(GET_FREQUENCY_NUM_RETRIES): 160 softap_info = self.dut_client.droid.wifiGetConnectionInfo() 161 self.log.debug("DUT is connected to softAP %s with details: %s" % 162 (softap[wutils.WifiEnums.SSID_KEY], softap_info)) 163 frequency = softap_info['frequency'] 164 self.dut.log.info("DUT SoftAp operates on Channel: {}".format( 165 WifiEnums.freq_to_channel[frequency])) 166 if frequency > 0: 167 break 168 time.sleep(1) # frequency not updated yet, try again after a delay 169 wutils.verify_11ax_softap(self.dut, self.dut_client, self.wifi6_models) 170 return hostapd_constants.CHANNEL_MAP[frequency] 171 172 def configure_ap(self, channel_2g=None, channel_5g=None): 173 """Configure and bring up AP on required channel. 174 175 Args: 176 channel_2g: The channel number to use for 2GHz network. 177 channel_5g: The channel number to use for 5GHz network. 178 179 """ 180 if not channel_2g: 181 channel_2g = hostapd_constants.AP_DEFAULT_CHANNEL_2G 182 if not channel_5g: 183 channel_5g = hostapd_constants.AP_DEFAULT_CHANNEL_5G 184 if "AccessPoint" in self.user_params: 185 self.legacy_configure_ap_and_start(wpa_network=True, 186 wep_network=True, 187 channel_2g=channel_2g, 188 channel_5g=channel_5g) 189 elif "OpenWrtAP" in self.user_params: 190 self.configure_openwrt_ap_and_start(wpa_network=True, 191 wep_network=True, 192 channel_2g=channel_2g, 193 channel_5g=channel_5g) 194 195 def start_traffic_and_softap(self, network, softap_band): 196 """Start iPerf traffic on client dut, during softAP bring-up on dut. 197 198 Args: 199 network: Network information of the network to connect to. 200 softap_band: The band to use for softAP. 201 202 """ 203 if not network: 204 # For a clean environment just bring up softap and return channel. 205 softap = self.start_softap_and_verify(softap_band) 206 channel = self.get_softap_acs(softap) 207 return channel 208 # Connect to the AP and start IPerf traffic, while we bring up softap. 209 wutils.connect_to_wifi_network(self.dut_client, network) 210 freq = self.dut_client.droid.wifiGetConnectionInfo()["frequency"] 211 ap_chan = wutils.WifiEnums.freq_to_channel[freq] 212 self.dut_client.log.info("{} operates on channel: {}".format( 213 network["SSID"], ap_chan)) 214 wutils.verify_11ax_wifi_connection(self.dut_client, self.wifi6_models, 215 "wifi6_ap" in self.user_params) 216 t = Thread(target=self.run_iperf_client, 217 args=((network, self.dut_client), )) 218 t.setDaemon(True) 219 t.start() 220 time.sleep(1) 221 softap = self.start_softap_and_verify(softap_band) 222 t.join() 223 channel = self.get_softap_acs(softap) 224 return channel 225 226 def verify_acs_channel(self, chan, avoid_chan): 227 """Verify ACS algorithm by ensuring that softAP came up on a channel, 228 different than the active channels. 229 230 Args: 231 chan: The channel number softap came-up on. 232 avoid_chan: The channel to avoid during this test. 233 234 """ 235 if avoid_chan in range(1, 12): 236 avoid_chan2 = hostapd_constants.AP_DEFAULT_CHANNEL_5G 237 elif avoid_chan in range(36, 166): 238 avoid_chan2 = hostapd_constants.AP_DEFAULT_CHANNEL_2G 239 if chan == avoid_chan or chan == avoid_chan2: 240 raise signals.TestFailure("ACS chose the same channel that the " 241 "AP was beaconing on. Channel = %d" % 242 chan) 243 244 """Tests""" 245 246 @test_tracker_info(uuid="3507bd18-e787-4380-8725-1872916d4267") 247 def test_softap_2G_clean_env(self): 248 """Test to bring up SoftAp on 2GHz in clean environment.""" 249 network = None 250 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_2G) 251 if not chan in range(1, 12): 252 raise signals.TestFailure( 253 "ACS chose incorrect channel %d for 2GHz " 254 "band" % chan) 255 256 @test_tracker_info(uuid="3d18da8b-d29a-45f9-8018-5348e10099e9") 257 def test_softap_5G_clean_env(self): 258 """Test to bring up SoftAp on 5GHz in clean environment.""" 259 network = None 260 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_5G) 261 if not chan in range(36, 166): 262 # Note: This does not treat DFS channel separately. 263 raise signals.TestFailure( 264 "ACS chose incorrect channel %d for 5GHz " 265 "band" % chan) 266 267 @test_tracker_info(uuid="cc353bda-3831-4d6e-b990-e501b8e4eafe") 268 def test_softap_auto_clean_env(self): 269 """Test to bring up SoftAp on AUTO-band in clean environment.""" 270 network = None 271 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_AUTO) 272 if not chan in range(36, 166): 273 # Note: This does not treat DFS channel separately. 274 raise signals.TestFailure( 275 "ACS chose incorrect channel %d for 5GHz " 276 "band" % chan) 277 278 @test_tracker_info(uuid="a5f6a926-76d2-46a7-8136-426e35b5a5a8") 279 def test_softap_2G_avoid_channel_1(self): 280 """Test to configure AP and bring up SoftAp on 2G.""" 281 self.configure_ap(channel_2g=1) 282 network = self.reference_networks[0]["2g"] 283 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_2G) 284 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 285 self.verify_acs_channel(chan, avoid_chan) 286 287 @test_tracker_info(uuid="757e2019-b027-40bf-a562-2b01f3e5957e") 288 def test_softap_5G_avoid_channel_1(self): 289 """Test to configure AP and bring up SoftAp on 5G.""" 290 self.configure_ap(channel_2g=1) 291 network = self.reference_networks[0]["2g"] 292 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_5G) 293 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 294 self.verify_acs_channel(chan, avoid_chan) 295 296 @test_tracker_info(uuid="b96e39d1-9041-4662-a55f-22641c2e2b02") 297 def test_softap_2G_avoid_channel_2(self): 298 """Test to configure AP and bring up SoftAp on 2G.""" 299 self.configure_ap(channel_2g=2) 300 network = self.reference_networks[0]["2g"] 301 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_2G) 302 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 303 self.verify_acs_channel(chan, avoid_chan) 304 305 @test_tracker_info(uuid="941c4e2b-ae35-4b49-aa81-13d3dc44b5b6") 306 def test_softap_5G_avoid_channel_2(self): 307 """Test to configure AP and bring up SoftAp on 5G.""" 308 self.configure_ap(channel_2g=2) 309 network = self.reference_networks[0]["2g"] 310 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_5G) 311 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 312 self.verify_acs_channel(chan, avoid_chan) 313 314 @test_tracker_info(uuid="444c4a34-7f6b-4f02-9802-2e896e7d1796") 315 def test_softap_2G_avoid_channel_3(self): 316 """Test to configure AP and bring up SoftAp on 2G.""" 317 self.configure_ap(channel_2g=3) 318 network = self.reference_networks[0]["2g"] 319 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_2G) 320 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 321 self.verify_acs_channel(chan, avoid_chan) 322 323 @test_tracker_info(uuid="eccd06b1-6df5-4144-8fda-1504cb822375") 324 def test_softap_5G_avoid_channel_3(self): 325 """Test to configure AP and bring up SoftAp on 5G.""" 326 self.configure_ap(channel_2g=3) 327 network = self.reference_networks[0]["2g"] 328 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_5G) 329 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 330 self.verify_acs_channel(chan, avoid_chan) 331 332 @test_tracker_info(uuid="fb257644-2081-4c3d-8394-7a308dde0047") 333 def test_softap_2G_avoid_channel_4(self): 334 """Test to configure AP and bring up SoftAp on 2G.""" 335 self.configure_ap(channel_2g=4) 336 network = self.reference_networks[0]["2g"] 337 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_2G) 338 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 339 self.verify_acs_channel(chan, avoid_chan) 340 341 @test_tracker_info(uuid="88b9cd16-4541-408a-8607-415fe60001f2") 342 def test_softap_5G_avoid_channel_4(self): 343 """Test to configure AP and bring up SoftAp on 5G.""" 344 self.configure_ap(channel_2g=4) 345 network = self.reference_networks[0]["2g"] 346 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_5G) 347 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 348 self.verify_acs_channel(chan, avoid_chan) 349 350 @test_tracker_info(uuid="b3626ec8-50e8-412c-bdbe-5c5ade647d7b") 351 def test_softap_2G_avoid_channel_5(self): 352 """Test to configure AP and bring up SoftAp on 2G.""" 353 self.configure_ap(channel_2g=5) 354 network = self.reference_networks[0]["2g"] 355 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_2G) 356 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 357 self.verify_acs_channel(chan, avoid_chan) 358 359 @test_tracker_info(uuid="45c4396b-9b0c-44f3-adf2-ea9c86fcab1d") 360 def test_softap_5G_avoid_channel_5(self): 361 """Test to configure AP and bring up SoftAp on 5G.""" 362 self.configure_ap(channel_2g=5) 363 network = self.reference_networks[0]["2g"] 364 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_5G) 365 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 366 self.verify_acs_channel(chan, avoid_chan) 367 368 @test_tracker_info(uuid="f70634e7-c6fd-403d-8cd7-439fbbda6af0") 369 def test_softap_2G_avoid_channel_6(self): 370 """Test to configure AP and bring up SoftAp on 2G.""" 371 self.configure_ap(channel_2g=6) 372 network = self.reference_networks[0]["2g"] 373 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_2G) 374 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 375 self.verify_acs_channel(chan, avoid_chan) 376 377 @test_tracker_info(uuid="f3341136-10bc-44e2-b9a8-2d27d3284b73") 378 def test_softap_5G_avoid_channel_6(self): 379 """Test to configure AP and bring up SoftAp on 5G.""" 380 self.configure_ap(channel_2g=6) 381 network = self.reference_networks[0]["2g"] 382 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_5G) 383 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 384 self.verify_acs_channel(chan, avoid_chan) 385 386 @test_tracker_info(uuid="8129594d-1608-448b-8548-5a8c4022f2a1") 387 def test_softap_2G_avoid_channel_7(self): 388 """Test to configure AP and bring up SoftAp on 2G.""" 389 self.configure_ap(channel_2g=7) 390 network = self.reference_networks[0]["2g"] 391 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_2G) 392 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 393 self.verify_acs_channel(chan, avoid_chan) 394 395 @test_tracker_info(uuid="7b470b82-d19b-438c-8f98-ce697e0eb474") 396 def test_softap_5G_avoid_channel_7(self): 397 """Test to configure AP and bring up SoftAp on 5G.""" 398 self.configure_ap(channel_2g=7) 399 network = self.reference_networks[0]["2g"] 400 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_5G) 401 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 402 self.verify_acs_channel(chan, avoid_chan) 403 404 @test_tracker_info(uuid="11540182-d471-4bf0-8f8b-add89443c329") 405 def test_softap_2G_avoid_channel_8(self): 406 """Test to configure AP and bring up SoftAp on 2G.""" 407 self.configure_ap(channel_2g=8) 408 network = self.reference_networks[0]["2g"] 409 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_2G) 410 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 411 self.verify_acs_channel(chan, avoid_chan) 412 413 @test_tracker_info(uuid="1280067c-389e-42e9-aa75-6bfbd61340f3") 414 def test_softap_5G_avoid_channel_8(self): 415 """Test to configure AP and bring up SoftAp on 5G.""" 416 self.configure_ap(channel_2g=8) 417 network = self.reference_networks[0]["2g"] 418 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_5G) 419 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 420 self.verify_acs_channel(chan, avoid_chan) 421 422 @test_tracker_info(uuid="6feeb83c-2723-49cb-93c1-6297d4a3d853") 423 def test_softap_2G_avoid_channel_9(self): 424 """Test to configure AP and bring up SoftAp on 2G.""" 425 self.configure_ap(channel_2g=9) 426 network = self.reference_networks[0]["2g"] 427 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_2G) 428 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 429 self.verify_acs_channel(chan, avoid_chan) 430 431 @test_tracker_info(uuid="49a110cd-03e8-4e99-9327-5123eab40902") 432 def test_softap_5G_avoid_channel_9(self): 433 """Test to configure AP and bring up SoftAp on 5G.""" 434 self.configure_ap(channel_2g=9) 435 network = self.reference_networks[0]["2g"] 436 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_5G) 437 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 438 self.verify_acs_channel(chan, avoid_chan) 439 440 @test_tracker_info(uuid="a03c9e45-8763-4b5c-bead-e574fb9899a2") 441 def test_softap_2G_avoid_channel_10(self): 442 """Test to configure AP and bring up SoftAp on 2G.""" 443 self.configure_ap(channel_2g=10) 444 network = self.reference_networks[0]["2g"] 445 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_2G) 446 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 447 self.verify_acs_channel(chan, avoid_chan) 448 449 @test_tracker_info(uuid="c1a1d272-a646-4c2d-8425-09d2ae6ae8e6") 450 def test_softap_5G_avoid_channel_10(self): 451 """Test to configure AP and bring up SoftAp on 5G.""" 452 self.configure_ap(channel_2g=10) 453 network = self.reference_networks[0]["2g"] 454 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_5G) 455 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 456 self.verify_acs_channel(chan, avoid_chan) 457 458 @test_tracker_info(uuid="f38d8911-92d4-4dcd-ba23-1e1667fa1f5a") 459 def test_softap_2G_avoid_channel_11(self): 460 """Test to configure AP and bring up SoftAp on 2G.""" 461 self.configure_ap(channel_2g=11) 462 network = self.reference_networks[0]["2g"] 463 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_2G) 464 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 465 self.verify_acs_channel(chan, avoid_chan) 466 467 @test_tracker_info(uuid="24cc35ba-45e3-4b7a-9bc9-25b7abe92fa9") 468 def test_softap_5G_avoid_channel_11(self): 469 """Test to configure AP and bring up SoftAp on 5G.""" 470 self.configure_ap(channel_2g=11) 471 network = self.reference_networks[0]["2g"] 472 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_5G) 473 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 474 self.verify_acs_channel(chan, avoid_chan) 475 476 @test_tracker_info(uuid="85aef720-4f3c-43bb-9de0-615b88c2bfe0") 477 def test_softap_2G_avoid_channel_36(self): 478 """Test to configure AP and bring up SoftAp on 2G.""" 479 self.configure_ap(channel_5g=36) 480 network = self.reference_networks[0]["5g"] 481 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_2G) 482 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 483 self.verify_acs_channel(chan, avoid_chan) 484 485 @test_tracker_info(uuid="433e8db3-93b5-463e-a83c-0d4b9b9a8700") 486 def test_softap_5G_avoid_channel_36(self): 487 """Test to configure AP and bring up SoftAp on 5G.""" 488 self.configure_ap(channel_5g=36) 489 network = self.reference_networks[0]["5g"] 490 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_5G) 491 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 492 self.verify_acs_channel(chan, avoid_chan) 493 494 @test_tracker_info(uuid="326e0e42-3219-4e63-a18d-5dc32c58e7d8") 495 def test_softap_2G_avoid_channel_40(self): 496 """Test to configure AP and bring up SoftAp on 2G.""" 497 self.configure_ap(channel_5g=40) 498 network = self.reference_networks[0]["5g"] 499 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_2G) 500 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 501 self.verify_acs_channel(chan, avoid_chan) 502 503 @test_tracker_info(uuid="45953c03-c978-4775-a39b-fb7e70c8990a") 504 def test_softap_5G_avoid_channel_40(self): 505 """Test to configure AP and bring up SoftAp on 5G.""" 506 self.configure_ap(channel_5g=40) 507 network = self.reference_networks[0]["5g"] 508 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_5G) 509 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 510 self.verify_acs_channel(chan, avoid_chan) 511 512 @test_tracker_info(uuid="e8e89cec-aa27-4780-8ff8-546d5af820f7") 513 def test_softap_2G_avoid_channel_44(self): 514 """Test to configure AP and bring up SoftAp on 2G.""" 515 self.configure_ap(channel_5g=44) 516 network = self.reference_networks[0]["5g"] 517 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_2G) 518 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 519 self.verify_acs_channel(chan, avoid_chan) 520 521 @test_tracker_info(uuid="5e386d7d-d4c9-40cf-9333-06da55e11ba1") 522 def test_softap_5G_avoid_channel_44(self): 523 """Test to configure AP and bring up SoftAp on 5G.""" 524 self.configure_ap(channel_5g=44) 525 network = self.reference_networks[0]["5g"] 526 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_5G) 527 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 528 self.verify_acs_channel(chan, avoid_chan) 529 530 @test_tracker_info(uuid="cb51dfca-f8de-4dfc-b513-e590c838c766") 531 def test_softap_2G_avoid_channel_48(self): 532 """Test to configure AP and bring up SoftAp on 2G.""" 533 self.configure_ap(channel_5g=48) 534 network = self.reference_networks[0]["5g"] 535 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_2G) 536 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 537 self.verify_acs_channel(chan, avoid_chan) 538 539 @test_tracker_info(uuid="490b8ed1-196c-4941-b06b-5f0721ca440b") 540 def test_softap_5G_avoid_channel_48(self): 541 """Test to configure AP and bring up SoftAp on 5G.""" 542 self.configure_ap(channel_5g=48) 543 network = self.reference_networks[0]["5g"] 544 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_5G) 545 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 546 self.verify_acs_channel(chan, avoid_chan) 547 548 @test_tracker_info(uuid="c5ab141b-e145-4cc1-b0d7-dd610cbfb462") 549 def test_softap_2G_avoid_channel_149(self): 550 """Test to configure AP and bring up SoftAp on 2G.""" 551 self.configure_ap(channel_5g=149) 552 network = self.reference_networks[0]["5g"] 553 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_2G) 554 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 555 self.verify_acs_channel(chan, avoid_chan) 556 557 @test_tracker_info(uuid="108d7ef8-6fe7-49ba-b684-3820e881fcf0") 558 def test_softap_5G_avoid_channel_149(self): 559 """Test to configure AP and bring up SoftAp on 5G.""" 560 self.configure_ap(channel_5g=149) 561 network = self.reference_networks[0]["5g"] 562 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_5G) 563 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 564 self.verify_acs_channel(chan, avoid_chan) 565 566 @test_tracker_info(uuid="f6926f40-0afc-41c5-9b38-c95a99788ff5") 567 def test_softap_2G_avoid_channel_153(self): 568 """Test to configure AP and bring up SoftAp on 2G.""" 569 self.configure_ap(channel_5g=153) 570 network = self.reference_networks[0]["5g"] 571 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_2G) 572 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 573 self.verify_acs_channel(chan, avoid_chan) 574 575 @test_tracker_info(uuid="3d7b653b-c094-4c57-8e6a-047629b05216") 576 def test_softap_5G_avoid_channel_153(self): 577 """Test to configure AP and bring up SoftAp on 5G.""" 578 self.configure_ap(channel_5g=153) 579 network = self.reference_networks[0]["5g"] 580 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_5G) 581 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 582 self.verify_acs_channel(chan, avoid_chan) 583 584 @test_tracker_info(uuid="b866ceea-d3ca-45d4-964a-4edea96026e6") 585 def test_softap_2G_avoid_channel_157(self): 586 """Test to configure AP and bring up SoftAp on 2G.""" 587 self.configure_ap(channel_5g=157) 588 network = self.reference_networks[0]["5g"] 589 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_2G) 590 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 591 self.verify_acs_channel(chan, avoid_chan) 592 593 @test_tracker_info(uuid="03cb9163-bca3-442e-9691-6df82f8c51c7") 594 def test_softap_5G_avoid_channel_157(self): 595 """Test to configure AP and bring up SoftAp on 5G.""" 596 self.configure_ap(channel_5g=157) 597 network = self.reference_networks[0]["5g"] 598 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_5G) 599 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 600 self.verify_acs_channel(chan, avoid_chan) 601 602 @test_tracker_info(uuid="ae10f23a-da70-43c8-9991-2c2f4a602724") 603 def test_softap_2G_avoid_channel_161(self): 604 """Test to configure AP and bring up SoftAp on 2G.""" 605 self.configure_ap(channel_5g=161) 606 network = self.reference_networks[0]["5g"] 607 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_2G) 608 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 609 self.verify_acs_channel(chan, avoid_chan) 610 611 @test_tracker_info(uuid="521686c2-acfa-42d1-861b-aa10ac4dad34") 612 def test_softap_5G_avoid_channel_161(self): 613 """Test to configure AP and bring up SoftAp on 5G.""" 614 self.configure_ap(channel_5g=161) 615 network = self.reference_networks[0]["5g"] 616 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_5G) 617 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 618 self.verify_acs_channel(chan, avoid_chan) 619 620 @test_tracker_info(uuid="77ebecd7-c036-463f-b77d-2cd70d89bc81") 621 def test_softap_2G_avoid_channel_165(self): 622 """Test to configure AP and bring up SoftAp on 2G.""" 623 self.configure_ap(channel_5g=165) 624 network = self.reference_networks[0]["5g"] 625 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_2G) 626 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 627 self.verify_acs_channel(chan, avoid_chan) 628 629 @test_tracker_info(uuid="85d9386d-fe60-4708-9f91-75bbf8bec54f") 630 def test_softap_5G_avoid_channel_165(self): 631 """Test to configure AP and bring up SoftAp on 5G.""" 632 self.configure_ap(channel_5g=165) 633 network = self.reference_networks[0]["5g"] 634 chan = self.start_traffic_and_softap(network, WIFI_CONFIG_APBAND_5G) 635 avoid_chan = int(sys._getframe().f_code.co_name.split('_')[-1]) 636 self.verify_acs_channel(chan, avoid_chan) 637