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