Pratik Sheth | 078fd35 | 2021-02-18 10:54:21 -0800 | [diff] [blame] | 1 | #!/usr/bin/env python3.4 |
| 2 | # |
| 3 | # Copyright 2021 - Google |
| 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 | """ |
| 17 | Test Script for 5G IMS Settings scenarios |
| 18 | """ |
| 19 | |
| 20 | import time |
| 21 | |
| 22 | from acts import signals |
| 23 | from acts.test_decorators import test_tracker_info |
| 24 | from acts_contrib.test_utils.tel.TelephonyBaseTest import TelephonyBaseTest |
| 25 | from acts_contrib.test_utils.tel.tel_defines import CarrierConfigs |
| 26 | from acts_contrib.test_utils.tel.tel_defines import CAPABILITY_VOLTE |
| 27 | from acts_contrib.test_utils.tel.tel_defines import CAPABILITY_WFC |
| 28 | from acts_contrib.test_utils.tel.tel_defines import NETWORK_SERVICE_VOICE |
| 29 | from acts_contrib.test_utils.tel.tel_defines import RAT_NR |
| 30 | from acts_contrib.test_utils.tel.tel_defines import WFC_MODE_WIFI_PREFERRED |
| 31 | from acts_contrib.test_utils.tel.tel_defines import WFC_MODE_CELLULAR_PREFERRED |
| 32 | from acts_contrib.test_utils.tel.tel_subscription_utils import get_outgoing_voice_sub_id |
| 33 | from acts_contrib.test_utils.tel.tel_test_utils import dumpsys_carrier_config |
| 34 | from acts_contrib.test_utils.tel.tel_voice_utils import phone_setup_csfb |
| 35 | from acts_contrib.test_utils.tel.tel_voice_utils import phone_setup_volte |
| 36 | from acts_contrib.test_utils.tel.tel_5g_utils import is_current_network_5g_nsa |
| 37 | from acts_contrib.test_utils.tel.tel_5g_utils import provision_both_devices_for_5g |
| 38 | from acts_contrib.test_utils.tel.tel_5g_utils import provision_device_for_5g |
| 39 | from acts_contrib.test_utils.tel.tel_5g_utils import set_preferred_mode_for_5g |
| 40 | from acts_contrib.test_utils.tel.tel_ims_utils import change_ims_setting |
| 41 | |
| 42 | |
| 43 | class Nsa5gImsSettingsTest(TelephonyBaseTest): |
| 44 | |
| 45 | def setup_class(self): |
| 46 | TelephonyBaseTest.setup_class(self) |
| 47 | self.dut = self.android_devices[0] |
| 48 | self.dut_client = self.android_devices[1] |
| 49 | self.skip_reset_between_cases = False |
| 50 | self.subid = get_outgoing_voice_sub_id(self.dut) |
| 51 | self.dut_capabilities = self.dut.telephony["subscription"][ |
| 52 | self.subid].get("capabilities", []) |
| 53 | self.dut.log.info("DUT capabilities: %s", self.dut_capabilities) |
| 54 | if CAPABILITY_VOLTE not in self.dut_capabilities: |
| 55 | raise signals.TestAbortClass("VoLTE is not supported") |
| 56 | if CAPABILITY_WFC not in self.dut_capabilities: |
| 57 | raise signals.TestAbortClass("WFC is not supported") |
| 58 | self.carrier_configs = dumpsys_carrier_config(self.dut)[self.subid] |
| 59 | self.default_wfc_mode = self.carrier_configs.get( |
| 60 | CarrierConfigs.DEFAULT_WFC_IMS_MODE_INT, None) |
| 61 | self.dut_wfc_modes = self.dut.telephony[ |
| 62 | "subscription"][self.subid].get("wfc_modes", []) |
| 63 | |
| 64 | |
| 65 | """ Tests Begin """ |
| 66 | |
Pratik Sheth | 8ad702b | 2021-03-05 09:44:49 -0800 | [diff] [blame] | 67 | @test_tracker_info(uuid="9ed17e7b-c933-4b46-9349-a76fbcba3a24") |
Pratik Sheth | 078fd35 | 2021-02-18 10:54:21 -0800 | [diff] [blame] | 68 | @TelephonyBaseTest.tel_test_wrap |
| 69 | def test_5g_nsa_volte_wifi_connected_toggle_wfc(self): |
| 70 | """Test for WiFi Calling settings: |
| 71 | nsa 5G + VoLTE Enabled + WiFi Connected, Toggling WFC |
| 72 | |
| 73 | Steps: |
| 74 | 1. Setup DUT Idle, 5G network type, VoLTE enabled. |
| 75 | 2. Make sure DUT WiFi connected, WFC disabled. |
| 76 | 3. Set DUT WFC enabled (WiFi Preferred), verify DUT WFC available, |
| 77 | report iwlan rat. |
| 78 | 4. Set DUT WFC disabled, verify DUT WFC unavailable, |
| 79 | not report iwlan rat. |
| 80 | |
| 81 | Expected Results: |
| 82 | 3. DUT WiFi Calling feature bit return True, network rat is iwlan. |
| 83 | 4. DUT WiFi Calling feature bit return False, network rat is not iwlan. |
| 84 | """ |
| 85 | |
| 86 | if not phone_setup_volte(self.log, self.dut): |
| 87 | self.log.error("Failed to setup VoLTE") |
| 88 | return False |
| 89 | |
| 90 | if not provision_device_for_5g(self.log, self.dut): |
| 91 | return False |
| 92 | |
| 93 | if not change_ims_setting(log=self.log, |
| 94 | ad=self.dut, |
| 95 | dut_client= self.dut_client, |
| 96 | wifi_network_ssid=self.wifi_network_ssid, |
| 97 | wifi_network_pass=self.wifi_network_pass, |
| 98 | subid=self.subid, |
| 99 | dut_capabilities=self.dut_capabilities, |
| 100 | airplane_mode=False, |
| 101 | wifi_enabled=True, |
| 102 | volte_enabled=True, |
| 103 | wfc_enabled=True, |
| 104 | nw_gen=RAT_NR, |
| 105 | wfc_mode=self.default_wfc_mode): |
| 106 | return False |
| 107 | if not change_ims_setting(log=self.log, |
| 108 | ad=self.dut, |
| 109 | dut_client= self.dut_client, |
| 110 | wifi_network_ssid=self.wifi_network_ssid, |
| 111 | wifi_network_pass=self.wifi_network_pass, |
| 112 | dut_capabilities=self.dut_capabilities, |
| 113 | subid=self.subid, |
| 114 | airplane_mode=False, |
| 115 | wifi_enabled=True, |
| 116 | volte_enabled=True, |
| 117 | wfc_enabled=False, |
| 118 | nw_gen=RAT_NR, |
| 119 | wfc_mode=None): |
| 120 | return False |
| 121 | return change_ims_setting(log=self.log, |
| 122 | ad=self.dut, |
| 123 | dut_client= self.dut_client, |
| 124 | wifi_network_ssid=self.wifi_network_ssid, |
| 125 | wifi_network_pass=self.wifi_network_pass, |
| 126 | dut_capabilities=self.dut_capabilities, |
| 127 | subid=self.subid, |
| 128 | airplane_mode=False, |
| 129 | wifi_enabled=True, |
| 130 | volte_enabled=True, |
| 131 | wfc_enabled=True, |
| 132 | nw_gen=RAT_NR, |
| 133 | wfc_mode=None) |
| 134 | |
| 135 | |
Pratik Sheth | 8ad702b | 2021-03-05 09:44:49 -0800 | [diff] [blame] | 136 | @test_tracker_info(uuid="425b16ec-869d-4a0b-a1bc-a3243503525f") |
Pratik Sheth | 078fd35 | 2021-02-18 10:54:21 -0800 | [diff] [blame] | 137 | @TelephonyBaseTest.tel_test_wrap |
| 138 | def test_5g_nsa_wifi_connected_toggle_wfc(self): |
| 139 | """Test for WiFi Calling settings: |
| 140 | nsa 5G + VoLTE Disabled + WiFi Connected, Toggling WFC |
| 141 | |
| 142 | Steps: |
| 143 | 1. Setup DUT Idle, nsa 5G network type, VoLTE disabled. |
| 144 | 2. Make sure DUT WiFi connected, WFC disabled. |
| 145 | 3. Set DUT WFC enabled (WiFi Preferred), verify DUT WFC available, |
| 146 | report iwlan rat. |
| 147 | 4. Set DUT WFC disabled, verify DUT WFC unavailable, |
| 148 | not report iwlan rat. |
| 149 | |
| 150 | Expected Results: |
| 151 | 3. DUT WiFi Calling feature bit return True, network rat is iwlan. |
| 152 | 4. DUT WiFi Calling feature bit return False, network rat is not iwlan. |
| 153 | """ |
| 154 | |
| 155 | if not phone_setup_csfb(self.log, self.dut): |
| 156 | self.log.error("Phone Failed to setup Properly") |
| 157 | return False |
| 158 | |
| 159 | if not provision_device_for_5g(self.log, self.dut): |
| 160 | return False |
| 161 | |
| 162 | if not change_ims_setting(log=self.log, |
| 163 | ad=self.dut, |
| 164 | dut_client= self.dut_client, |
| 165 | wifi_network_ssid=self.wifi_network_ssid, |
| 166 | wifi_network_pass=self.wifi_network_pass, |
| 167 | dut_capabilities=self.dut_capabilities, |
| 168 | subid=self.subid, |
| 169 | airplane_mode=False, |
| 170 | wifi_enabled=True, |
| 171 | volte_enabled=False, |
| 172 | wfc_enabled=True, |
| 173 | nw_gen=RAT_NR, |
| 174 | wfc_mode=self.default_wfc_mode): |
| 175 | return False |
| 176 | if not change_ims_setting(log=self.log, |
| 177 | ad=self.dut, |
| 178 | dut_client= self.dut_client, |
| 179 | wifi_network_ssid=self.wifi_network_ssid, |
| 180 | wifi_network_pass=self.wifi_network_pass, |
| 181 | dut_capabilities=self.dut_capabilities, |
| 182 | subid=self.subid, |
| 183 | airplane_mode=False, |
| 184 | wifi_enabled=True, |
| 185 | volte_enabled=False, |
| 186 | wfc_enabled=False, |
| 187 | nw_gen=RAT_NR, |
| 188 | wfc_mode=None): |
| 189 | return False |
| 190 | return change_ims_setting(log=self.log, |
| 191 | ad=self.dut, |
| 192 | dut_client= self.dut_client, |
| 193 | wifi_network_ssid=self.wifi_network_ssid, |
| 194 | wifi_network_pass=self.wifi_network_pass, |
| 195 | dut_capabilities=self.dut_capabilities, |
| 196 | subid=self.subid, |
| 197 | airplane_mode=False, |
| 198 | wifi_enabled=True, |
| 199 | volte_enabled=False, |
| 200 | wfc_enabled=True, |
| 201 | nw_gen=RAT_NR, |
| 202 | wfc_mode=None) |
| 203 | |
| 204 | |
Pratik Sheth | 8ad702b | 2021-03-05 09:44:49 -0800 | [diff] [blame] | 205 | @test_tracker_info(uuid="9405d8cf-5b73-4d47-a83d-da115caed177") |
Pratik Sheth | 078fd35 | 2021-02-18 10:54:21 -0800 | [diff] [blame] | 206 | @TelephonyBaseTest.tel_test_wrap |
| 207 | def test_5g_nsa_volte_wfc_enabled_toggle_wifi(self): |
| 208 | """Test for WiFi Calling settings: |
| 209 | nsa 5G + VoLTE Enabled + WFC enabled, Toggling WiFi |
| 210 | |
| 211 | Steps: |
| 212 | 1. Setup DUT Idle, nsa 5G network type, VoLTE enabled. |
| 213 | 2. Make sure DUT WiFi disconnected, WFC enabled (WiFi Preferred). |
| 214 | 3. DUT connect WiFi, verify DUT WFC available, report iwlan rat. |
| 215 | 4. DUT disconnect WiFi,verify DUT WFC unavailable, not report iwlan rat. |
| 216 | |
| 217 | Expected Results: |
| 218 | 3. DUT WiFi Calling feature bit return True, network rat is iwlan. |
| 219 | 4. DUT WiFi Calling feature bit return False, network rat is not iwlan. |
| 220 | """ |
| 221 | if not phone_setup_volte(self.log, self.dut): |
| 222 | self.log.error("Failed to setup VoLTE") |
| 223 | return False |
| 224 | |
| 225 | ads = self.android_devices |
| 226 | if not provision_both_devices_for_5g(self.log, ads): |
| 227 | return False |
| 228 | |
| 229 | if not change_ims_setting(log=self.log, |
| 230 | ad=self.dut, |
| 231 | dut_client= self.dut_client, |
| 232 | wifi_network_ssid=self.wifi_network_ssid, |
| 233 | wifi_network_pass=self.wifi_network_pass, |
| 234 | dut_capabilities=self.dut_capabilities, |
| 235 | subid=self.subid, |
| 236 | airplane_mode=False, |
| 237 | wifi_enabled=True, |
| 238 | volte_enabled=True, |
| 239 | wfc_enabled=True, |
| 240 | nw_gen=RAT_NR, |
| 241 | wfc_mode=self.default_wfc_mode): |
| 242 | return False |
| 243 | if not change_ims_setting(log=self.log, |
| 244 | ad=self.dut, |
| 245 | dut_client= self.dut_client, |
| 246 | wifi_network_ssid=self.wifi_network_ssid, |
| 247 | wifi_network_pass=self.wifi_network_pass, |
| 248 | dut_capabilities=self.dut_capabilities, |
| 249 | subid=self.subid, |
| 250 | airplane_mode=False, |
| 251 | wifi_enabled=True, |
| 252 | volte_enabled=True, |
| 253 | wfc_enabled=False, |
| 254 | nw_gen=RAT_NR, |
| 255 | wfc_mode=None): |
| 256 | return False |
| 257 | return change_ims_setting(log=self.log, |
| 258 | ad=self.dut, |
| 259 | dut_client= self.dut_client, |
| 260 | wifi_network_ssid=self.wifi_network_ssid, |
| 261 | wifi_network_pass=self.wifi_network_pass, |
| 262 | dut_capabilities=self.dut_capabilities, |
| 263 | subid=self.subid, |
| 264 | airplane_mode=False, |
| 265 | wifi_enabled=True, |
| 266 | volte_enabled=True, |
| 267 | wfc_enabled=True, |
| 268 | nw_gen=RAT_NR, |
| 269 | wfc_mode=None) |
| 270 | |
| 271 | |
Pratik Sheth | 8ad702b | 2021-03-05 09:44:49 -0800 | [diff] [blame] | 272 | @test_tracker_info(uuid="548f07a6-74e2-4071-ba41-2acf3cd51752") |
Pratik Sheth | 078fd35 | 2021-02-18 10:54:21 -0800 | [diff] [blame] | 273 | @TelephonyBaseTest.tel_test_wrap |
| 274 | def test_5g_nsa_wfc_enabled_toggle_wifi(self): |
| 275 | """Test for WiFi Calling settings: |
| 276 | nsa 5G + VoLTE Disabled + WFC enabled, Toggling WiFi |
| 277 | |
| 278 | Steps: |
| 279 | 1. Setup DUT Idle, nsa 5G network type, VoLTE disabled. |
| 280 | 2. Make sure DUT WiFi disconnected, WFC enabled (WiFi Preferred). |
| 281 | 3. DUT connect WiFi, verify DUT WFC available, report iwlan rat. |
| 282 | 4. DUT disconnect WiFi,verify DUT WFC unavailable, not report iwlan rat. |
| 283 | |
| 284 | Expected Results: |
| 285 | 3. DUT WiFi Calling feature bit return True, network rat is iwlan. |
| 286 | 4. DUT WiFi Calling feature bit return False, network rat is not iwlan. |
| 287 | """ |
| 288 | if not phone_setup_csfb(self.log, self.dut): |
| 289 | self.log.error("Failed to setup CSFB") |
| 290 | return False |
| 291 | |
| 292 | if not provision_device_for_5g(self.log, self.dut): |
| 293 | return False |
| 294 | |
| 295 | if not change_ims_setting(log=self.log, |
| 296 | ad=self.dut, |
| 297 | dut_client= self.dut_client, |
| 298 | wifi_network_ssid=self.wifi_network_ssid, |
| 299 | wifi_network_pass=self.wifi_network_pass, |
| 300 | dut_capabilities=self.dut_capabilities, |
| 301 | subid=self.subid, |
| 302 | airplane_mode=False, |
| 303 | wifi_enabled=True, |
| 304 | volte_enabled=False, |
| 305 | wfc_enabled=True, |
| 306 | nw_gen=RAT_NR, |
| 307 | wfc_mode=self.default_wfc_mode): |
| 308 | return False |
| 309 | if not change_ims_setting(log=self.log, |
| 310 | ad=self.dut, |
| 311 | dut_client= self.dut_client, |
| 312 | wifi_network_ssid=self.wifi_network_ssid, |
| 313 | wifi_network_pass=self.wifi_network_pass, |
| 314 | dut_capabilities=self.dut_capabilities, |
| 315 | subid=self.subid, |
| 316 | airplane_mode=False, |
| 317 | wifi_enabled=False, |
| 318 | volte_enabled=False, |
| 319 | wfc_enabled=True, |
| 320 | nw_gen=RAT_NR, |
| 321 | wfc_mode=None): |
| 322 | return False |
| 323 | return change_ims_setting(log=self.log, |
| 324 | ad=self.dut, |
| 325 | dut_client= self.dut_client, |
| 326 | wifi_network_ssid=self.wifi_network_ssid, |
| 327 | wifi_network_pass=self.wifi_network_pass, |
| 328 | dut_capabilities=self.dut_capabilities, |
| 329 | subid=self.subid, |
| 330 | airplane_mode=False, |
| 331 | wifi_enabled=True, |
| 332 | volte_enabled=False, |
| 333 | wfc_enabled=True, |
| 334 | nw_gen=RAT_NR, |
| 335 | wfc_mode=None) |
| 336 | |
| 337 | |
Pratik Sheth | 8ad702b | 2021-03-05 09:44:49 -0800 | [diff] [blame] | 338 | @test_tracker_info(uuid="f53f8403-b993-4a3b-8d3f-ffc87cdc856e") |
Pratik Sheth | 078fd35 | 2021-02-18 10:54:21 -0800 | [diff] [blame] | 339 | @TelephonyBaseTest.tel_test_wrap |
| 340 | def test_5g_nsa_wfc_enabled_wifi_connected_toggle_volte(self): |
| 341 | """Test for WiFi Calling settings: |
| 342 | nsa 5G + VoLTE Enabled + WiFi Connected + WFC enabled, toggle VoLTE setting |
| 343 | |
| 344 | Steps: |
| 345 | 1. Setup DUT Idle, 5G network type, VoLTE enabled. |
| 346 | 2. Make sure DUT WiFi connected, WFC enabled (WiFi Preferred). |
| 347 | Verify DUT WFC available, report iwlan rat. |
| 348 | 3. Disable VoLTE on DUT, verify in 2 minutes period, |
| 349 | DUT does not lost WiFi Calling, DUT still report WFC available, |
| 350 | rat iwlan. |
| 351 | 4. Enable VoLTE on DUT, verify in 2 minutes period, |
| 352 | DUT does not lost WiFi Calling, DUT still report WFC available, |
| 353 | rat iwlan. |
| 354 | |
| 355 | Expected Results: |
| 356 | 2. DUT WiFi Calling feature bit return True, network rat is iwlan. |
| 357 | 3. DUT WiFi Calling feature bit return True, network rat is iwlan. |
| 358 | 4. DUT WiFi Calling feature bit return True, network rat is iwlan. |
| 359 | """ |
| 360 | if not phone_setup_volte(self.log, self.dut): |
| 361 | self.dut.log.error("Phone Failed to setup properly") |
| 362 | return False |
| 363 | |
| 364 | if not provision_device_for_5g(self.log, self.dut): |
| 365 | return False |
| 366 | |
| 367 | if not change_ims_setting(log=self.log, |
| 368 | ad=self.dut, |
| 369 | dut_client= self.dut_client, |
| 370 | wifi_network_ssid=self.wifi_network_ssid, |
| 371 | wifi_network_pass=self.wifi_network_pass, |
| 372 | dut_capabilities=self.dut_capabilities, |
| 373 | subid=self.subid, |
| 374 | airplane_mode=False, |
| 375 | wifi_enabled=True, |
| 376 | volte_enabled=True, |
| 377 | wfc_enabled=True, |
| 378 | nw_gen=RAT_NR, |
| 379 | wfc_mode=self.default_wfc_mode): |
| 380 | return False |
| 381 | if not change_ims_setting(log=self.log, |
| 382 | ad=self.dut, |
| 383 | dut_client= self.dut_client, |
| 384 | wifi_network_ssid=self.wifi_network_ssid, |
| 385 | wifi_network_pass=self.wifi_network_pass, |
| 386 | dut_capabilities=self.dut_capabilities, |
| 387 | subid=self.subid, |
| 388 | airplane_mode=False, |
| 389 | wifi_enabled=True, |
| 390 | volte_enabled=False, |
| 391 | wfc_enabled=True, |
| 392 | wfc_mode=None): |
| 393 | return False |
| 394 | return change_ims_setting(log=self.log, |
| 395 | ad=self.dut, |
| 396 | dut_client= self.dut_client, |
| 397 | wifi_network_ssid=self.wifi_network_ssid, |
| 398 | wifi_network_pass=self.wifi_network_pass, |
| 399 | dut_capabilities=self.dut_capabilities, |
| 400 | subid=self.subid, |
| 401 | airplane_mode=False, |
| 402 | wifi_enabled=True, |
| 403 | volte_enabled=True, |
| 404 | wfc_enabled=True, |
| 405 | nw_gen=RAT_NR, |
| 406 | wfc_mode=None) |
| 407 | |
| 408 | |
Pratik Sheth | 8ad702b | 2021-03-05 09:44:49 -0800 | [diff] [blame] | 409 | @test_tracker_info(uuid="9d951951-bc04-4db1-85e3-f0980f564fd3") |
Pratik Sheth | 078fd35 | 2021-02-18 10:54:21 -0800 | [diff] [blame] | 410 | @TelephonyBaseTest.tel_test_wrap |
| 411 | def test_5g_nsa_volte_wfc_wifi_preferred_to_cellular_preferred(self): |
| 412 | """Test for WiFi Calling settings: |
| 413 | nsa 5G + VoLTE Enabled + WiFi Connected + WiFi Preferred, |
| 414 | change WFC to Cellular Preferred |
| 415 | |
| 416 | Steps: |
| 417 | 1. Setup DUT Idle, nsa 5G network type, VoLTE enabled. |
| 418 | 2. Make sure DUT WiFi connected, WFC is set to WiFi Preferred. |
| 419 | Verify DUT WFC available, report iwlan rat. |
| 420 | 3. Change WFC setting to Cellular Preferred. |
| 421 | 4. Verify DUT report WFC not available. |
| 422 | |
| 423 | Expected Results: |
| 424 | 2. DUT WiFi Calling feature bit return True, network rat is iwlan. |
| 425 | 4. DUT WiFI Calling feature bit return False, network rat is not iwlan. |
| 426 | """ |
| 427 | if WFC_MODE_WIFI_PREFERRED not in self.dut_wfc_modes: |
| 428 | raise signals.TestSkip("WFC_MODE_WIFI_PREFERRED is not supported") |
| 429 | if WFC_MODE_CELLULAR_PREFERRED not in self.dut_wfc_modes: |
| 430 | raise signals.TestSkip( |
| 431 | "WFC_MODE_CELLULAR_PREFERRED is not supported") |
| 432 | |
| 433 | if not phone_setup_volte(self.log, self.dut): |
| 434 | self.dut.log.error("Phone Failed to setup properly.") |
| 435 | return False |
| 436 | |
| 437 | if not provision_device_for_5g(self.log, self.dut): |
| 438 | return False |
| 439 | |
| 440 | if not change_ims_setting(log=self.log, |
| 441 | ad=self.dut, |
| 442 | dut_client= self.dut_client, |
| 443 | wifi_network_ssid=self.wifi_network_ssid, |
| 444 | wifi_network_pass=self.wifi_network_pass, |
| 445 | dut_capabilities=self.dut_capabilities, |
| 446 | subid=self.subid, |
| 447 | airplane_mode=False, |
| 448 | wifi_enabled=True, |
| 449 | volte_enabled=True, |
| 450 | wfc_enabled=True, |
| 451 | nw_gen=RAT_NR, |
| 452 | wfc_mode=self.default_wfc_mode): |
| 453 | return False |
| 454 | return change_ims_setting(log=self.log, |
| 455 | ad=self.dut, |
| 456 | dut_client= self.dut_client, |
| 457 | wifi_network_ssid=self.wifi_network_ssid, |
| 458 | wifi_network_pass=self.wifi_network_pass, |
| 459 | dut_capabilities=self.dut_capabilities, |
| 460 | subid=self.subid, |
| 461 | airplane_mode=False, |
| 462 | wifi_enabled=True, |
| 463 | volte_enabled=True, |
| 464 | wfc_enabled=True, |
| 465 | nw_gen=RAT_NR, |
| 466 | wfc_mode= WFC_MODE_CELLULAR_PREFERRED) |
| 467 | |
| 468 | |
Pratik Sheth | 8ad702b | 2021-03-05 09:44:49 -0800 | [diff] [blame] | 469 | @test_tracker_info(uuid="9d951951-bc04-4db1-85e3-f0980f564fd3") |
Pratik Sheth | 078fd35 | 2021-02-18 10:54:21 -0800 | [diff] [blame] | 470 | @TelephonyBaseTest.tel_test_wrap |
| 471 | def test_5g_nsa_wfc_wifi_preferred_to_cellular_preferred(self): |
| 472 | """Test for WiFi Calling settings: |
| 473 | nsa 5G + WiFi Connected + WiFi Preferred, change WFC to Cellular Preferred |
| 474 | |
| 475 | Steps: |
| 476 | 1. Setup DUT Idle, nsa 5G network type, VoLTE disabled. |
| 477 | 2. Make sure DUT WiFi connected, WFC is set to WiFi Preferred. |
| 478 | Verify DUT WFC available, report iwlan rat. |
| 479 | 3. Change WFC setting to Cellular Preferred. |
| 480 | 4. Verify DUT report WFC not available. |
| 481 | |
| 482 | Expected Results: |
| 483 | 2. DUT WiFi Calling feature bit return True, network rat is iwlan. |
| 484 | 4. DUT WiFI Calling feature bit return False, network rat is not iwlan. |
| 485 | """ |
| 486 | if WFC_MODE_WIFI_PREFERRED not in self.dut_wfc_modes: |
| 487 | raise signals.TestSkip("WFC_MODE_WIFI_PREFERRED is not supported") |
| 488 | if WFC_MODE_CELLULAR_PREFERRED not in self.dut_wfc_modes: |
| 489 | raise signals.TestSkip( |
| 490 | "WFC_MODE_CELLULAR_PREFERRED is not supported") |
| 491 | |
| 492 | if not phone_setup_csfb(self.log, self.dut): |
| 493 | self.dut.log.error("Failed to setup properly") |
| 494 | return False |
| 495 | |
| 496 | if not provision_device_for_5g(self.log, self.dut): |
| 497 | return False |
| 498 | |
| 499 | if not change_ims_setting(log=self.log, |
| 500 | ad=self.dut, |
| 501 | dut_client= self.dut_client, |
| 502 | wifi_network_ssid=self.wifi_network_ssid, |
| 503 | wifi_network_pass=self.wifi_network_pass, |
| 504 | dut_capabilities=self.dut_capabilities, |
| 505 | subid=self.subid, |
| 506 | airplane_mode=False, |
| 507 | wifi_enabled=True, |
| 508 | volte_enabled=False, |
| 509 | wfc_enabled=True, |
| 510 | nw_gen=RAT_NR, |
| 511 | wfc_mode= WFC_MODE_WIFI_PREFERRED): |
| 512 | return False |
| 513 | return change_ims_setting(log=self.log, |
| 514 | ad=self.dut, |
| 515 | dut_client= self.dut_client, |
| 516 | wifi_network_ssid=self.wifi_network_ssid, |
| 517 | wifi_network_pass=self.wifi_network_pass, |
| 518 | dut_capabilities=self.dut_capabilities, |
| 519 | subid=self.subid, |
| 520 | airplane_mode=False, |
| 521 | wifi_enabled=True, |
| 522 | volte_enabled=False, |
| 523 | wfc_enabled=True, |
| 524 | nw_gen=RAT_NR, |
| 525 | wfc_mode= WFC_MODE_CELLULAR_PREFERRED) |
| 526 | |
| 527 | |
Pratik Sheth | 8ad702b | 2021-03-05 09:44:49 -0800 | [diff] [blame] | 528 | @test_tracker_info(uuid="bb3acfce-1ea9-40c2-9151-12fbc235e359") |
Pratik Sheth | 078fd35 | 2021-02-18 10:54:21 -0800 | [diff] [blame] | 529 | @TelephonyBaseTest.tel_test_wrap |
| 530 | def test_5g_nsa_volte_wfc_cellular_preferred_to_wifi_preferred(self): |
| 531 | """Test for WiFi Calling settings: |
| 532 | nsa 5G + VoLTE Enabled + WiFi Connected + Cellular Preferred, |
| 533 | change WFC to WiFi Preferred |
| 534 | |
| 535 | Steps: |
| 536 | 1. Setup DUT Idle, nsa 5G network type, VoLTE enabled. |
| 537 | 2. Make sure DUT WiFi connected, WFC is set to Cellular Preferred. |
| 538 | Verify DUT WFC not available. |
| 539 | 3. Change WFC setting to WiFi Preferred. |
| 540 | 4. Verify DUT report WFC available. |
| 541 | |
| 542 | Expected Results: |
| 543 | 2. DUT WiFi Calling feature bit return False, network rat is not iwlan. |
| 544 | 4. DUT WiFI Calling feature bit return True, network rat is iwlan. |
| 545 | """ |
| 546 | if WFC_MODE_WIFI_PREFERRED not in self.dut_wfc_modes: |
| 547 | raise signals.TestSkip("WFC_MODE_WIFI_PREFERRED is not supported") |
| 548 | if WFC_MODE_CELLULAR_PREFERRED not in self.dut_wfc_modes: |
| 549 | raise signals.TestSkip( |
| 550 | "WFC_MODE_CELLULAR_PREFERRED is not supported") |
| 551 | if not phone_setup_volte(self.log, self.dut): |
| 552 | self.dut.log.error("Phone Failed to setup properly") |
| 553 | return False |
| 554 | |
| 555 | if not provision_device_for_5g(self.log, self.dut): |
| 556 | return False |
| 557 | |
| 558 | if not change_ims_setting(log=self.log, |
| 559 | ad=self.dut, |
| 560 | dut_client= self.dut_client, |
| 561 | wifi_network_ssid=self.wifi_network_ssid, |
| 562 | wifi_network_pass=self.wifi_network_pass, |
| 563 | dut_capabilities=self.dut_capabilities, |
| 564 | subid=self.subid, |
| 565 | airplane_mode=False, |
| 566 | wifi_enabled=True, |
| 567 | volte_enabled=True, |
| 568 | wfc_enabled=True, |
| 569 | nw_gen=RAT_NR, |
| 570 | wfc_mode= WFC_MODE_CELLULAR_PREFERRED): |
| 571 | return False |
| 572 | return change_ims_setting(log=self.log, |
| 573 | ad=self.dut, |
| 574 | dut_client= self.dut_client, |
| 575 | wifi_network_ssid=self.wifi_network_ssid, |
| 576 | wifi_network_pass=self.wifi_network_pass, |
| 577 | dut_capabilities=self.dut_capabilities, |
| 578 | subid=self.subid, |
| 579 | airplane_mode=False, |
| 580 | wifi_enabled=True, |
| 581 | volte_enabled=True, |
| 582 | wfc_enabled=True, |
| 583 | nw_gen=RAT_NR, |
| 584 | wfc_mode=WFC_MODE_WIFI_PREFERRED) |
| 585 | |
| 586 | |
Pratik Sheth | 8ad702b | 2021-03-05 09:44:49 -0800 | [diff] [blame] | 587 | @test_tracker_info(uuid="d4dea8e0-5795-4769-80e2-29c0f951a84a") |
Pratik Sheth | 078fd35 | 2021-02-18 10:54:21 -0800 | [diff] [blame] | 588 | @TelephonyBaseTest.tel_test_wrap |
| 589 | def test_5g_nsa_wfc_cellular_preferred_to_wifi_preferred(self): |
| 590 | """Test for WiFi Calling settings: |
| 591 | nsa 5G + WiFi Connected + Cellular Preferred, change WFC to WiFi Preferred |
| 592 | |
| 593 | Steps: |
| 594 | 1. Setup DUT Idle, nsa 5G network type, VoLTE disabled. |
| 595 | 2. Make sure DUT WiFi connected, WFC is set to Cellular Preferred. |
| 596 | Verify DUT WFC not available. |
| 597 | 3. Change WFC setting to WiFi Preferred. |
| 598 | 4. Verify DUT report WFC available. |
| 599 | |
| 600 | Expected Results: |
| 601 | 2. DUT WiFi Calling feature bit return False, network rat is not iwlan. |
| 602 | 4. DUT WiFI Calling feature bit return True, network rat is iwlan. |
| 603 | """ |
| 604 | if WFC_MODE_WIFI_PREFERRED not in self.dut_wfc_modes: |
| 605 | raise signals.TestSkip("WFC_MODE_WIFI_PREFERRED is not supported") |
| 606 | if WFC_MODE_CELLULAR_PREFERRED not in self.dut_wfc_modes: |
| 607 | raise signals.TestSkip( |
| 608 | "WFC_MODE_CELLULAR_PREFERRED is not supported") |
| 609 | |
| 610 | if not phone_setup_csfb(self.log, self.dut): |
| 611 | self.dut.log.error("Phone Failed to setup properly") |
| 612 | return False |
| 613 | |
| 614 | if not provision_device_for_5g(self.log, self.dut): |
| 615 | return False |
| 616 | |
| 617 | if not change_ims_setting(log=self.log, |
| 618 | ad=self.dut, |
| 619 | dut_client= self.dut_client, |
| 620 | wifi_network_ssid=self.wifi_network_ssid, |
| 621 | wifi_network_pass=self.wifi_network_pass, |
| 622 | dut_capabilities=self.dut_capabilities, |
| 623 | subid=self.subid, |
| 624 | airplane_mode=False, |
| 625 | wifi_enabled=True, |
| 626 | volte_enabled=False, |
| 627 | wfc_enabled=True, |
| 628 | nw_gen=RAT_NR, |
| 629 | wfc_mode=WFC_MODE_CELLULAR_PREFERRED): |
| 630 | return False |
| 631 | return change_ims_setting(log=self.log, |
| 632 | ad=self.dut, |
| 633 | dut_client= self.dut_client, |
| 634 | wifi_network_ssid=self.wifi_network_ssid, |
| 635 | wifi_network_pass=self.wifi_network_pass, |
| 636 | dut_capabilities=self.dut_capabilities, |
| 637 | subid=self.subid, |
| 638 | airplane_mode=False, |
| 639 | wifi_enabled=True, |
| 640 | volte_enabled=False, |
| 641 | wfc_enabled=True, |
| 642 | nw_gen=RAT_NR, |
| 643 | wfc_mode=WFC_MODE_WIFI_PREFERRED) |
| 644 | |
| 645 | |