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