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