Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 1 | #!/usr/bin/env python3.4 |
| 2 | # |
| 3 | # Copyright 2020 - 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 MMS scenarios |
| 18 | """ |
| 19 | |
| 20 | import time |
| 21 | |
| 22 | from acts.test_decorators import test_tracker_info |
| 23 | from acts_contrib.test_utils.tel.TelephonyBaseTest import TelephonyBaseTest |
| 24 | from acts_contrib.test_utils.tel.tel_defines import WAIT_TIME_ANDROID_STATE_SETTLING |
Pei Huang | 47d6a0b | 2021-04-05 23:35:49 +0800 | [diff] [blame] | 25 | from acts_contrib.test_utils.tel.tel_defines import SMS_OVER_WIFI_PROVIDERS |
Pratik Sheth | aec72b7 | 2021-02-09 15:44:28 -0800 | [diff] [blame] | 26 | from acts_contrib.test_utils.tel.tel_test_utils import call_setup_teardown |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 27 | from acts_contrib.test_utils.tel.tel_test_utils import ensure_phones_idle |
| 28 | from acts_contrib.test_utils.tel.tel_test_utils import ensure_wifi_connected |
Jericho Lee | 4edd59d | 2021-05-12 11:12:16 +0800 | [diff] [blame^] | 29 | from acts_contrib.test_utils.tel.tel_test_utils import ensure_phone_default_state |
| 30 | from acts_contrib.test_utils.tel.tel_test_utils import multithread_func |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 31 | from acts_contrib.test_utils.tel.tel_voice_utils import is_phone_in_call_iwlan |
Pratik Sheth | aec72b7 | 2021-02-09 15:44:28 -0800 | [diff] [blame] | 32 | from acts_contrib.test_utils.tel.tel_voice_utils import is_phone_in_call_volte |
Pei Huang | 47d6a0b | 2021-04-05 23:35:49 +0800 | [diff] [blame] | 33 | from acts_contrib.test_utils.tel.tel_voice_utils import is_phone_in_call_csfb |
Markus Liu | 660218f | 2021-04-29 17:14:07 +0800 | [diff] [blame] | 34 | from acts_contrib.test_utils.tel.tel_5g_test_utils import connect_both_devices_to_wifi |
| 35 | from acts_contrib.test_utils.tel.tel_5g_test_utils import disable_apm_mode_both_devices |
| 36 | from acts_contrib.test_utils.tel.tel_5g_test_utils import provision_device_for_5g |
| 37 | from acts_contrib.test_utils.tel.tel_5g_test_utils import provision_both_devices_for_volte |
| 38 | from acts_contrib.test_utils.tel.tel_5g_test_utils import provision_both_devices_for_wfc_cell_pref |
| 39 | from acts_contrib.test_utils.tel.tel_5g_test_utils import provision_both_devices_for_wfc_wifi_pref |
| 40 | from acts_contrib.test_utils.tel.tel_5g_test_utils import verify_5g_attach_for_both_devices |
| 41 | from acts_contrib.test_utils.tel.tel_5g_test_utils import provision_both_devices_for_csfb |
Jericho Lee | 4edd59d | 2021-05-12 11:12:16 +0800 | [diff] [blame^] | 42 | from acts_contrib.test_utils.tel.tel_5g_utils import is_current_network_5g_nsa |
Pratik Sheth | aec72b7 | 2021-02-09 15:44:28 -0800 | [diff] [blame] | 43 | from acts_contrib.test_utils.tel.tel_mms_utils import _mms_test_mo |
| 44 | from acts_contrib.test_utils.tel.tel_mms_utils import _mms_test_mt |
| 45 | from acts_contrib.test_utils.tel.tel_mms_utils import _long_mms_test_mo |
Pei Huang | 47d6a0b | 2021-04-05 23:35:49 +0800 | [diff] [blame] | 46 | from acts_contrib.test_utils.tel.tel_mms_utils import test_mms_mo_in_call |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 47 | |
Pratik Sheth | 0df9f22 | 2021-04-05 17:55:51 -0700 | [diff] [blame] | 48 | |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 49 | class Nsa5gMmsTest(TelephonyBaseTest): |
| 50 | def setup_class(self): |
| 51 | super().setup_class() |
| 52 | self.number_of_devices = 2 |
| 53 | self.message_lengths = (50, 160, 180) |
| 54 | |
Pei Huang | 47d6a0b | 2021-04-05 23:35:49 +0800 | [diff] [blame] | 55 | is_roaming = False |
| 56 | for ad in self.android_devices: |
| 57 | ad.sms_over_wifi = False |
| 58 | # verizon supports sms over wifi. will add more carriers later |
| 59 | for sub in ad.telephony["subscription"].values(): |
| 60 | if sub["operator"] in SMS_OVER_WIFI_PROVIDERS: |
| 61 | ad.sms_over_wifi = True |
| 62 | if getattr(ad, 'roaming', False): |
| 63 | is_roaming = True |
| 64 | if is_roaming: |
| 65 | # roaming device does not allow message of length 180 |
| 66 | self.message_lengths = (50, 160) |
| 67 | |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 68 | def setup_test(self): |
| 69 | TelephonyBaseTest.setup_test(self) |
| 70 | |
| 71 | def teardown_test(self): |
| 72 | ensure_phones_idle(self.log, self.android_devices) |
| 73 | |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 74 | |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 75 | """ Tests Begin """ |
| 76 | |
Pratik Sheth | f9d0d2b | 2021-03-19 15:38:44 -0700 | [diff] [blame] | 77 | |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 78 | @test_tracker_info(uuid="bc484c2c-8086-42db-94cd-a1e4a35f35cf") |
| 79 | @TelephonyBaseTest.tel_test_wrap |
| 80 | def test_5g_nsa_mms_mo_mt(self): |
| 81 | """Test MMS between two phones in 5g NSA |
| 82 | |
| 83 | Provision devices in 5g NSA |
| 84 | Send and Verify MMS from PhoneA to PhoneB |
| 85 | Verify both devices are still on 5g NSA |
| 86 | |
| 87 | Returns: |
| 88 | True if success. |
| 89 | False if failed. |
| 90 | """ |
| 91 | ads = self.android_devices |
Pratik Sheth | 0df9f22 | 2021-04-05 17:55:51 -0700 | [diff] [blame] | 92 | if not provision_device_for_5g(self.log, ads): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 93 | return False |
| 94 | |
Pratik Sheth | aec72b7 | 2021-02-09 15:44:28 -0800 | [diff] [blame] | 95 | if not _mms_test_mo(self.log, ads): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 96 | return False |
| 97 | |
Jaineel | 78a5715 | 2020-12-08 17:03:00 -0800 | [diff] [blame] | 98 | if not verify_5g_attach_for_both_devices(self.log, ads): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 99 | return False |
| 100 | |
| 101 | self.log.info("PASS - mms test over 5g nsa validated") |
| 102 | return True |
| 103 | |
Pratik Sheth | f9d0d2b | 2021-03-19 15:38:44 -0700 | [diff] [blame] | 104 | |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 105 | @test_tracker_info(uuid="51d42104-cb87-4c9b-9a16-302e246a21dc") |
| 106 | @TelephonyBaseTest.tel_test_wrap |
| 107 | def test_5g_nsa_mms_mo_mt_volte(self): |
| 108 | """Test MMS between two phones with VoLTE on 5G NSA |
| 109 | |
| 110 | Provision devices on VoLTE |
| 111 | Provision devices in 5g NSA |
| 112 | Send and Verify MMS from PhoneA to PhoneB |
| 113 | Verify both devices are still on 5g NSA |
| 114 | |
| 115 | Returns: |
| 116 | True if success. |
| 117 | False if failed. |
| 118 | """ |
| 119 | |
| 120 | ads = self.android_devices |
Jaineel | 78a5715 | 2020-12-08 17:03:00 -0800 | [diff] [blame] | 121 | if not provision_both_devices_for_volte(self.log, ads): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 122 | return False |
| 123 | |
Pratik Sheth | 0df9f22 | 2021-04-05 17:55:51 -0700 | [diff] [blame] | 124 | if not provision_device_for_5g(self.log, ads): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 125 | return False |
| 126 | |
Pratik Sheth | aec72b7 | 2021-02-09 15:44:28 -0800 | [diff] [blame] | 127 | if not _mms_test_mo(self.log, ads): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 128 | return False |
| 129 | |
Jaineel | 78a5715 | 2020-12-08 17:03:00 -0800 | [diff] [blame] | 130 | if not verify_5g_attach_for_both_devices(self.log, ads): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 131 | return False |
| 132 | |
| 133 | self.log.info("PASS - volte mms test over 5g nsa validated") |
| 134 | return True |
| 135 | |
Pratik Sheth | f9d0d2b | 2021-03-19 15:38:44 -0700 | [diff] [blame] | 136 | |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 137 | @test_tracker_info(uuid="97d6b071-aef2-40c1-8245-7be6c31870a6") |
| 138 | @TelephonyBaseTest.tel_test_wrap |
| 139 | def test_5g_nsa_mms_mo_mt_in_call_volte(self): |
| 140 | """ Test MO MMS during a VoLTE call over 5G NSA. |
| 141 | |
| 142 | Provision devices on VoLTE |
| 143 | Provision devices in 5g NSA |
| 144 | Make a Voice call from PhoneA to PhoneB |
| 145 | Send and Verify MMS from PhoneA to PhoneB |
| 146 | Verify both devices are still on 5g NSA |
| 147 | |
| 148 | Returns: |
| 149 | True if pass; False if fail. |
| 150 | """ |
| 151 | ads = self.android_devices |
Jaineel | 78a5715 | 2020-12-08 17:03:00 -0800 | [diff] [blame] | 152 | if not provision_both_devices_for_volte(self.log, ads): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 153 | return False |
| 154 | |
Pratik Sheth | 0df9f22 | 2021-04-05 17:55:51 -0700 | [diff] [blame] | 155 | if not provision_device_for_5g(self.log, ads): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 156 | return False |
| 157 | |
| 158 | self.log.info("Begin Incall mms test.") |
| 159 | if not call_setup_teardown( |
| 160 | self.log, |
| 161 | ads[0], |
| 162 | ads[1], |
| 163 | ad_hangup=None, |
| 164 | verify_caller_func=is_phone_in_call_volte, |
| 165 | verify_callee_func=None): |
| 166 | return False |
| 167 | |
Pratik Sheth | aec72b7 | 2021-02-09 15:44:28 -0800 | [diff] [blame] | 168 | if not _mms_test_mo(self.log, ads): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 169 | return False |
| 170 | |
Jaineel | 78a5715 | 2020-12-08 17:03:00 -0800 | [diff] [blame] | 171 | if not verify_5g_attach_for_both_devices(self.log, ads): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 172 | return False |
| 173 | self.log.info("PASS - Incall volte mms test over 5g nsa validated") |
| 174 | return True |
| 175 | |
| 176 | |
| 177 | @test_tracker_info(uuid="bbb4b80c-fc1b-4377-b3c7-eeed642c5980") |
| 178 | @TelephonyBaseTest.tel_test_wrap |
| 179 | def test_5g_nsa_mms_mo_mt_iwlan(self): |
| 180 | """ Test MMS text function between two phones, |
| 181 | Phones in APM, WiFi connected, WFC Cell Preferred mode. |
| 182 | |
| 183 | Disable APM on both devices |
| 184 | Provision devices in 5g NSA |
| 185 | Provision devices for WFC Cell Pref with APM ON |
| 186 | Send and Verify MMS from PhoneA to PhoneB |
| 187 | |
| 188 | Returns: |
| 189 | True if pass; False if fail. |
| 190 | """ |
| 191 | |
| 192 | ads = self.android_devices |
Jaineel | 78a5715 | 2020-12-08 17:03:00 -0800 | [diff] [blame] | 193 | if not disable_apm_mode_both_devices(self.log, ads): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 194 | return False |
| 195 | |
Pratik Sheth | 0df9f22 | 2021-04-05 17:55:51 -0700 | [diff] [blame] | 196 | if not provision_device_for_5g(self.log, ads): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 197 | return False |
| 198 | |
Jaineel | 78a5715 | 2020-12-08 17:03:00 -0800 | [diff] [blame] | 199 | if not provision_both_devices_for_wfc_cell_pref(self.log, |
| 200 | ads, |
| 201 | self.wifi_network_ssid, |
| 202 | self.wifi_network_pass, |
| 203 | apm_mode=True): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 204 | return False |
| 205 | time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING) |
| 206 | |
Pratik Sheth | aec72b7 | 2021-02-09 15:44:28 -0800 | [diff] [blame] | 207 | if not _mms_test_mo(self.log, ads): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 208 | return False |
| 209 | |
| 210 | self.log.info("PASS - iwlan mms test over 5g nsa validated") |
| 211 | return True |
| 212 | |
| 213 | |
| 214 | @test_tracker_info(uuid="d36d95dc-0973-4711-bb08-c29ce23495e4") |
| 215 | @TelephonyBaseTest.tel_test_wrap |
| 216 | def test_5g_nsa_mms_mo_mt_iwlan_apm_off(self): |
| 217 | """ Test MO MMS, Phone in APM off, WiFi connected, WFC WiFi Pref Mode |
| 218 | |
| 219 | Disable APM on both devices |
| 220 | Provision devices in 5g NSA |
| 221 | Provision devices for WFC Wifi Pref with APM OFF |
| 222 | Send and Verify MMS from PhoneA to PhoneB |
| 223 | Verify 5g NSA attach for both devices |
| 224 | |
| 225 | Returns: |
| 226 | True if pass; False if fail. |
| 227 | """ |
| 228 | |
| 229 | ads = self.android_devices |
Jaineel | 78a5715 | 2020-12-08 17:03:00 -0800 | [diff] [blame] | 230 | if not disable_apm_mode_both_devices(self.log, ads): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 231 | return False |
| 232 | |
Pratik Sheth | 0df9f22 | 2021-04-05 17:55:51 -0700 | [diff] [blame] | 233 | if not provision_device_for_5g(self.log, ads): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 234 | return False |
| 235 | |
Jaineel | 78a5715 | 2020-12-08 17:03:00 -0800 | [diff] [blame] | 236 | if not provision_both_devices_for_wfc_wifi_pref(self.log, |
| 237 | ads, |
| 238 | self.wifi_network_ssid, |
| 239 | self.wifi_network_pass, |
| 240 | apm_mode=False): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 241 | return False |
| 242 | time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING) |
| 243 | |
Pratik Sheth | aec72b7 | 2021-02-09 15:44:28 -0800 | [diff] [blame] | 244 | if not _mms_test_mo(self.log, ads): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 245 | self.log.error("Failed to send receive sms over 5g nsa") |
| 246 | return False |
| 247 | self.log.info("PASS - iwlan mms test over 5g nsa validated") |
| 248 | |
Jaineel | 78a5715 | 2020-12-08 17:03:00 -0800 | [diff] [blame] | 249 | if not verify_5g_attach_for_both_devices(self.log, ads): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 250 | return False |
| 251 | return True |
| 252 | |
| 253 | |
| 254 | @test_tracker_info(uuid="74ffb79e-f1e9-4087-a9d2-e07878e47869") |
| 255 | @TelephonyBaseTest.tel_test_wrap |
| 256 | def test_5g_nsa_mms_mo_mt_in_call_iwlan(self): |
| 257 | """ Test MO MMS, Phone in APM, WiFi connected, WFC WiFi Pref mode |
| 258 | |
| 259 | Disable APM on both devices |
| 260 | Provision devices in 5g NSA |
| 261 | Provision devices for WFC Wifi Pref with APM ON |
| 262 | Make a Voice call from PhoneA to PhoneB |
| 263 | Send and Verify MMS from PhoneA to PhoneB |
| 264 | |
| 265 | Returns: |
| 266 | True if pass; False if fail. |
| 267 | """ |
| 268 | |
| 269 | ads = self.android_devices |
| 270 | |
Jaineel | 78a5715 | 2020-12-08 17:03:00 -0800 | [diff] [blame] | 271 | if not disable_apm_mode_both_devices(self.log, ads): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 272 | return False |
| 273 | |
Pratik Sheth | 0df9f22 | 2021-04-05 17:55:51 -0700 | [diff] [blame] | 274 | if not provision_device_for_5g(self.log, ads): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 275 | return False |
| 276 | |
Jaineel | 78a5715 | 2020-12-08 17:03:00 -0800 | [diff] [blame] | 277 | if not provision_both_devices_for_wfc_wifi_pref(self.log, |
| 278 | ads, |
| 279 | self.wifi_network_ssid, |
| 280 | self.wifi_network_pass, |
| 281 | apm_mode=True): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 282 | return False |
| 283 | time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING) |
| 284 | |
| 285 | self.log.info("Begin Incall mms test") |
| 286 | if not call_setup_teardown( |
| 287 | self.log, |
| 288 | ads[0], |
| 289 | ads[1], |
| 290 | ad_hangup=None, |
| 291 | verify_caller_func=is_phone_in_call_iwlan, |
| 292 | verify_callee_func=None): |
| 293 | return False |
| 294 | |
Pratik Sheth | aec72b7 | 2021-02-09 15:44:28 -0800 | [diff] [blame] | 295 | return _mms_test_mo(self.log, ads) |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 296 | |
Pratik Sheth | f9d0d2b | 2021-03-19 15:38:44 -0700 | [diff] [blame] | 297 | |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 298 | @test_tracker_info(uuid="68c8e0ca-bea4-45e4-92cf-19424ee47ca4") |
| 299 | @TelephonyBaseTest.tel_test_wrap |
| 300 | def test_5g_nsa_mms_mo_mt_in_call_volte_wifi(self): |
| 301 | """ Test MMS during VoLTE call and WiFi connected |
| 302 | |
| 303 | Make sure PhoneA/B are in 5G NSA (with VoLTE). |
| 304 | Make sure PhoneA/B are able to make/receive call. |
| 305 | Connect PhoneA/B to Wifi. |
| 306 | Call from PhoneA to PhoneB, accept on PhoneB, send MMS on PhoneA. |
| 307 | Make sure PhoneA/B are in 5G NSA. |
| 308 | |
| 309 | Returns: |
| 310 | True if pass; False if fail. |
| 311 | """ |
| 312 | ads = self.android_devices |
Jaineel | 78a5715 | 2020-12-08 17:03:00 -0800 | [diff] [blame] | 313 | if not provision_both_devices_for_volte(self.log, ads): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 314 | return False |
| 315 | |
Pratik Sheth | 0df9f22 | 2021-04-05 17:55:51 -0700 | [diff] [blame] | 316 | if not provision_device_for_5g(self.log, ads): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 317 | return False |
| 318 | |
Jaineel | 78a5715 | 2020-12-08 17:03:00 -0800 | [diff] [blame] | 319 | if not connect_both_devices_to_wifi(self.log, |
| 320 | ads, |
| 321 | self.wifi_network_ssid, |
| 322 | self.wifi_network_pass): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 323 | return False |
| 324 | |
| 325 | self.log.info("Begin In Call MMS Test.") |
| 326 | if not call_setup_teardown( |
| 327 | self.log, |
| 328 | ads[0], |
| 329 | ads[1], |
| 330 | ad_hangup=None, |
| 331 | verify_caller_func=is_phone_in_call_volte, |
| 332 | verify_callee_func=None): |
| 333 | return False |
| 334 | |
Pratik Sheth | aec72b7 | 2021-02-09 15:44:28 -0800 | [diff] [blame] | 335 | if not _mms_test_mo(self.log, ads): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 336 | return False |
| 337 | |
Jaineel | 78a5715 | 2020-12-08 17:03:00 -0800 | [diff] [blame] | 338 | if not verify_5g_attach_for_both_devices(self.log, ads): |
Jaineel | 4e4a96a | 2020-12-03 15:11:10 -0800 | [diff] [blame] | 339 | return False |
| 340 | return True |
| 341 | |
Pratik Sheth | f9d0d2b | 2021-03-19 15:38:44 -0700 | [diff] [blame] | 342 | |
Pratik Sheth | 8ad702b | 2021-03-05 09:44:49 -0800 | [diff] [blame] | 343 | @test_tracker_info(uuid="8c795c3a-59d4-408c-9b99-5287e79ba00b") |
Pratik Sheth | aec72b7 | 2021-02-09 15:44:28 -0800 | [diff] [blame] | 344 | @TelephonyBaseTest.tel_test_wrap |
| 345 | def test_5g_nsa_mms_long_message_mo_mt(self): |
| 346 | """Test MMS basic function between two phone. Phones in nsa 5G network. |
| 347 | |
| 348 | Airplane mode is off. Phone in nsa 5G. |
| 349 | Send MMS from PhoneA to PhoneB. |
| 350 | Verify received message on PhoneB is correct. |
| 351 | |
| 352 | Returns: |
| 353 | True if success. |
| 354 | False if failed. |
| 355 | """ |
| 356 | |
| 357 | ads = self.android_devices |
| 358 | |
| 359 | if not disable_apm_mode_both_devices(self.log, ads): |
| 360 | return False |
| 361 | |
Pratik Sheth | 0df9f22 | 2021-04-05 17:55:51 -0700 | [diff] [blame] | 362 | if not provision_device_for_5g(self.log, ads): |
Pratik Sheth | aec72b7 | 2021-02-09 15:44:28 -0800 | [diff] [blame] | 363 | return False |
| 364 | |
| 365 | return _long_mms_test_mo(self.log, ads) |
| 366 | |
Pratik Sheth | f9d0d2b | 2021-03-19 15:38:44 -0700 | [diff] [blame] | 367 | |
Pratik Sheth | 8ad702b | 2021-03-05 09:44:49 -0800 | [diff] [blame] | 368 | @test_tracker_info(uuid="e09b82ab-69a9-4eae-8cbe-b6f2cff993ad") |
Pratik Sheth | aec72b7 | 2021-02-09 15:44:28 -0800 | [diff] [blame] | 369 | @TelephonyBaseTest.tel_test_wrap |
| 370 | def test_5g_nsa_mms_mo_wifi(self): |
| 371 | """Test MMS basic function between two phone. Phones in nsa 5g network. |
| 372 | |
| 373 | Airplane mode is off. Phone in nsa 5G. |
| 374 | Connect to Wifi. |
| 375 | Send MMS from PhoneA to PhoneB. |
| 376 | Verify received message on PhoneB is correct. |
| 377 | |
| 378 | Returns: |
| 379 | True if success. |
| 380 | False if failed. |
| 381 | """ |
| 382 | |
| 383 | ads = self.android_devices |
| 384 | |
| 385 | if not disable_apm_mode_both_devices(self.log, ads): |
| 386 | return False |
| 387 | |
Pratik Sheth | 0df9f22 | 2021-04-05 17:55:51 -0700 | [diff] [blame] | 388 | if not provision_device_for_5g(self.log, ads): |
Pratik Sheth | aec72b7 | 2021-02-09 15:44:28 -0800 | [diff] [blame] | 389 | return False |
| 390 | |
| 391 | ensure_wifi_connected(self.log, ads[0], self.wifi_network_ssid, |
| 392 | self.wifi_network_pass) |
| 393 | |
| 394 | return _mms_test_mo(self.log, ads) |
| 395 | |
Pratik Sheth | f9d0d2b | 2021-03-19 15:38:44 -0700 | [diff] [blame] | 396 | |
Pratik Sheth | 8ad702b | 2021-03-05 09:44:49 -0800 | [diff] [blame] | 397 | @test_tracker_info(uuid="fedae24f-2577-4f84-9d76-53bbbe109d48") |
Pratik Sheth | aec72b7 | 2021-02-09 15:44:28 -0800 | [diff] [blame] | 398 | @TelephonyBaseTest.tel_test_wrap |
| 399 | def test_5g_nsa_mms_mt_wifi(self): |
| 400 | """Test MMS basic function between two phone. Phones in nsa 5g network. |
| 401 | |
| 402 | Airplane mode is off. Phone in nsa 5G. |
| 403 | Connect to Wifi. |
| 404 | Send MMS from PhoneB to PhoneA. |
| 405 | Verify received message on PhoneA is correct. |
| 406 | |
| 407 | Returns: |
| 408 | True if success. |
| 409 | False if failed. |
| 410 | """ |
| 411 | |
| 412 | ads = self.android_devices |
| 413 | |
| 414 | if not disable_apm_mode_both_devices(self.log, ads): |
| 415 | return False |
| 416 | |
Pratik Sheth | 0df9f22 | 2021-04-05 17:55:51 -0700 | [diff] [blame] | 417 | if not provision_device_for_5g(self.log, ads): |
Pratik Sheth | aec72b7 | 2021-02-09 15:44:28 -0800 | [diff] [blame] | 418 | return False |
| 419 | |
| 420 | ensure_wifi_connected(self.log, ads[0], self.wifi_network_ssid, |
| 421 | self.wifi_network_pass) |
| 422 | |
| 423 | return _mms_test_mt(self.log, ads) |
| 424 | |
Pei Huang | 47d6a0b | 2021-04-05 23:35:49 +0800 | [diff] [blame] | 425 | |
Pratik Sheth | 0df9f22 | 2021-04-05 17:55:51 -0700 | [diff] [blame] | 426 | @test_tracker_info(uuid="156bf832-acc2-4729-a69d-b471cd5cfbde") |
Pei Huang | 47d6a0b | 2021-04-05 23:35:49 +0800 | [diff] [blame] | 427 | @TelephonyBaseTest.tel_test_wrap |
| 428 | def test_5g_nsa_mms_mo_mt_in_call_csfb_wifi(self): |
| 429 | """ Test MO/MT MMS during a MO csfb call and devices connect to Wifi. |
| 430 | |
| 431 | Disable APM on both devices |
| 432 | Set up PhoneA/PhoneB are in CSFB mode. |
| 433 | Provision PhoneA/B in 5g NSA. |
| 434 | Make sure PhoneA/B is able to make/receive call. |
| 435 | Connect PhoneA/B to Wifi. |
| 436 | Call from PhoneA to PhoneB, accept on PhoneB, send MMS on PhoneA, |
| 437 | receive MMS on B. |
| 438 | |
| 439 | Returns: |
| 440 | True if pass; False if fail. |
| 441 | """ |
| 442 | ads = self.android_devices |
| 443 | |
| 444 | if not disable_apm_mode_both_devices(self.log, ads): |
| 445 | return False |
| 446 | |
| 447 | if not provision_both_devices_for_csfb(self.log, ads): |
| 448 | return False |
| 449 | time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING) |
| 450 | |
| 451 | if not provision_both_devices_for_5g(self.log, ads): |
| 452 | return False |
| 453 | |
| 454 | if not connect_both_devices_to_wifi(self.log, |
| 455 | ads, |
| 456 | self.wifi_network_ssid, |
| 457 | self.wifi_network_pass): |
| 458 | return False |
| 459 | if not test_mms_mo_in_call(self.log, |
| 460 | ads, |
| 461 | wifi=True, |
| 462 | caller_func=is_phone_in_call_csfb): |
| 463 | return False |
| 464 | |
Jericho Lee | 4edd59d | 2021-05-12 11:12:16 +0800 | [diff] [blame^] | 465 | |
| 466 | @test_tracker_info(uuid="88bd6658-30fa-41b1-b5d9-0f9dadd83219") |
| 467 | @TelephonyBaseTest.tel_test_wrap |
| 468 | def test_5g_nsa_mms_mo_general(self): |
| 469 | """Test MO MMS for 1 phone in 5g NSA. The other phone in any network |
| 470 | |
| 471 | Provision PhoneA in 5g NSA |
| 472 | Send and Verify MMS from PhoneA to PhoneB |
| 473 | Verify phoneA is still on 5g NSA |
| 474 | |
| 475 | Returns: |
| 476 | True if success. |
| 477 | False if failed. |
| 478 | """ |
| 479 | ads = self.android_devices |
| 480 | tasks = [(provision_device_for_5g, (self.log, ads[0])), |
| 481 | (ensure_phone_default_state, (self.log, ads[1]))] |
| 482 | if not multithread_func(self.log, tasks): |
| 483 | return Fals |
| 484 | |
| 485 | if not _mms_test_mo(self.log, ads): |
| 486 | return False |
| 487 | |
| 488 | if not is_current_network_5g_nsa(ads[0]): |
| 489 | return False |
| 490 | |
| 491 | self.log.info("PASS - MO mms test over 5g nsa validated") |
| 492 | return True |
| 493 | |
| 494 | |
| 495 | @test_tracker_info(uuid="11f2e2c8-bb63-43fa-b279-e7bb32f80596") |
| 496 | @TelephonyBaseTest.tel_test_wrap |
| 497 | def test_5g_nsa_mms_mt_general(self): |
| 498 | """Test MT MMS for 1 phone in 5g NSA. The other phone in any network |
| 499 | |
| 500 | Provision PhoneA in 5g NSA |
| 501 | Send and Verify MMS from PhoneB to PhoneA |
| 502 | Verify phoneA is still on 5g NSA |
| 503 | |
| 504 | Returns: |
| 505 | True if success. |
| 506 | False if failed. |
| 507 | """ |
| 508 | ads = self.android_devices |
| 509 | tasks = [(provision_device_for_5g, (self.log, ads[0])), |
| 510 | (ensure_phone_default_state, (self.log, ads[1]))] |
| 511 | if not multithread_func(self.log, tasks): |
| 512 | return False |
| 513 | |
| 514 | if not _mms_test_mt(self.log, ads): |
| 515 | return False |
| 516 | |
| 517 | if not is_current_network_5g_nsa(ads[0]): |
| 518 | return False |
| 519 | |
| 520 | self.log.info("PASS - MT mms test over 5g nsa validated") |
| 521 | return True |
| 522 | |
Pratik Sheth | aec72b7 | 2021-02-09 15:44:28 -0800 | [diff] [blame] | 523 | """ Tests End """ |