• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python3
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
17import time
18
19from acts.test_decorators import test_tracker_info
20from acts_contrib.test_utils.tel.loggers.telephony_metric_logger import TelephonyMetricLogger
21from acts_contrib.test_utils.tel.tel_defines import SimSlotInfo
22from acts_contrib.test_utils.tel.tel_dsds_utils import dds_switch_during_data_transfer_test
23from acts_contrib.test_utils.tel.tel_dsds_utils import dsds_dds_swap_call_streaming_test
24from acts_contrib.test_utils.tel.tel_dsds_utils import dsds_dds_swap_message_streaming_test
25from acts_contrib.test_utils.tel.tel_defines import YOUTUBE_PACKAGE_NAME
26from acts_contrib.test_utils.tel.tel_phone_setup_utils import ensure_phones_idle
27from acts_contrib.test_utils.tel.TelephonyBaseTest import TelephonyBaseTest
28
29_WAIT_TIME_FOR_MEP_ENABLE_INTERVAL = 60
30_WAIT_TIME_FOR_MEP_ENABLE = 180
31
32
33class Nsa5gDSDSDDSSwitchTest(TelephonyBaseTest):
34    def setup_class(self):
35        TelephonyBaseTest.setup_class(self)
36        self.message_lengths = (50, 160, 180)
37        self.tel_logger = TelephonyMetricLogger.for_test_case()
38        if getattr(self.android_devices[0], 'mep', False):
39            start_time = time.monotonic()
40            timeout = start_time + _WAIT_TIME_FOR_MEP_ENABLE
41            while time.monotonic() < timeout:
42                mep_logs = self.android_devices[0].search_logcat(
43                    "UNSOL_SIM_SLOT_STATUS_CHANGED")
44                if mep_logs:
45                    for mep_log in mep_logs:
46                        if "num_ports=2" in mep_log["log_message"]:
47                            break
48                time.sleep(_WAIT_TIME_FOR_MEP_ENABLE_INTERVAL)
49            else:
50                self.log.warning("Couldn't found MEP enabled logs.")
51
52    def teardown_test(self):
53        self.android_devices[0].force_stop_apk(YOUTUBE_PACKAGE_NAME)
54        ensure_phones_idle(self.log, self.android_devices)
55
56    @test_tracker_info(uuid="0514be56-48b1-4ae9-967f-2326939ef386")
57    @TelephonyBaseTest.tel_test_wrap
58    def test_dds_switch_sms_dds_psim_5g_nsa_volte_esim_5g_nsa_volte(self):
59        """ 5G NSA DDS swap SMS test(Initial DDS is on SIM1).
60
61        1. Make MO/MT SMS via SIM1 when DDS is on SIM1 and idle.
62        2. Switch DDS to SIM2.
63        3. Make MO/MT SMS via SIM2 when DDS is on SIM2 and idle.
64        4. Switch DDS to SIM1, make sure data works fine.
65
66        After Make/Receive SMS will check the dds slot if is attach to the
67        network with assigned RAT successfully and data works fine.
68        """
69        return dsds_dds_swap_message_streaming_test(
70            self.log,
71            self.android_devices,
72            sim_slot=[SimSlotInfo.SLOT_0, SimSlotInfo.SLOT_1],
73            test_rat=["5g_volte", "5g_volte"],
74            test_slot=[
75                SimSlotInfo.SLOT_0,
76                SimSlotInfo.SLOT_1,
77                SimSlotInfo.SLOT_0],
78            init_dds=0,
79            msg_type="SMS",
80            direction="mt",
81            streaming=False)
82
83    @test_tracker_info(uuid="d04fca02-881c-4089-bfdf-b1d84c301ff1")
84    @TelephonyBaseTest.tel_test_wrap
85    def test_dds_switch_sms_non_dds_psim_5g_nsa_volte_esim_5g_nsa_volte(self):
86        """ 5G NSA DDS swap SMS test(Initial DDS is on SIM1).
87
88        1. Make MO/MT SMS via SIM2 when DDS is on SIM1 and idle.
89        2. Switch DDS to SIM2.
90        3. Make MO/MT SMS via SIM1 when DDS is on SIM2 and idle.
91        4. Switch DDS to SIM1, make sure data works fine.
92
93        After Make/Receive SMS will check the dds slot if is attach to the
94        network with assigned RAT successfully and data works fine.
95        """
96        return dsds_dds_swap_message_streaming_test(
97            self.log,
98            self.android_devices,
99            sim_slot=[SimSlotInfo.SLOT_0, SimSlotInfo.SLOT_1],
100            test_rat=["5g_volte", "5g_volte"],
101            test_slot=[
102                SimSlotInfo.SLOT_1,
103                SimSlotInfo.SLOT_0,
104                SimSlotInfo.SLOT_1],
105            init_dds=0,
106            msg_type="SMS",
107            direction="mt",
108            streaming=False)
109
110    @test_tracker_info(uuid="e5562a55-788a-4c33-9b97-8eeb8e412052")
111    @TelephonyBaseTest.tel_test_wrap
112    def test_dds_switch_youtube_sms_dds_psim_5g_nsa_volte_esim_5g_nsa_volte(self):
113        """ 5G NSA DDS swap SMS test(Initial DDS is on SIM1).
114
115        1. Start Youtube streaming.
116        2. Make MO/MT SMS via SIM1 when DDS is on SIM1 and idle.
117        3. Stop Youtube streaming.
118        4. Switch DDS to SIM2.
119        5. Start Youtube streaming.
120        6. Make MO/MT SMS via SIM2 when DDS is on SIM2 and idle.
121        7. Stop Youtube streaming.
122        8. Switch DDS to SIM1, make sure data works fine.
123
124        After Make/Receive SMS will check the dds slot if is attach to the
125        network with assigned RAT successfully and data works fine.
126        """
127        return dsds_dds_swap_message_streaming_test(
128            self.log,
129            self.android_devices,
130            sim_slot=[SimSlotInfo.SLOT_0, SimSlotInfo.SLOT_1],
131            test_rat=["5g_volte", "5g_volte"],
132            test_slot=[
133                SimSlotInfo.SLOT_0,
134                SimSlotInfo.SLOT_1,
135                SimSlotInfo.SLOT_0],
136            init_dds=0,
137            msg_type="SMS",
138            direction="mt",
139            streaming=True)
140
141    @test_tracker_info(uuid="71fb524f-4777-4aa5-aa94-28d6d46dc253")
142    @TelephonyBaseTest.tel_test_wrap
143    def test_dds_switch_youtube_sms_non_dds_psim_5g_nsa_volte_esim_5g_nsa_volte(self):
144        """ 5G NSA DDS swap SMS test(Initial DDS is on SIM1).
145
146        1. Start Youtube streaming.
147        2. Make MO/MT SMS via SIM2 when DDS is on SIM1 and idle.
148        3. Stop Youtube streaming.
149        4. Switch DDS to SIM2.
150        5. Start Youtube streaming.
151        6. Make MO/MT SMS via SIM1 when DDS is on SIM2 and idle.
152        7. Stop Youtube streaming.
153        8. Switch DDS to SIM1, make sure data works fine.
154
155        After Make/Receive SMS will check the dds slot if is attach to the
156        network with assigned RAT successfully and data works fine.
157        """
158        return dsds_dds_swap_message_streaming_test(
159            self.log,
160            self.android_devices,
161            sim_slot=[SimSlotInfo.SLOT_0, SimSlotInfo.SLOT_1],
162            test_rat=["5g_volte", "5g_volte"],
163            test_slot=[
164                SimSlotInfo.SLOT_1,
165                SimSlotInfo.SLOT_0,
166                SimSlotInfo.SLOT_1],
167            init_dds=0,
168            msg_type="SMS",
169            direction="mt",
170            streaming=True)
171
172    @test_tracker_info(uuid="3f7cf6ff-a3ec-471b-8a13-e3035dd791c6")
173    @TelephonyBaseTest.tel_test_wrap
174    def test_dds_switch_mms_dds_psim_5g_nsa_volte_esim_5g_nsa_volte(self):
175        """ 5G NSA DDS swap MMS test(Initial DDS is on SIM1).
176
177        1. Make MO/MT MMS via SIM1 when DDS is on SIM1 and idle.
178        2. Switch DDS to SIM2.
179        3. Make MO/MT MMS via SIM2 when DDS is on SIM2 and idle.
180        4. Switch DDS to SIM1, make sure data works fine.
181
182        After Make/Receive MMS will check the dds slot if is attach to the
183        network with assigned RAT successfully and data works fine.
184        """
185        return dsds_dds_swap_message_streaming_test(
186            self.log,
187            self.android_devices,
188            sim_slot=[SimSlotInfo.SLOT_0, SimSlotInfo.SLOT_1],
189            test_rat=["5g_volte", "5g_volte"],
190            test_slot=[
191                SimSlotInfo.SLOT_0,
192                SimSlotInfo.SLOT_1,
193                SimSlotInfo.SLOT_0],
194            init_dds=0,
195            msg_type="MMS",
196            direction="mt",
197            streaming=False)
198
199    @test_tracker_info(uuid="311205dd-f484-407c-bd4a-93c25a78b02a")
200    @TelephonyBaseTest.tel_test_wrap
201    def test_dds_switch_mms_non_dds_psim_5g_nsa_volte_esim_5g_nsa_volte(self):
202        """ 5G NSA DDS swap MMS test(Initial DDS is on SIM1).
203
204        1. Make MO/MT MMS via SIM2 when DDS is on SIM1 and idle.
205        2. Switch DDS to SIM2.
206        3. Make MO/MT MMS via SIM1 when DDS is on SIM2 and idle.
207        4. Switch DDS to SIM1, make sure data works fine.
208
209        After Make/Receive MMS will check the dds slot if is attach to the
210        network with assigned RAT successfully and data works fine.
211        """
212        return dsds_dds_swap_message_streaming_test(
213            self.log,
214            self.android_devices,
215            sim_slot=[SimSlotInfo.SLOT_0, SimSlotInfo.SLOT_1],
216            test_rat=["5g_volte", "5g_volte"],
217            test_slot=[
218                SimSlotInfo.SLOT_1,
219                SimSlotInfo.SLOT_0,
220                SimSlotInfo.SLOT_1],
221            init_dds=0,
222            msg_type="MMS",
223            direction="mt",
224            streaming=False)
225
226    @test_tracker_info(uuid="d817ee1d-8825-4614-abb1-f813c5f4c7de")
227    @TelephonyBaseTest.tel_test_wrap
228    def test_dds_switch_youtube_mms_dds_psim_5g_nsa_volte_esim_5g_nsa_volte(self):
229        """ 5G NSA DDS swap MMS test(Initial DDS is on SIM1).
230
231        1. Start Youtube streaming.
232        2. Make MO/MT MMS via SIM1 when DDS is on SIM1 and idle.
233        3. Stop Youtube streaming.
234        4. Switch DDS to SIM2.
235        5. Start Youtube streaming.
236        6. Make MO/MT MMS via SIM2 when DDS is on SIM2 and idle.
237        7. Stop Youtube streaming.
238        8. Switch DDS to SIM1, make sure data works fine.
239
240        After Make/Receive MMS will check the dds slot if is attach to the
241        network with assigned RAT successfully and data works fine.
242        """
243        return dsds_dds_swap_message_streaming_test(
244            self.log,
245            self.android_devices,
246            sim_slot=[SimSlotInfo.SLOT_0, SimSlotInfo.SLOT_1],
247            test_rat=["5g_volte", "5g_volte"],
248            test_slot=[
249                SimSlotInfo.SLOT_0,
250                SimSlotInfo.SLOT_1,
251                SimSlotInfo.SLOT_0],
252            init_dds=0,
253            msg_type="MMS",
254            direction="mt",
255            streaming=True)
256
257    @test_tracker_info(uuid="131f68c6-e0b6-41cb-85c5-a2df125e01b3")
258    @TelephonyBaseTest.tel_test_wrap
259    def test_dds_switch_youtube_mms_non_dds_psim_5g_nsa_volte_esim_5g_nsa_volte(self):
260        """ 5G NSA DDS swap MMS test(Initial DDS is on SIM1).
261
262        1. Start Youtube streaming.
263        2. Make MO/MT MMS via SIM2 when DDS is on SIM1 and idle.
264        3. Stop Youtube streaming.
265        4. Switch DDS to SIM2.
266        5. Start Youtube streaming.
267        6. Make MO/MT MMS via SIM1 when DDS is on SIM2 and idle.
268        7. Stop Youtube streaming.
269        8. Switch DDS to SIM1, make sure data works fine.
270
271        After Make/Receive MMS will check the dds slot if is attach to the
272        network with assigned RAT successfully and data works fine.
273        """
274        return dsds_dds_swap_message_streaming_test(
275            self.log,
276            self.android_devices,
277            sim_slot=[SimSlotInfo.SLOT_0, SimSlotInfo.SLOT_1],
278            test_rat=["5g_volte", "5g_volte"],
279            test_slot=[
280                SimSlotInfo.SLOT_1,
281                SimSlotInfo.SLOT_0,
282                SimSlotInfo.SLOT_1],
283            init_dds=0,
284            msg_type="MMS",
285            direction="mt",
286            streaming=True)
287
288    @test_tracker_info(uuid="1c3ba14c-d7f6-4737-8ac2-f55fa3b6cc46")
289    @TelephonyBaseTest.tel_test_wrap
290    def test_dds_switch_voice_psim_mo_5g_nsa_volte_esim_5g_nsa_volte(self):
291        """ 5G NSA DDS swap call test(Initial DDS is on SIM1).
292
293        1. Make MO call via SIM1 when DDS is on SIM1 and idle.
294        2. Switch DDS to SIM2.
295        3. Make MO call via SIM1 when DDS is on SIM2 and idle.
296        4. Switch DDS to SIM1, make sure data works fine.
297
298        After call end will check the dds slot if is attach to the network
299        with assigned RAT successfully and data works fine.
300        """
301        return dsds_dds_swap_call_streaming_test(
302            self.log,
303            self.tel_logger,
304            self.android_devices,
305            sim_slot=[SimSlotInfo.SLOT_0, SimSlotInfo.SLOT_1],
306            test_rat=["5g_volte", "5g_volte"],
307            init_dds=0,
308            test_slot=[
309                SimSlotInfo.SLOT_0,
310                SimSlotInfo.SLOT_0,
311                SimSlotInfo.SLOT_0],
312            direction="mo",
313            duration=30,
314            streaming=False)
315
316    @test_tracker_info(uuid="55c3fbd0-0b8b-4275-81a0-1e1715b66ec1")
317    @TelephonyBaseTest.tel_test_wrap
318    def test_dds_switch_voice_psim_mt_5g_nsa_volte_esim_5g_nsa_volte(self):
319        """ 5G NSA DDS swap call test(Initial DDS is on SIM1).
320
321        1. Receive MT call via SIM1 when DDS is on SIM1 and idle.
322        2. Switch DDS to SIM2.
323        3. Receive MT call via SIM1 when DDS is on SIM2 and idle.
324        4. Switch DDS to SIM1, make sure data works fine.
325
326        After call end will check the dds slot if is attach to the network
327        with assigned RAT successfully and data works fine.
328        """
329        return dsds_dds_swap_call_streaming_test(
330            self.log,
331            self.tel_logger,
332            self.android_devices,
333            sim_slot=[SimSlotInfo.SLOT_0, SimSlotInfo.SLOT_1],
334            test_rat=["5g_volte", "5g_volte"],
335            init_dds=0,
336            test_slot=[
337                SimSlotInfo.SLOT_0,
338                SimSlotInfo.SLOT_0,
339                SimSlotInfo.SLOT_0],
340            direction="mt",
341            duration=30,
342            streaming=False)
343
344    @test_tracker_info(uuid="1359b4a9-7e3e-4b34-b512-4638ab4ab4a7")
345    @TelephonyBaseTest.tel_test_wrap
346    def test_dds_switch_voice_esim_mo_5g_nsa_volte_psim_5g_nsa_volte(self):
347        """ 5G NSA DDS swap call test(Initial DDS is on SIM1).
348
349        1. Make MO call via SIM2 when DDS is on SIM1 and idle.
350        2. Switch DDS to SIM2.
351        3. Make MO call via SIM2 when DDS is on SIM2 and idle.
352        4. Switch DDS to SIM1, make sure data works fine.
353
354        After call end will check the dds slot if is attach to the network
355        with assigned RAT successfully and data works fine.
356        """
357        return dsds_dds_swap_call_streaming_test(
358            self.log,
359            self.tel_logger,
360            self.android_devices,
361            sim_slot=[SimSlotInfo.SLOT_0, SimSlotInfo.SLOT_1],
362            test_rat=["5g_volte", "5g_volte"],
363            init_dds=0,
364            test_slot=[
365                SimSlotInfo.SLOT_1,
366                SimSlotInfo.SLOT_1,
367                SimSlotInfo.SLOT_1],
368            direction="mo",
369            duration=30,
370            streaming=False)
371
372    @test_tracker_info(uuid="f4a290dc-3a8b-4364-8b6e-35275a6b8f92")
373    @TelephonyBaseTest.tel_test_wrap
374    def test_dds_switch_voice_esim_mt_5g_nsa_volte_psim_5g_nsa_volte(self):
375        """ 5G NSA DDS swap call test(Initial DDS is on SIM1).
376
377        1. Receive MT call via SIM2 when DDS is on SIM1 and idle.
378        2. Switch DDS to SIM2.
379        3. Receive MT call via SIM2 when DDS is on SIM2 and idle.
380        4. Switch DDS to SIM1, make sure data works fine.
381
382        After call end will check the dds slot if is attach to the network
383        with assigned RAT successfully and data works fine.
384        """
385        return dsds_dds_swap_call_streaming_test(
386            self.log,
387            self.tel_logger,
388            self.android_devices,
389            sim_slot=[SimSlotInfo.SLOT_0, SimSlotInfo.SLOT_1],
390            test_rat=["5g_volte", "5g_volte"],
391            init_dds=0,
392            test_slot=[
393                SimSlotInfo.SLOT_1,
394                SimSlotInfo.SLOT_1,
395                SimSlotInfo.SLOT_1],
396            direction="mt",
397            duration=30,
398            streaming=False)
399
400    @test_tracker_info(uuid="727a75ef-7277-42fe-8a4b-7b2debe666d9")
401    @TelephonyBaseTest.tel_test_wrap
402    def test_dds_switch_youtube_psim_5g_nsa_volte_esim_5g_nsa_volte(self):
403        return dsds_dds_swap_call_streaming_test(
404            self.log,
405            self.tel_logger,
406            self.android_devices,
407            sim_slot=[SimSlotInfo.SLOT_0, SimSlotInfo.SLOT_1],
408            test_rat=["5g_volte", "5g_volte"],
409            init_dds=0,
410            test_slot=[None, None, None])
411
412    @test_tracker_info(uuid="4ef4626a-11b3-4a09-ac98-2e3d94e54bf7")
413    @TelephonyBaseTest.tel_test_wrap
414    def test_dds_switch_youtube_and_voice_mo_psim_5g_nsa_volte_esim_5g_nsa_volte(self):
415        return dds_switch_during_data_transfer_test(
416            self.log,
417            self.tel_logger,
418            self.android_devices,
419            nw_rat=["5g_volte", "5g_volte"],
420            call_slot=0,
421            call_direction="mo")
422
423    @test_tracker_info(uuid="ef3bc49f-e94f-432b-bb51-4b6008359313")
424    @TelephonyBaseTest.tel_test_wrap
425    def test_dds_switch_youtube_and_voice_mt_psim_5g_nsa_volte_esim_5g_nsa_volte(self):
426        return dds_switch_during_data_transfer_test(
427            self.log,
428            self.tel_logger,
429            self.android_devices,
430            nw_rat=["5g_volte", "5g_volte"],
431            call_slot=0,
432            call_direction="mt")
433
434    @test_tracker_info(uuid="6d913c58-dde5-453d-b9a9-30e76cdac554")
435    @TelephonyBaseTest.tel_test_wrap
436    def test_dds_switch_youtube_and_voice_mo_esim_5g_nsa_volte_psim_5g_nsa_volte(self):
437        return dds_switch_during_data_transfer_test(
438            self.log,
439            self.tel_logger,
440            self.android_devices,
441            nw_rat=["5g_volte", "5g_volte"],
442            call_slot=1,
443            call_direction="mo")
444
445    @test_tracker_info(uuid="df91d2ce-ef5e-4d38-a642-6470ade625c6")
446    @TelephonyBaseTest.tel_test_wrap
447    def test_dds_switch_youtube_and_voice_mt_esim_5g_nsa_volte_psim_5g_nsa_volte(self):
448        return dds_switch_during_data_transfer_test(
449            self.log,
450            self.tel_logger,
451            self.android_devices,
452            nw_rat=["5g_volte", "5g_volte"],
453            call_slot=1,
454            call_direction="mt")
455
456    @test_tracker_info(uuid="4ba86f3c-1de6-4888-a2e5-a5e6079c3886")
457    @TelephonyBaseTest.tel_test_wrap
458    def test_dds_switch_youtube_and_voice_mo_psim_5g_nsa_csfb_esim_5g_nsa_csfb(self):
459        return dds_switch_during_data_transfer_test(
460            self.log,
461            self.tel_logger,
462            self.android_devices,
463            nw_rat=["5g_csfb", "5g_csfb"],
464            call_slot=0,
465            call_direction="mo")
466
467    @test_tracker_info(uuid="aa426eb2-dc7b-4ffe-aaa2-a3204251c131")
468    @TelephonyBaseTest.tel_test_wrap
469    def test_dds_switch_youtube_and_voice_mt_psim_5g_nsa_csfb_esim_5g_nsa_csfb(self):
470        return dds_switch_during_data_transfer_test(
471            self.log,
472            self.tel_logger,
473            self.android_devices,
474            nw_rat=["5g_csfb", "5g_csfb"],
475            call_slot=0,
476            call_direction="mt")
477
478    @test_tracker_info(uuid="854634e8-7a2a-4d14-8269-8f4f463f8f56")
479    @TelephonyBaseTest.tel_test_wrap
480    def test_dds_switch_youtube_and_voice_mo_esim_5g_nsa_csfb_psim_5g_nsa_csfb(self):
481        return dds_switch_during_data_transfer_test(
482            self.log,
483            self.tel_logger,
484            self.android_devices,
485            nw_rat=["5g_csfb", "5g_csfb"],
486            call_slot=1,
487            call_direction="mo")
488
489    @test_tracker_info(uuid="02478b9e-6bf6-4148-bbc4-0cbdf59f1625")
490    @TelephonyBaseTest.tel_test_wrap
491    def test_dds_switch_youtube_and_voice_mt_esim_5g_nsa_csfb_psim_5g_nsa_csfb(self):
492        return dds_switch_during_data_transfer_test(
493            self.log,
494            self.tel_logger,
495            self.android_devices,
496            nw_rat=["5g_csfb", "5g_csfb"],
497            call_slot=1,
498            call_direction="mt")
499
500    # e+e call
501    @test_tracker_info(uuid="82170198-a3c8-46b5-9fee-d4284d69a4c1")
502    @TelephonyBaseTest.tel_test_wrap
503    def test_dds_switch_youtube_esim_port_0_5g_nsa_volte_esim_port_1_5g_nsa_volte(self):
504        """ 5G NSA DDS swap call test(Initial DDS is on esim port 0).
505
506        1. Check HTTP connection when DDS is on esim port 0 and idle.
507        2. Switch DDS to esim port 1.
508        3. Check HTTP connection when DDS is on esim port 1 and idle.
509        4. Switch DDS to esim port 0, make sure data works fine.
510        """
511        return dsds_dds_swap_call_streaming_test(
512            self.log,
513            self.tel_logger,
514            self.android_devices,
515            sim_slot=[SimSlotInfo.SLOT_1, SimSlotInfo.SLOT_2],
516            test_rat=["5g_volte", "5g_volte"],
517            init_dds=1,
518            test_slot=[None, None, None])
519
520    @test_tracker_info(uuid="873dd4cc-0439-483c-94c0-0756d8b7a777")
521    @TelephonyBaseTest.tel_test_wrap
522    def test_dds_switch_voice_esim_port_0_mo_5g_nsa_volte_esim_port_1_5g_nsa_volte(self):
523        """ 5G NSA DDS swap call test(Initial DDS is on esim port 0).
524
525        1. Make MO call via esim port 0 when DDS is on esim port 0 and idle.
526        2. Switch DDS to esim port 1.
527        3. Make MO call via esim port 0 when DDS is on esim port 1 and idle.
528        4. Switch DDS to esim port 0, make sure data works fine.
529
530        After call end will check the dds slot if is attach to the network
531        with assigned RAT successfully and data works fine.
532        """
533        return dsds_dds_swap_call_streaming_test(
534            self.log,
535            self.tel_logger,
536            self.android_devices,
537            sim_slot=[SimSlotInfo.SLOT_1, SimSlotInfo.SLOT_2],
538            test_rat=["5g_volte", "5g_volte"],
539            init_dds=1,
540            test_slot=[
541                SimSlotInfo.SLOT_1,
542                SimSlotInfo.SLOT_1,
543                SimSlotInfo.SLOT_1],
544            direction="mo",
545            duration=30,
546            streaming=False)
547
548    @test_tracker_info(uuid="56b080cf-729b-469c-8738-b69a67eabf6e")
549    @TelephonyBaseTest.tel_test_wrap
550    def test_dds_switch_voice_esim_port_0_mt_5g_nsa_volte_esim_port_1_5g_nsa_volte(self):
551        """ 5G NSA DDS swap call test(Initial DDS is on esim port 0).
552
553        1. Receive MT call via esim port 0 when DDS is on esim port 0 and idle.
554        2. Switch DDS to esim port 1.
555        3. Receive MT call via esim port 0 when DDS is on esim port 1 and idle.
556        4. Switch DDS to esim port 0, make sure data works fine.
557
558        After call end will check the dds slot if is attach to the network
559        with assigned RAT successfully and data works fine.
560        """
561        return dsds_dds_swap_call_streaming_test(
562            self.log,
563            self.tel_logger,
564            self.android_devices,
565            sim_slot=[SimSlotInfo.SLOT_1, SimSlotInfo.SLOT_2],
566            test_rat=["5g_volte", "5g_volte"],
567            init_dds=1,
568            test_slot=[
569                SimSlotInfo.SLOT_1,
570                SimSlotInfo.SLOT_1,
571                SimSlotInfo.SLOT_1],
572            direction="mt",
573            duration=30,
574            streaming=False)
575
576    @test_tracker_info(uuid="bbccecf6-f691-4bde-9c20-56bdd5aeb033")
577    @TelephonyBaseTest.tel_test_wrap
578    def test_dds_switch_voice_esim_port_1_mo_5g_nsa_volte_esim_port_0_5g_nsa_volte(self):
579        """ 5G NSA DDS swap call test(Initial DDS is on esim port 0).
580
581        1. Make MO call via esim port 1 when DDS is on esim port 0 and idle.
582        2. Switch DDS to esim port 1.
583        3. Make MO call via esim port 1 when DDS is on esim port 1 and idle.
584        4. Switch DDS to esim port 0, make sure data works fine.
585
586        After call end will check the dds slot if is attach to the network
587        with assigned RAT successfully and data works fine.
588        """
589        return dsds_dds_swap_call_streaming_test(
590            self.log,
591            self.tel_logger,
592            self.android_devices,
593            sim_slot=[SimSlotInfo.SLOT_1, SimSlotInfo.SLOT_2],
594            test_rat=["5g_volte", "5g_volte"],
595            init_dds=1,
596            test_slot=[
597                SimSlotInfo.SLOT_2,
598                SimSlotInfo.SLOT_2,
599                SimSlotInfo.SLOT_2],
600            direction="mo",
601            duration=30,
602            streaming=False)
603
604    @test_tracker_info(uuid="ce848306-38b7-4479-bf97-8413ec18dee8")
605    @TelephonyBaseTest.tel_test_wrap
606    def test_dds_switch_voice_esim_port_1_mt_5g_nsa_volte_esim_port_0_5g_nsa_volte(self):
607        """ 5G NSA DDS swap call test(Initial DDS is on esim port 0).
608
609        1. Receive MT call via esim port 1 when DDS is on esim port 0 and idle.
610        2. Switch DDS to esim port 1.
611        3. Receive MT call via esim port 1 when DDS is on esim port 1 and idle.
612        4. Switch DDS to esim port 0, make sure data works fine.
613
614        After call end will check the dds slot if is attach to the network
615        with assigned RAT successfully and data works fine.
616        """
617        return dsds_dds_swap_call_streaming_test(
618            self.log,
619            self.tel_logger,
620            self.android_devices,
621            sim_slot=[SimSlotInfo.SLOT_1, SimSlotInfo.SLOT_2],
622            test_rat=["5g_volte", "5g_volte"],
623            init_dds=1,
624            test_slot=[
625                SimSlotInfo.SLOT_2,
626                SimSlotInfo.SLOT_2,
627                SimSlotInfo.SLOT_2],
628            direction="mt",
629            duration=30,
630            streaming=False)
631
632    # e+e message
633    @test_tracker_info(uuid="")
634    @TelephonyBaseTest.tel_test_wrap
635    def test_dds_switch_sms_esim_port_0_mo_5g_nsa_volte_esim_port_1_5g_nsa_volte(self):
636        """ 5G NSA DDS swap SMS test(Initial DDS is on esim_port_0).
637
638        1. Make MO SMS via esim_port_0 when DDS is on esim_port_0 and idle.
639        2. Switch DDS to esim_port_1.
640        3. Make MO SMS via esim_port_0 when DDS is on esim_port_1 and idle.
641        4. Switch DDS to esim_port_0, make sure data works fine.
642
643        After Make SMS will check the dds slot if is attach to the
644        network with assigned RAT successfully and data works fine.
645        """
646        return dsds_dds_swap_message_streaming_test(
647            self.log,
648            self.android_devices,
649            sim_slot=[SimSlotInfo.SLOT_1, SimSlotInfo.SLOT_2],
650            test_rat=["5g_volte", "5g_volte"],
651            test_slot=[
652                SimSlotInfo.SLOT_1,
653                SimSlotInfo.SLOT_1,
654                SimSlotInfo.SLOT_1],
655            init_dds=1,
656            msg_type="SMS",
657            direction="mo",
658            streaming=False)
659
660    @test_tracker_info(uuid="")
661    @TelephonyBaseTest.tel_test_wrap
662    def test_dds_switch_sms_esim_port_0_mt_5g_nsa_volte_esim_port_1_5g_nsa_volte(self):
663        """ 5G NSA DDS swap SMS test(Initial DDS is on esim_port_0).
664
665        1. Make MT SMS via esim_port_0 when DDS is on esim_port_0 and idle.
666        2. Switch DDS to esim_port_1.
667        3. Make MT SMS via esim_port_0 when DDS is on esim_port_1 and idle.
668        4. Switch DDS to esim_port_0, make sure data works fine.
669
670        After Receive SMS will check the dds slot if is attach to the
671        network with assigned RAT successfully and data works fine.
672        """
673        return dsds_dds_swap_message_streaming_test(
674            self.log,
675            self.android_devices,
676            sim_slot=[SimSlotInfo.SLOT_1, SimSlotInfo.SLOT_2],
677            test_rat=["5g_volte", "5g_volte"],
678            test_slot=[
679                SimSlotInfo.SLOT_1,
680                SimSlotInfo.SLOT_1,
681                SimSlotInfo.SLOT_1],
682            init_dds=1,
683            msg_type="SMS",
684            direction="mt",
685            streaming=False)
686
687    @test_tracker_info(uuid="")
688    @TelephonyBaseTest.tel_test_wrap
689    def test_dds_switch_sms_esim_port_1_mo_5g_nsa_volte_esim_port_0_5g_nsa_volte(self):
690        """ 5G NSA DDS swap SMS test(Initial DDS is on esim_port_0).
691
692        1. Make MO SMS via esim_port_1 when DDS is on esim_port_0 and idle.
693        2. Switch DDS to esim_port_1.
694        3. Make MO SMS via esim_port_1 when DDS is on esim_port_1 and idle.
695        4. Switch DDS to esim_port_0, make sure data works fine.
696
697        After Make SMS will check the dds slot if is attach to the
698        network with assigned RAT successfully and data works fine.
699        """
700        return dsds_dds_swap_message_streaming_test(
701            self.log,
702            self.android_devices,
703            sim_slot=[SimSlotInfo.SLOT_1, SimSlotInfo.SLOT_2],
704            test_rat=["5g_volte", "5g_volte"],
705            test_slot=[
706                SimSlotInfo.SLOT_2,
707                SimSlotInfo.SLOT_2,
708                SimSlotInfo.SLOT_2],
709            init_dds=1,
710            msg_type="SMS",
711            direction="mo",
712            streaming=False)
713
714    @test_tracker_info(uuid="")
715    @TelephonyBaseTest.tel_test_wrap
716    def test_dds_switch_sms_esim_port_1_mt_5g_nsa_volte_esim_port_0_5g_nsa_volte(self):
717        """ 5G NSA DDS swap SMS test(Initial DDS is on esim_port_0).
718
719        1. Make MT SMS via esim_port_1 when DDS is on esim_port_0 and idle.
720        2. Switch DDS to esim_port_1.
721        3. Make MT SMS via esim_port_1 when DDS is on esim_port_1 and idle.
722        4. Switch DDS to esim_port_0, make sure data works fine.
723
724        After Make SMS will check the dds slot if is attach to the
725        network with assigned RAT successfully and data works fine.
726        """
727        return dsds_dds_swap_message_streaming_test(
728            self.log,
729            self.android_devices,
730            sim_slot=[SimSlotInfo.SLOT_1, SimSlotInfo.SLOT_2],
731            test_rat=["5g_volte", "5g_volte"],
732            test_slot=[
733                SimSlotInfo.SLOT_2,
734                SimSlotInfo.SLOT_2,
735                SimSlotInfo.SLOT_2],
736            init_dds=1,
737            msg_type="SMS",
738            direction="mt",
739            streaming=False)
740
741    @test_tracker_info(uuid="")
742    @TelephonyBaseTest.tel_test_wrap
743    def test_dds_switch_mms_esim_port_0_mo_5g_nsa_volte_esim_port_1_5g_nsa_volte(self):
744        """ 5G NSA DDS swap MMS test(Initial DDS is on esim_port_0).
745
746        1. Make MO MMS via esim_port_0 when DDS is on esim_port_0 and idle.
747        2. Switch DDS to esim_port_1.
748        3. Make MO MMS via esim_port_0 when DDS is on esim_port_1 and idle.
749        4. Switch DDS to esim_port_0, make sure data works fine.
750
751        After Make MMS will check the dds slot if is attach to the
752        network with assigned RAT successfully and data works fine.
753        """
754        return dsds_dds_swap_message_streaming_test(
755            self.log,
756            self.android_devices,
757            sim_slot=[SimSlotInfo.SLOT_1, SimSlotInfo.SLOT_2],
758            test_rat=["5g_volte", "5g_volte"],
759            test_slot=[
760                SimSlotInfo.SLOT_1,
761                SimSlotInfo.SLOT_1,
762                SimSlotInfo.SLOT_1],
763            init_dds=1,
764            msg_type="MMS",
765            direction="mo",
766            streaming=False)
767
768    @test_tracker_info(uuid="")
769    @TelephonyBaseTest.tel_test_wrap
770    def test_dds_switch_mms_esim_port_0_mt_5g_nsa_volte_esim_port_1_5g_nsa_volte(self):
771        """ 5G NSA DDS swap MMS test(Initial DDS is on esim_port_0).
772
773        1. Make MT MMS via esim_port_0 when DDS is on esim_port_0 and idle.
774        2. Switch DDS to esim_port_1.
775        3. Make MT MMS via esim_port_0 when DDS is on esim_port_1 and idle.
776        4. Switch DDS to esim_port_0, make sure data works fine.
777
778        After Receive MMS will check the dds slot if is attach to the
779        network with assigned RAT successfully and data works fine.
780        """
781        return dsds_dds_swap_message_streaming_test(
782            self.log,
783            self.android_devices,
784            sim_slot=[SimSlotInfo.SLOT_1, SimSlotInfo.SLOT_2],
785            test_rat=["5g_volte", "5g_volte"],
786            test_slot=[
787                SimSlotInfo.SLOT_1,
788                SimSlotInfo.SLOT_1,
789                SimSlotInfo.SLOT_1],
790            init_dds=1,
791            msg_type="MMS",
792            direction="mt",
793            streaming=False)
794
795    @test_tracker_info(uuid="")
796    @TelephonyBaseTest.tel_test_wrap
797    def test_dds_switch_mms_esim_port_1_mo_5g_nsa_volte_esim_port_0_5g_nsa_volte(self):
798        """ 5G NSA DDS swap MMS test(Initial DDS is on esim_port_0).
799
800        1. Make MO MMS via esim_port_1 when DDS is on esim_port_0 and idle.
801        2. Switch DDS to esim_port_1.
802        3. Make MO MMS via esim_port_1 when DDS is on esim_port_1 and idle.
803        4. Switch DDS to esim_port_0, make sure data works fine.
804
805        After Make MMS will check the dds slot if is attach to the
806        network with assigned RAT successfully and data works fine.
807        """
808        return dsds_dds_swap_message_streaming_test(
809            self.log,
810            self.android_devices,
811            sim_slot=[SimSlotInfo.SLOT_1, SimSlotInfo.SLOT_2],
812            test_rat=["5g_volte", "5g_volte"],
813            test_slot=[
814                SimSlotInfo.SLOT_2,
815                SimSlotInfo.SLOT_2,
816                SimSlotInfo.SLOT_2],
817            init_dds=1,
818            msg_type="MMS",
819            direction="mo",
820            streaming=False)
821
822    @test_tracker_info(uuid="")
823    @TelephonyBaseTest.tel_test_wrap
824    def test_dds_switch_mms_esim_port_1_mt_5g_nsa_volte_esim_port_0_5g_nsa_volte(self):
825        """ 5G NSA DDS swap MMS test(Initial DDS is on esim_port_0).
826
827        1. Make MT MMS via esim_port_1 when DDS is on esim_port_0 and idle.
828        2. Switch DDS to esim_port_1.
829        3. Make MT MMS via esim_port_1 when DDS is on esim_port_1 and idle.
830        4. Switch DDS to esim_port_0, make sure data works fine.
831
832        After Make MMS will check the dds slot if is attach to the
833        network with assigned RAT successfully and data works fine.
834        """
835        return dsds_dds_swap_message_streaming_test(
836            self.log,
837            self.android_devices,
838            sim_slot=[SimSlotInfo.SLOT_1, SimSlotInfo.SLOT_2],
839            test_rat=["5g_volte", "5g_volte"],
840            test_slot=[
841                SimSlotInfo.SLOT_2,
842                SimSlotInfo.SLOT_2,
843                SimSlotInfo.SLOT_2],
844            init_dds=1,
845            msg_type="MMS",
846            direction="mt",
847            streaming=False)