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