blob: c5d74249f17b5af1de2e85edbc805b37ec75798a [file] [log] [blame]
Roshan Pius69a3ae82018-02-08 17:42:21 -08001#!/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
Roshan Pius69a3ae82018-02-08 17:42:21 -080017import pprint
Roshan Pius69a3ae82018-02-08 17:42:21 -080018import time
19
lutinaf822fee2020-03-10 15:19:04 +080020from acts import asserts
21from acts import base_test
22from acts.controllers.ap_lib import hostapd_constants
Roshan Pius69a3ae82018-02-08 17:42:21 -080023import acts.signals as signals
lutinaf822fee2020-03-10 15:19:04 +080024from acts.test_decorators import test_tracker_info
Roshan Pius69a3ae82018-02-08 17:42:21 -080025from acts.test_utils.tel.tel_test_utils import WIFI_CONFIG_APBAND_2G
26from acts.test_utils.tel.tel_test_utils import WIFI_CONFIG_APBAND_5G
27import acts.test_utils.wifi.wifi_test_utils as wutils
lutinaf822fee2020-03-10 15:19:04 +080028from acts.test_utils.wifi.WifiBaseTest import WifiBaseTest
Roshan Pius69a3ae82018-02-08 17:42:21 -080029import acts.utils as utils
30
Roshan Pius69a3ae82018-02-08 17:42:21 -080031WifiEnums = wutils.WifiEnums
lutinaf822fee2020-03-10 15:19:04 +080032WLAN = "wlan0"
Roshan Pius98a977d2018-05-03 12:17:19 -070033# Channels to configure the AP for various test scenarios.
34WIFI_NETWORK_AP_CHANNEL_2G = 1
35WIFI_NETWORK_AP_CHANNEL_5G = 36
36WIFI_NETWORK_AP_CHANNEL_5G_DFS = 132
37
lutinaf822fee2020-03-10 15:19:04 +080038
Roshan Pius69a3ae82018-02-08 17:42:21 -080039class WifiStaApConcurrencyTest(WifiBaseTest):
Hsiu-Chang Chen4a59e012018-08-28 10:19:23 +080040 """Tests for STA + AP concurrency scenarios.
Roshan Pius69a3ae82018-02-08 17:42:21 -080041
42 Test Bed Requirement:
43 * Two Android devices (For AP)
44 * One Wi-Fi network visible to the device (for STA).
45 """
46
Roshan Pius69a3ae82018-02-08 17:42:21 -080047 def setup_class(self):
Xianyuan Jia168103b2019-09-06 12:22:52 -070048 super().setup_class()
49
Roshan Pius69a3ae82018-02-08 17:42:21 -080050 self.dut = self.android_devices[0]
51 self.dut_client = self.android_devices[1]
lutinaf822fee2020-03-10 15:19:04 +080052
Roshan Pius69a3ae82018-02-08 17:42:21 -080053 # Do a simple version of init - mainly just sync the time and enable
54 # verbose logging. This test will fail if the DUT has a sim and cell
55 # data is disabled. We would also like to test with phones in less
56 # constrained states (or add variations where we specifically
57 # constrain).
lutinaf822fee2020-03-10 15:19:04 +080058 utils.require_sl4a(self.android_devices)
Roshan Pius69a3ae82018-02-08 17:42:21 -080059
lutinaf822fee2020-03-10 15:19:04 +080060 for ad in self.android_devices:
61 wutils.wifi_test_device_init(ad)
62 utils.sync_device_time(ad)
63 # Set country code explicitly to "US".
64 wutils.set_wifi_country_code(ad, WifiEnums.CountryCode.US)
65 # Enable verbose logging on the duts.
66 ad.droid.wifiEnableVerboseLogging(1)
Roshan Pius69a3ae82018-02-08 17:42:21 -080067
lutinaf822fee2020-03-10 15:19:04 +080068 req_params = ["dbs_supported_models",
69 "iperf_server_address",
70 "iperf_server_port"]
71 self.unpack_userparams(req_param_names=req_params,)
Girish Moturu0162f182019-08-16 14:15:04 -070072 asserts.abort_class_if(
73 self.dut.model not in self.dbs_supported_models,
74 "Device %s does not support dual interfaces." % self.dut.model)
Roshan Piusfe1cb2f2018-05-15 15:38:27 -070075
Roshan Pius69a3ae82018-02-08 17:42:21 -080076 def setup_test(self):
Hsiu-Chang Chen142beb72018-09-18 14:01:02 +080077 for ad in self.android_devices:
78 ad.droid.wakeLockAcquireBright()
79 ad.droid.wakeUpNow()
Roshan Pius69a3ae82018-02-08 17:42:21 -080080 self.turn_location_off_and_scan_toggle_off()
Roshan Pius69a3ae82018-02-08 17:42:21 -080081
82 def teardown_test(self):
Girish Moturu0162f182019-08-16 14:15:04 -070083 # Prevent the stop wifi tethering failure to block ap close
84 try:
85 wutils.stop_wifi_tethering(self.dut)
86 except signals.TestFailure:
87 pass
Hsiu-Chang Chen142beb72018-09-18 14:01:02 +080088 for ad in self.android_devices:
89 ad.droid.wakeLockRelease()
90 ad.droid.goToSleepNow()
91 wutils.reset_wifi(ad)
lutinaf822fee2020-03-10 15:19:04 +080092 self.turn_location_on_and_scan_toggle_on()
93 wutils.wifi_toggle_state(self.dut, True)
Roshan Pius98a977d2018-05-03 12:17:19 -070094 self.access_points[0].close()
95 del self.user_params["reference_networks"]
96 del self.user_params["open_network"]
Roshan Pius69a3ae82018-02-08 17:42:21 -080097
Roshan Pius69a3ae82018-02-08 17:42:21 -080098 def on_fail(self, test_name, begin_time):
Hsiu-Chang Chen142beb72018-09-18 14:01:02 +080099 for ad in self.android_devices:
100 ad.take_bug_report(test_name, begin_time)
101 ad.cat_adb_log(test_name, begin_time)
Roshan Pius69a3ae82018-02-08 17:42:21 -0800102
lutinaf822fee2020-03-10 15:19:04 +0800103 ### Helper Functions ###
104
Roshan Pius98a977d2018-05-03 12:17:19 -0700105 def configure_ap(self, channel_2g=None, channel_5g=None):
106 """Configure and bring up AP on required channel.
107
108 Args:
109 channel_2g: The channel number to use for 2GHz network.
110 channel_5g: The channel number to use for 5GHz network.
111
112 """
113 if not channel_2g:
lutinaf822fee2020-03-10 15:19:04 +0800114 channel_2g = hostapd_constants.AP_DEFAULT_CHANNEL_2G
115 if not channel_5g:
116 channel_5g = hostapd_constants.AP_DEFAULT_CHANNEL_5G
117 self.legacy_configure_ap_and_start(channel_2g=channel_2g,
118 channel_5g=channel_5g)
119 self.open_2g = self.open_network[0]["2g"]
120 self.open_5g = self.open_network[0]["5g"]
Roshan Pius98a977d2018-05-03 12:17:19 -0700121
Roshan Pius69a3ae82018-02-08 17:42:21 -0800122 def turn_location_on_and_scan_toggle_on(self):
lutinaf822fee2020-03-10 15:19:04 +0800123 """Turns on wifi location scans."""
124 utils.set_location_service(self.dut, True)
Roshan Pius69a3ae82018-02-08 17:42:21 -0800125 self.dut.droid.wifiScannerToggleAlwaysAvailable(True)
126 msg = "Failed to turn on location service's scan."
127 asserts.assert_true(self.dut.droid.wifiScannerIsAlwaysAvailable(), msg)
128
129 def turn_location_off_and_scan_toggle_off(self):
lutinaf822fee2020-03-10 15:19:04 +0800130 """Turns off wifi location scans."""
131 utils.set_location_service(self.dut, False)
Roshan Pius69a3ae82018-02-08 17:42:21 -0800132 self.dut.droid.wifiScannerToggleAlwaysAvailable(False)
133 msg = "Failed to turn off location service's scan."
lutinaf822fee2020-03-10 15:19:04 +0800134 asserts.assert_false(self.dut.droid.wifiScannerIsAlwaysAvailable(), msg)
Roshan Pius69a3ae82018-02-08 17:42:21 -0800135
136 def run_iperf_client(self, params):
137 """Run iperf traffic after connection.
138
139 Args:
140 params: A tuple of network info and AndroidDevice object.
141 """
142 if "iperf_server_address" in self.user_params:
143 wait_time = 5
144 network, ad = params
lutinaf822fee2020-03-10 15:19:04 +0800145 ssid = network[WifiEnums.SSID_KEY]
146 self.log.info("Starting iperf traffic through {}".format(ssid))
Roshan Pius69a3ae82018-02-08 17:42:21 -0800147 time.sleep(wait_time)
Girish Moturu55e46be2019-08-16 14:42:24 -0700148 port_arg = "-p {}".format(self.iperf_server_port)
Roshan Pius69a3ae82018-02-08 17:42:21 -0800149 success, data = ad.run_iperf_client(self.iperf_server_address,
150 port_arg)
151 self.log.debug(pprint.pformat(data))
152 asserts.assert_true(success, "Error occurred in iPerf traffic.")
153
Roshan Pius69a3ae82018-02-08 17:42:21 -0800154 def create_softap_config(self):
155 """Create a softap config with ssid and password."""
156 ap_ssid = "softap_" + utils.rand_ascii_str(8)
157 ap_password = utils.rand_ascii_str(8)
158 self.dut.log.info("softap setup: %s %s", ap_ssid, ap_password)
159 config = {wutils.WifiEnums.SSID_KEY: ap_ssid}
160 config[wutils.WifiEnums.PWD_KEY] = ap_password
161 return config
162
Hsiu-Chang Chen142beb72018-09-18 14:01:02 +0800163 def start_softap_and_verify(self, band, check_connectivity=True):
lutinaf822fee2020-03-10 15:19:04 +0800164 """Test startup of softap.
Roshan Pius69a3ae82018-02-08 17:42:21 -0800165
Hsiu-Chang Chen4a59e012018-08-28 10:19:23 +0800166 1. Bring up AP mode.
Roshan Pius69a3ae82018-02-08 17:42:21 -0800167 2. Verify SoftAP active using the client device.
lutinaf822fee2020-03-10 15:19:04 +0800168
169 Args:
170 band: wifi band to start soft ap on
171 check_connectivity: If set, verify internet connectivity
172
173 Returns:
174 Softap config
Roshan Pius69a3ae82018-02-08 17:42:21 -0800175 """
176 config = self.create_softap_config()
177 wutils.start_wifi_tethering(self.dut,
lutinaf822fee2020-03-10 15:19:04 +0800178 config[WifiEnums.SSID_KEY],
179 config[WifiEnums.PWD_KEY],
180 band)
181 for ad in self.android_devices[1:]:
182 wutils.connect_to_wifi_network(
183 ad, config, check_connectivity=check_connectivity)
Hsiu-Chang Chen4a59e012018-08-28 10:19:23 +0800184 return config
Roshan Pius69a3ae82018-02-08 17:42:21 -0800185
186 def connect_to_wifi_network_and_start_softap(self, nw_params, softap_band):
Hsiu-Chang Chen4a59e012018-08-28 10:19:23 +0800187 """Test concurrent wifi connection and softap.
lutinaf822fee2020-03-10 15:19:04 +0800188
Hsiu-Chang Chen4a59e012018-08-28 10:19:23 +0800189 This helper method first makes a wifi connection and then starts SoftAp.
Roshan Pius69a3ae82018-02-08 17:42:21 -0800190 1. Bring up wifi.
191 2. Establish connection to a network.
Hsiu-Chang Chen4a59e012018-08-28 10:19:23 +0800192 3. Bring up softap and verify AP can be connected by a client device.
193 4. Run iperf on the wifi/softap connection to the network.
Roshan Pius69a3ae82018-02-08 17:42:21 -0800194
195 Args:
196 nw_params: Params for network STA connection.
197 softap_band: Band for the AP.
lutinaf822fee2020-03-10 15:19:04 +0800198 """
199 wutils.connect_to_wifi_network(self.dut, nw_params)
200 softap_config = self.start_softap_and_verify(softap_band)
201 self.run_iperf_client((nw_params, self.dut))
202 self.run_iperf_client((softap_config, self.dut_client))
Roshan Pius69a3ae82018-02-08 17:42:21 -0800203
lutinaf822fee2020-03-10 15:19:04 +0800204 if len(self.android_devices) > 2:
205 self.log.info("Testbed has extra devices, do more validation")
206 self.verify_traffic_between_dut_clients(
207 self.dut_client, self.android_devices[2])
208
209 asserts.assert_true(self.dut.droid.wifiCheckState(),
210 "Wifi is not reported as running")
211 asserts.assert_true(self.dut.droid.wifiIsApEnabled(),
212 "SoftAp is not reported as running")
213
214 def start_softap_and_connect_to_wifi_network(self, nw_params, softap_band):
215 """Test concurrent wifi connection and softap.
216
217 This helper method first starts SoftAp and then makes a wifi connection.
Hsiu-Chang Chen4a59e012018-08-28 10:19:23 +0800218 1. Bring up softap and verify AP can be connected by a client device.
Roshan Pius69a3ae82018-02-08 17:42:21 -0800219 2. Bring up wifi.
220 3. Establish connection to a network.
Hsiu-Chang Chen4a59e012018-08-28 10:19:23 +0800221 4. Run iperf on the wifi/softap connection to the network.
lutinaf822fee2020-03-10 15:19:04 +0800222 5. Verify wifi state and softap state.
223
224 Args:
225 nw_params: Params for network STA connection.
226 softap_band: Band for the AP.
Roshan Pius69a3ae82018-02-08 17:42:21 -0800227 """
lutinaf822fee2020-03-10 15:19:04 +0800228 softap_config = self.start_softap_and_verify(softap_band, False)
229 wutils.connect_to_wifi_network(self.dut, nw_params)
Roshan Pius69a3ae82018-02-08 17:42:21 -0800230 self.run_iperf_client((nw_params, self.dut))
Hsiu-Chang Chen4a59e012018-08-28 10:19:23 +0800231 self.run_iperf_client((softap_config, self.dut_client))
Roshan Pius69a3ae82018-02-08 17:42:21 -0800232
lutinaf822fee2020-03-10 15:19:04 +0800233 if len(self.android_devices) > 2:
234 self.log.info("Testbed has extra devices, do more validation")
235 self.verify_traffic_between_dut_clients(
236 self.dut, self.android_devices[2])
237
Roshan Pius69a3ae82018-02-08 17:42:21 -0800238 asserts.assert_true(self.dut.droid.wifiCheckState(),
Hsiu-Chang Chen4a59e012018-08-28 10:19:23 +0800239 "Wifi is not reported as running")
Roshan Pius98a977d2018-05-03 12:17:19 -0700240 asserts.assert_true(self.dut.droid.wifiIsApEnabled(),
lutinaf822fee2020-03-10 15:19:04 +0800241 "SoftAp is not reported as running")
Roshan Pius69a3ae82018-02-08 17:42:21 -0800242
lutinaf822fee2020-03-10 15:19:04 +0800243 def verify_traffic_between_dut_clients(self, ad1, ad2, num_of_tries=2):
Hsiu-Chang Chence2327a2019-05-14 14:51:09 +0800244 """Test the clients that connect to DUT's softap can ping each other.
245
246 Args:
lutinaf822fee2020-03-10 15:19:04 +0800247 ad1: DUT 1
248 ad2: DUT 2
Hsiu-Chang Chence2327a2019-05-14 14:51:09 +0800249 num_of_tries: the retry times of ping test.
250 """
lutinaf822fee2020-03-10 15:19:04 +0800251 ad1_ip = ad1.droid.connectivityGetIPv4Addresses(WLAN)[0]
252 ad2_ip = ad2.droid.connectivityGetIPv4Addresses(WLAN)[0]
Hsiu-Chang Chence2327a2019-05-14 14:51:09 +0800253 # Ping each other
254 for _ in range(num_of_tries):
255 if utils.adb_shell_ping(ad1, count=10, dest_ip=ad2_ip, timeout=20):
256 break
257 else:
258 asserts.fail("%s ping %s failed" % (ad1.serial, ad2_ip))
259 for _ in range(num_of_tries):
260 if utils.adb_shell_ping(ad2, count=10, dest_ip=ad1_ip, timeout=20):
261 break
262 else:
263 asserts.fail("%s ping %s failed" % (ad2.serial, ad1_ip))
264
lutinaf822fee2020-03-10 15:19:04 +0800265 ### Tests ###
Hsiu-Chang Chence2327a2019-05-14 14:51:09 +0800266
Roshan Pius6d0704e2018-05-09 16:18:40 -0700267 @test_tracker_info(uuid="c396e7ac-cf22-4736-a623-aa6d3c50193a")
Roshan Pius69a3ae82018-02-08 17:42:21 -0800268 def test_wifi_connection_2G_softap_2G(self):
lutinaf822fee2020-03-10 15:19:04 +0800269 """Test connection to 2G network followed by SoftAp on 2G."""
Roshan Pius98a977d2018-05-03 12:17:19 -0700270 self.configure_ap(channel_2g=WIFI_NETWORK_AP_CHANNEL_2G)
Roshan Pius69a3ae82018-02-08 17:42:21 -0800271 self.connect_to_wifi_network_and_start_softap(
lutinaf822fee2020-03-10 15:19:04 +0800272 self.open_2g, WIFI_CONFIG_APBAND_2G)
Roshan Pius69a3ae82018-02-08 17:42:21 -0800273
Roshan Pius6d0704e2018-05-09 16:18:40 -0700274 @test_tracker_info(uuid="1cd6120d-3db4-4624-9bae-55c976533a48")
Roshan Pius69a3ae82018-02-08 17:42:21 -0800275 def test_wifi_connection_5G_softap_5G(self):
lutinaf822fee2020-03-10 15:19:04 +0800276 """Test connection to 5G network followed by SoftAp on 5G."""
Roshan Pius98a977d2018-05-03 12:17:19 -0700277 self.configure_ap(channel_5g=WIFI_NETWORK_AP_CHANNEL_5G)
278 self.connect_to_wifi_network_and_start_softap(
lutinaf822fee2020-03-10 15:19:04 +0800279 self.open_5g, WIFI_CONFIG_APBAND_5G)
Roshan Pius98a977d2018-05-03 12:17:19 -0700280
Roshan Pius6d0704e2018-05-09 16:18:40 -0700281 @test_tracker_info(uuid="5f980007-3490-413e-b94e-7700ffab8534")
Roshan Pius98a977d2018-05-03 12:17:19 -0700282 def test_wifi_connection_5G_DFS_softap_5G(self):
lutinaf822fee2020-03-10 15:19:04 +0800283 """Test connection to 5G DFS network followed by SoftAp on 5G."""
Roshan Pius98a977d2018-05-03 12:17:19 -0700284 self.configure_ap(channel_5g=WIFI_NETWORK_AP_CHANNEL_5G_DFS)
Roshan Pius69a3ae82018-02-08 17:42:21 -0800285 self.connect_to_wifi_network_and_start_softap(
lutinaf822fee2020-03-10 15:19:04 +0800286 self.open_5g, WIFI_CONFIG_APBAND_5G)
Roshan Pius69a3ae82018-02-08 17:42:21 -0800287
Roshan Pius6d0704e2018-05-09 16:18:40 -0700288 @test_tracker_info(uuid="d05d5d44-c738-4372-9f01-ce2a640a2f25")
Roshan Pius69a3ae82018-02-08 17:42:21 -0800289 def test_wifi_connection_5G_softap_2G(self):
lutinaf822fee2020-03-10 15:19:04 +0800290 """Test connection to 5G network followed by SoftAp on 2G."""
Roshan Pius98a977d2018-05-03 12:17:19 -0700291 self.configure_ap(channel_5g=WIFI_NETWORK_AP_CHANNEL_5G)
292 self.connect_to_wifi_network_and_start_softap(
lutinaf822fee2020-03-10 15:19:04 +0800293 self.open_5g, WIFI_CONFIG_APBAND_2G)
Roshan Pius98a977d2018-05-03 12:17:19 -0700294
Roshan Pius6d0704e2018-05-09 16:18:40 -0700295 @test_tracker_info(uuid="909ac713-1ad3-4dad-9be3-ad60f00ed25e")
Roshan Pius98a977d2018-05-03 12:17:19 -0700296 def test_wifi_connection_5G_DFS_softap_2G(self):
lutinaf822fee2020-03-10 15:19:04 +0800297 """Test connection to 5G DFS network followed by SoftAp on 2G."""
Roshan Pius98a977d2018-05-03 12:17:19 -0700298 self.configure_ap(channel_5g=WIFI_NETWORK_AP_CHANNEL_5G_DFS)
Roshan Pius69a3ae82018-02-08 17:42:21 -0800299 self.connect_to_wifi_network_and_start_softap(
lutinaf822fee2020-03-10 15:19:04 +0800300 self.open_5g, WIFI_CONFIG_APBAND_2G)
Roshan Pius69a3ae82018-02-08 17:42:21 -0800301
Roshan Pius6d0704e2018-05-09 16:18:40 -0700302 @test_tracker_info(uuid="e8de724a-25d3-4801-94cc-22e9e0ecc8d1")
Roshan Pius69a3ae82018-02-08 17:42:21 -0800303 def test_wifi_connection_2G_softap_5G(self):
lutinaf822fee2020-03-10 15:19:04 +0800304 """Test connection to 2G network followed by SoftAp on 5G."""
Roshan Pius98a977d2018-05-03 12:17:19 -0700305 self.configure_ap(channel_2g=WIFI_NETWORK_AP_CHANNEL_2G)
Roshan Pius69a3ae82018-02-08 17:42:21 -0800306 self.connect_to_wifi_network_and_start_softap(
lutinaf822fee2020-03-10 15:19:04 +0800307 self.open_2g, WIFI_CONFIG_APBAND_5G)
Roshan Pius69a3ae82018-02-08 17:42:21 -0800308
Roshan Pius6d0704e2018-05-09 16:18:40 -0700309 @test_tracker_info(uuid="647f4e17-5c7a-4249-98af-f791d163a39f")
Roshan Pius69a3ae82018-02-08 17:42:21 -0800310 def test_wifi_connection_5G_softap_2G_with_location_scan_on(self):
lutinaf822fee2020-03-10 15:19:04 +0800311 """Test connection to 5G network, SoftAp on 2G with location scan on."""
Roshan Pius98a977d2018-05-03 12:17:19 -0700312 self.configure_ap(channel_5g=WIFI_NETWORK_AP_CHANNEL_5G)
Roshan Pius69a3ae82018-02-08 17:42:21 -0800313 self.turn_location_on_and_scan_toggle_on()
314 self.connect_to_wifi_network_and_start_softap(
lutinaf822fee2020-03-10 15:19:04 +0800315 self.open_5g, WIFI_CONFIG_APBAND_2G)
Roshan Piusf4446a12019-03-05 09:09:53 -0800316 # Now toggle wifi off & ensure we can still scan.
317 wutils.wifi_toggle_state(self.dut, False)
318 wutils.start_wifi_connection_scan_and_ensure_network_found(
lutinaf822fee2020-03-10 15:19:04 +0800319 self.dut, self.open_5g[WifiEnums.SSID_KEY])
Roshan Pius69a3ae82018-02-08 17:42:21 -0800320
Roshan Pius6d0704e2018-05-09 16:18:40 -0700321 @test_tracker_info(uuid="4aa56c11-e5bc-480b-bd61-4b4ee577a5da")
Roshan Pius69a3ae82018-02-08 17:42:21 -0800322 def test_softap_2G_wifi_connection_2G(self):
lutinaf822fee2020-03-10 15:19:04 +0800323 """Test SoftAp on 2G followed by connection to 2G network."""
Roshan Pius98a977d2018-05-03 12:17:19 -0700324 self.configure_ap(channel_2g=WIFI_NETWORK_AP_CHANNEL_2G)
Roshan Pius69a3ae82018-02-08 17:42:21 -0800325 self.start_softap_and_connect_to_wifi_network(
lutinaf822fee2020-03-10 15:19:04 +0800326 self.open_2g, WIFI_CONFIG_APBAND_2G)
Roshan Pius69a3ae82018-02-08 17:42:21 -0800327
Roshan Pius6d0704e2018-05-09 16:18:40 -0700328 @test_tracker_info(uuid="5f954957-ad20-4de1-b20c-6c97d0463bdd")
Roshan Pius69a3ae82018-02-08 17:42:21 -0800329 def test_softap_5G_wifi_connection_5G(self):
lutinaf822fee2020-03-10 15:19:04 +0800330 """Test SoftAp on 5G followed by connection to 5G network."""
Roshan Pius98a977d2018-05-03 12:17:19 -0700331 self.configure_ap(channel_5g=WIFI_NETWORK_AP_CHANNEL_5G)
332 self.start_softap_and_connect_to_wifi_network(
lutinaf822fee2020-03-10 15:19:04 +0800333 self.open_5g, WIFI_CONFIG_APBAND_5G)
Roshan Pius98a977d2018-05-03 12:17:19 -0700334
Roshan Pius6d0704e2018-05-09 16:18:40 -0700335 @test_tracker_info(uuid="1306aafc-a07e-4654-ba78-674f90cf748e")
Roshan Pius98a977d2018-05-03 12:17:19 -0700336 def test_softap_5G_wifi_connection_5G_DFS(self):
lutinaf822fee2020-03-10 15:19:04 +0800337 """Test SoftAp on 5G followed by connection to 5G DFS network."""
Roshan Pius98a977d2018-05-03 12:17:19 -0700338 self.configure_ap(channel_5g=WIFI_NETWORK_AP_CHANNEL_5G_DFS)
Roshan Pius69a3ae82018-02-08 17:42:21 -0800339 self.start_softap_and_connect_to_wifi_network(
lutinaf822fee2020-03-10 15:19:04 +0800340 self.open_5g, WIFI_CONFIG_APBAND_5G)
Roshan Pius69a3ae82018-02-08 17:42:21 -0800341
Roshan Pius6d0704e2018-05-09 16:18:40 -0700342 @test_tracker_info(uuid="5e28e8b5-3faa-4cff-a782-13a796d7f572")
Roshan Pius69a3ae82018-02-08 17:42:21 -0800343 def test_softap_5G_wifi_connection_2G(self):
lutinaf822fee2020-03-10 15:19:04 +0800344 """Test SoftAp on 5G followed by connection to 2G network."""
Roshan Pius0bc7af32018-06-25 13:50:09 -0700345 self.configure_ap(channel_2g=WIFI_NETWORK_AP_CHANNEL_2G)
Roshan Pius69a3ae82018-02-08 17:42:21 -0800346 self.start_softap_and_connect_to_wifi_network(
lutinaf822fee2020-03-10 15:19:04 +0800347 self.open_2g, WIFI_CONFIG_APBAND_5G)
Roshan Pius69a3ae82018-02-08 17:42:21 -0800348
Roshan Pius6d0704e2018-05-09 16:18:40 -0700349 @test_tracker_info(uuid="a2c62bc6-9ccd-4bc4-8a23-9a1b5d0b4b5c")
Roshan Pius69a3ae82018-02-08 17:42:21 -0800350 def test_softap_2G_wifi_connection_5G(self):
lutinaf822fee2020-03-10 15:19:04 +0800351 """Test SoftAp on 2G followed by connection to 5G network."""
Roshan Pius98a977d2018-05-03 12:17:19 -0700352 self.configure_ap(channel_5g=WIFI_NETWORK_AP_CHANNEL_5G)
Roshan Pius69a3ae82018-02-08 17:42:21 -0800353 self.start_softap_and_connect_to_wifi_network(
lutinaf822fee2020-03-10 15:19:04 +0800354 self.open_5g, WIFI_CONFIG_APBAND_2G)
Roshan Pius98a977d2018-05-03 12:17:19 -0700355
Hsiu-Chang Chene72a6882019-05-22 14:38:11 +0800356 @test_tracker_info(uuid="75400685-a9d9-4091-8af3-97bd539c246a")
Roshan Pius98a977d2018-05-03 12:17:19 -0700357 def test_softap_2G_wifi_connection_5G_DFS(self):
lutinaf822fee2020-03-10 15:19:04 +0800358 """Test SoftAp on 2G followed by connection to 5G DFS network."""
Roshan Pius98a977d2018-05-03 12:17:19 -0700359 self.configure_ap(channel_5g=WIFI_NETWORK_AP_CHANNEL_5G_DFS)
360 self.start_softap_and_connect_to_wifi_network(
lutinaf822fee2020-03-10 15:19:04 +0800361 self.open_5g, WIFI_CONFIG_APBAND_2G)
Roshan Pius69a3ae82018-02-08 17:42:21 -0800362
Roshan Pius6d0704e2018-05-09 16:18:40 -0700363 @test_tracker_info(uuid="aa23a3fc-31a1-4d5c-8cf5-2eb9fdf9e7ce")
Roshan Pius69a3ae82018-02-08 17:42:21 -0800364 def test_softap_5G_wifi_connection_2G_with_location_scan_on(self):
lutinaf822fee2020-03-10 15:19:04 +0800365 """Test SoftAp on 5G, connection to 2G network with location scan on."""
Roshan Pius0bc7af32018-06-25 13:50:09 -0700366 self.configure_ap(channel_2g=WIFI_NETWORK_AP_CHANNEL_2G)
Roshan Pius69a3ae82018-02-08 17:42:21 -0800367 self.turn_location_on_and_scan_toggle_on()
368 self.start_softap_and_connect_to_wifi_network(
lutinaf822fee2020-03-10 15:19:04 +0800369 self.open_2g, WIFI_CONFIG_APBAND_5G)
Roshan Piusf4446a12019-03-05 09:09:53 -0800370 # Now toggle wifi off & ensure we can still scan.
371 wutils.wifi_toggle_state(self.dut, False)
372 wutils.start_wifi_connection_scan_and_ensure_network_found(
lutinaf822fee2020-03-10 15:19:04 +0800373 self.dut, self.open_2g[WifiEnums.SSID_KEY])