• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 NSA MMWAVE MMS scenarios
18"""
19
20from acts.test_decorators import test_tracker_info
21from acts_contrib.test_utils.tel.TelephonyBaseTest import TelephonyBaseTest
22from acts_contrib.test_utils.tel.tel_defines import WFC_MODE_WIFI_PREFERRED
23from acts_contrib.test_utils.tel.tel_defines import WFC_MODE_CELLULAR_PREFERRED
24from acts_contrib.test_utils.tel.tel_message_utils import message_test
25from acts_contrib.test_utils.tel.tel_phone_setup_utils import ensure_phones_idle
26from acts_contrib.test_utils.tel.tel_test_utils import set_phone_silent_mode
27from acts_contrib.test_utils.tel.tel_test_utils import toggle_airplane_mode
28
29
30class Nsa5gMmwMmsTest(TelephonyBaseTest):
31    def setup_class(self):
32        super().setup_class()
33        for ad in self.android_devices:
34            set_phone_silent_mode(self.log, ad, True)
35
36    def setup_test(self):
37        TelephonyBaseTest.setup_test(self)
38
39    def teardown_test(self):
40        ensure_phones_idle(self.log, self.android_devices)
41
42    """ Tests Begin """
43
44    @test_tracker_info(uuid="c6f7483f-6007-4a3b-a02d-5e6ab2b9a742")
45    @TelephonyBaseTest.tel_test_wrap
46    def test_5g_nsa_mmw_mms_mo_mt(self):
47        """Test MMS between two phones in 5g NSA MMW
48
49        Provision devices in 5g NSA MMW
50        Send and Verify MMS from PhoneA to PhoneB
51        Verify both devices are still on 5g NSA MMW
52
53        Returns:
54            True if success.
55            False if failed.
56        """
57        return message_test(self.log,
58                            self.android_devices[0],
59                            self.android_devices[1],
60                            mo_rat='5g_nsa_mmwave',
61                            mt_rat='5g_nsa_mmwave',
62                            msg_type='mms')
63
64    @test_tracker_info(uuid="8e6ed681-d5b8-4503-8262-a16739c66bdb")
65    @TelephonyBaseTest.tel_test_wrap
66    def test_5g_nsa_mmw_mms_mo_general(self):
67        """Test MO MMS for 1 phone in 5g NSA MMW. The other phone in any network
68
69        Provision PhoneA in 5g NSA MMW
70        Send and Verify MMS from PhoneA to PhoneB
71        Verify phoneA is still on 5g NSA MMW
72
73        Returns:
74            True if success.
75            False if failed.
76        """
77        return message_test(self.log,
78                            self.android_devices[0],
79                            self.android_devices[1],
80                            mo_rat='5g_nsa_mmwave',
81                            mt_rat='default',
82                            msg_type='mms')
83
84    @test_tracker_info(uuid="d22ea7fd-6c07-4eb2-a1bf-10b03cab3201")
85    @TelephonyBaseTest.tel_test_wrap
86    def test_5g_nsa_mmw_mms_mt_general(self):
87        """Test MT MMS for 1 phone in 5g NSA MMW. The other phone in any network
88
89        Provision PhoneA in 5g NSA MMW
90        Send and Verify MMS from PhoneB to PhoneA
91        Verify phoneA is still on 5g NSA MMW
92
93        Returns:
94            True if success.
95            False if failed.
96        """
97        return message_test(self.log,
98                            self.android_devices[1],
99                            self.android_devices[0],
100                            mo_rat='default',
101                            mt_rat='5g_nsa_mmwave',
102                            msg_type='mms')
103
104    @test_tracker_info(uuid="897eb961-236d-4b8f-8a84-42f2010c6621")
105    @TelephonyBaseTest.tel_test_wrap
106    def test_5g_nsa_mmw_mms_mo_volte(self):
107        """Test MO MMS for 1 phone with VoLTE on 5G NSA MMW
108
109        Provision PhoneA on VoLTE
110        Provision PhoneA in 5g NSA MMW
111        Send and Verify MMS from PhoneA to PhoneB
112        Verify PhoneA is still on 5g NSA MMW
113
114        Returns:
115            True if success.
116            False if failed.
117        """
118        return message_test(self.log,
119                            self.android_devices[0],
120                            self.android_devices[1],
121                            mo_rat='5g_nsa_mmw_volte',
122                            mt_rat='default',
123                            msg_type='mms')
124
125    @test_tracker_info(uuid="6e185efe-b876-4dcf-9fc2-915039826dbe")
126    @TelephonyBaseTest.tel_test_wrap
127    def test_5g_nsa_mmw_mms_mt_volte(self):
128        """Test MT MMS for 1 phone with VoLTE on 5G NSA MMW
129
130        Provision PhoneA on VoLTE
131        Provision PhoneA in 5g NSA MMW
132        Send and Verify MMS from PhoneB to PhoneA
133        Verify PhoneA is still on 5g NSA MMW
134
135        Returns:
136            True if success.
137            False if failed.
138        """
139        return message_test(self.log,
140                            self.android_devices[1],
141                            self.android_devices[0],
142                            mo_rat='default',
143                            mt_rat='5g_nsa_mmw_volte',
144                            msg_type='mms')
145
146    @test_tracker_info(uuid="900d9913-b35d-4d75-859b-12bb28a35b73")
147    @TelephonyBaseTest.tel_test_wrap
148    def test_5g_nsa_mmw_mms_mo_iwlan(self):
149        """ Test MO MMS text function for 1 phone in APM,
150        WiFi connected, WFC Cell Preferred mode.
151
152        Disable APM on both devices
153        Provision PhoneA in 5g NSA MMW
154        Provision PhoneA for WFC Cell Pref with APM ON
155        Send and Verify MMS from PhoneA to PhoneB
156
157        Returns:
158            True if pass; False if fail.
159        """
160        apm_mode = [
161            toggle_airplane_mode(self.log, ad, False)
162            for ad in self.android_devices
163        ]
164        return message_test(self.log,
165                            self.android_devices[0],
166                            self.android_devices[1],
167                            mo_rat='5g_nsa_mmw_wfc',
168                            mt_rat='default',
169                            msg_type='mms',
170                            is_airplane_mode=True,
171                            wfc_mode=WFC_MODE_CELLULAR_PREFERRED,
172                            wifi_ssid=self.wifi_network_ssid,
173                            wifi_pwd=self.wifi_network_pass)
174
175    @test_tracker_info(uuid="939a1ec5-1004-4527-b11e-eacbcfe0f632")
176    @TelephonyBaseTest.tel_test_wrap
177    def test_5g_nsa_mmw_mms_mt_iwlan(self):
178        """ Test MT MMS text function for 1 phone in APM,
179        WiFi connected, WFC Cell Preferred mode.
180
181        Disable APM on both devices
182        Provision PhoneA in 5g NSA MMW
183        Provision PhoneA for WFC Cell Pref with APM ON
184        Send and Verify MMS from PhoneB to PhoneA
185
186        Returns:
187            True if pass; False if fail.
188        """
189        apm_mode = [
190            toggle_airplane_mode(self.log, ad, False)
191            for ad in self.android_devices
192        ]
193        return message_test(self.log,
194                            self.android_devices[1],
195                            self.android_devices[0],
196                            mo_rat='default',
197                            mt_rat='5g_nsa_mmw_wfc',
198                            msg_type='mms',
199                            is_airplane_mode=True,
200                            wfc_mode=WFC_MODE_CELLULAR_PREFERRED,
201                            wifi_ssid=self.wifi_network_ssid,
202                            wifi_pwd=self.wifi_network_pass)
203
204    @test_tracker_info(uuid="253e4966-dd1c-487b-87fc-85b675140b24")
205    @TelephonyBaseTest.tel_test_wrap
206    def test_5g_nsa_mmw_mms_mo_iwlan_apm_off(self):
207        """ Test MO MMS, Phone in APM off, WiFi connected, WFC WiFi Pref Mode
208
209        Disable APM on both devices
210        Provision PhoneA in 5g NSA MMW
211        Provision PhoneA for WFC Wifi Pref with APM OFF
212        Send and Verify MMS from PhoneA to PhoneB
213        Verify 5g NSA MMW attach for PhoneA
214
215        Returns:
216            True if pass; False if fail.
217        """
218        apm_mode = [
219            toggle_airplane_mode(self.log, ad, False)
220            for ad in self.android_devices
221        ]
222        return message_test(self.log,
223                            self.android_devices[0],
224                            self.android_devices[1],
225                            mo_rat='5g_nsa_mmw_wfc',
226                            mt_rat='default',
227                            msg_type='mms',
228                            wfc_mode=WFC_MODE_WIFI_PREFERRED,
229                            wifi_ssid=self.wifi_network_ssid,
230                            wifi_pwd=self.wifi_network_pass)
231
232    @test_tracker_info(uuid="884435c5-47d8-4db9-b89e-087fc344a8b9")
233    @TelephonyBaseTest.tel_test_wrap
234    def test_5g_nsa_mmw_mms_mt_iwlan_apm_off(self):
235        """ Test MT MMS, Phone in APM off, WiFi connected, WFC WiFi Pref Mode
236
237        Disable APM on both devices
238        Provision PhoneA in 5g NSA MMW
239        Provision PhoneA for WFC Wifi Pref with APM OFF
240        Send and Verify MMS from PhoneB to PhoneA
241        Verify 5g NSA MMW attach for PhoneA
242
243        Returns:
244            True if pass; False if fail.
245        """
246        apm_mode = [
247            toggle_airplane_mode(self.log, ad, False)
248            for ad in self.android_devices
249        ]
250        return message_test(self.log,
251                            self.android_devices[1],
252                            self.android_devices[0],
253                            mo_rat='default',
254                            mt_rat='5g_nsa_mmw_wfc',
255                            msg_type='mms',
256                            wfc_mode=WFC_MODE_WIFI_PREFERRED,
257                            wifi_ssid=self.wifi_network_ssid,
258                            wifi_pwd=self.wifi_network_pass)
259
260    @test_tracker_info(uuid="d0085f8f-bb18-4801-8bba-c5d2466922f2")
261    @TelephonyBaseTest.tel_test_wrap
262    def test_5g_nsa_mmw_mms_long_message_mo_mt(self):
263        """Test MMS basic function between two phone. Phones in 5G NSA MMW network.
264
265        Airplane mode is off. Phone in 5G NSA MMW.
266        Send MMS from PhoneA to PhoneB.
267        Verify received message on PhoneB is correct.
268
269        Returns:
270            True if success.
271            False if failed.
272        """
273        return message_test(self.log,
274                            self.android_devices[0],
275                            self.android_devices[1],
276                            mo_rat='5g_nsa_mmwave',
277                            mt_rat='5g_nsa_mmwave',
278                            msg_type='mms',
279                            long_msg=True)
280
281    @test_tracker_info(uuid="f43760c6-b040-46ba-9613-fde4192bf2db")
282    @TelephonyBaseTest.tel_test_wrap
283    def test_5g_nsa_mmw_mms_long_message_mo(self):
284        """Test MO long MMS basic function for 1 phone in 5G NSA MMW network.
285
286        Airplane mode is off. PhoneA in 5G NSA MMW.
287        Send long MMS from PhoneA to PhoneB.
288        Verify received message on PhoneB is correct.
289
290        Returns:
291            True if success.
292            False if failed.
293        """
294        return message_test(self.log,
295                            self.android_devices[0],
296                            self.android_devices[1],
297                            mo_rat='5g_nsa_mmwave',
298                            mt_rat='default',
299                            msg_type='mms',
300                            long_msg=True)
301
302    @test_tracker_info(uuid="dc17e5d2-e022-47af-9b21-cf4e11911e17")
303    @TelephonyBaseTest.tel_test_wrap
304    def test_5g_nsa_mmw_mms_long_message_mt(self):
305        """Test MT long MMS basic function for 1 phone in 5G NSA MMW network.
306
307        Airplane mode is off. PhoneA in nsa 5G NSA MMW.
308        Send long MMS from PhoneB to PhoneA.
309        Verify received message on PhoneA is correct.
310
311        Returns:
312            True if success.
313            False if failed.
314        """
315        return message_test(self.log,
316                            self.android_devices[1],
317                            self.android_devices[0],
318                            mo_rat='default',
319                            mt_rat='5g_nsa_mmwave',
320                            msg_type='mms',
321                            long_msg=True)
322
323    @test_tracker_info(uuid="2a73b511-988c-4a49-857c-5692f6d6cdd6")
324    @TelephonyBaseTest.tel_test_wrap
325    def test_5g_nsa_mmw_mms_mo_wifi(self):
326        """Test MMS basic function between two phone. Phones in nsa 5g network.
327
328        Airplane mode is off. Phone in 5G NSA MMW.
329        Connect to Wifi.
330        Send MMS from PhoneA to PhoneB.
331        Verify received message on PhoneB is correct.
332
333        Returns:
334            True if success.
335            False if failed.
336        """
337        return message_test(self.log,
338                            self.android_devices[0],
339                            self.android_devices[1],
340                            mo_rat='5g_nsa_mmwave',
341                            mt_rat='general',
342                            msg_type='mms',
343                            wifi_ssid=self.wifi_network_ssid,
344                            wifi_pwd=self.wifi_network_pass)
345
346    @test_tracker_info(uuid="58414ce6-851a-4527-8243-502f5a8cfa7a")
347    @TelephonyBaseTest.tel_test_wrap
348    def test_5g_nsa_mmw_mms_mt_wifi(self):
349        """Test MMS basic function between two phone. Phones in nsa 5g network.
350
351        Airplane mode is off. Phone in 5G NSA MMW.
352        Connect to Wifi.
353        Send MMS from PhoneB to PhoneA.
354        Verify received message on PhoneA is correct.
355
356        Returns:
357            True if success.
358            False if failed.
359        """
360        return message_test(self.log,
361                            self.android_devices[1],
362                            self.android_devices[0],
363                            mo_rat='general',
364                            mt_rat='5g_nsa_mmwave',
365                            msg_type='mms',
366                            wifi_ssid=self.wifi_network_ssid,
367                            wifi_pwd=self.wifi_network_pass)
368
369    """ Tests End """
370