1#!/usr/bin/env python3
2#
3#   Copyright 2022 - The Android Open Source Project
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
18from acts import asserts
19from acts.test_decorators import test_tracker_info
20from acts.libs.utils.multithread import multithread_func
21from acts_contrib.test_utils.tel.TelephonyBaseTest import TelephonyBaseTest
22from acts_contrib.test_utils.tel.GFTInOutBaseTest import GFTInOutBaseTest
23from acts_contrib.test_utils.tel.loggers.telephony_metric_logger import TelephonyMetricLogger
24from acts_contrib.test_utils.tel.tel_ims_utils import wait_for_ims_registered
25from acts_contrib.test_utils.tel.tel_data_utils import active_file_download_test
26from acts_contrib.test_utils.tel.tel_phone_setup_utils import ensure_phones_idle
27from acts_contrib.test_utils.tel.tel_data_utils import wait_for_cell_data_connection
28from acts_contrib.test_utils.tel.tel_subscription_utils import get_subid_from_slot_index
29from acts_contrib.test_utils.tel.tel_data_utils import wait_for_network_service
30from acts_contrib.test_utils.tel.tel_subscription_utils import set_dds_on_slot
31from acts_contrib.test_utils.tel.tel_subscription_utils import set_message_subid
32from acts_contrib.test_utils.tel.tel_subscription_utils import set_voice_sub_id
33from acts_contrib.test_utils.tel.tel_defines import INVALID_SUB_ID
34
35from acts_contrib.test_utils.tel.gft_inout_utils import mo_voice_call
36from acts_contrib.test_utils.tel.gft_inout_defines import VOICE_CALL
37from acts_contrib.test_utils.tel.gft_inout_defines import VOLTE_CALL
38from acts_contrib.test_utils.tel.gft_inout_defines import CSFB_CALL
39from acts_contrib.test_utils.tel.gft_inout_defines import WFC_CALL
40from acts_contrib.test_utils.tel.gft_inout_defines import NO_SERVICE_POWER_LEVEL
41from acts_contrib.test_utils.tel.gft_inout_defines import IN_SERVICE_POWER_LEVEL
42
43IDLE_CASE = 1
44DATA_TRANSFER_CASE = 2
45DATA_OFF_CASE = 3
46IN_CALL_CASE = 4
47CALL_DATA_CASE = 5
48_VOLTE = "volte"
49
50
51class TelLabGFTDSDSInOutServiceTest(GFTInOutBaseTest):
52    def __init__(self, controllers):
53        GFTInOutBaseTest.__init__(self, controllers)
54        self.my_error_msg = ""
55
56    def teardown_test(self):
57        GFTInOutBaseTest.teardown_class(self)
58        ensure_phones_idle(self.log, self.android_devices)
59
60    def _dsds_in_out_service_test(self,
61                                  case=IDLE_CASE,
62                                  loop=1,
63                                  idle_time=60,
64                                  dds_slot=0,
65                                  voice_slot=0,
66                                  sms_slot=0,
67                                  psim_rat=_VOLTE,
68                                  esim_rat=_VOLTE):
69        '''
70            b/201599180
71            Move UE from coverage area to no service area and UE shows no service
72            Wait for a period of time, then re-enter coverage area
73
74            Args:
75                case: include IDLE_CAS, DATA_TRANSFER_CASE, DATA_OFF_CASE,
76                    IN_CALL_CASE, CALL_DATA_CASE
77                loop: repeat this test cases for how many times
78                idle_time: idle time at no service area
79                dds_slot: Preferred data slot
80                voice_slot: Preferred voice slot
81                sms_slot: Preferred SMS slot
82                psim_rat: RAT on psim
83                esim_rat: RAT on esim
84            Returns:
85                True if pass; False if fail
86            Raises:
87                TestFailure if not success.
88        '''
89        tasks = [(set_dds_on_slot, (ad, dds_slot))
90                 for ad in self.android_devices]
91        if not multithread_func(self.log, tasks):
92            asserts.skip("Fail to to set up DDS")
93        for ad in self.android_devices:
94            voice_sub_id = get_subid_from_slot_index(self.log, ad, voice_slot)
95            if voice_sub_id == INVALID_SUB_ID:
96                asserts.skip("Failed to get sub ID ar slot %s.", voice_slot)
97            else:
98                ad.log.info(
99                    "get_subid_from_slot_index voice_slot=%s. voice_sub_id=%s",
100                    voice_slot, voice_sub_id)
101            if not set_voice_sub_id(ad, voice_sub_id):
102                ad.log.info("Fail to to set voice to slot %s", voice_sub_id)
103            else:
104                ad.log.info("set voice to slot %s", voice_sub_id)
105        tasks = [(set_message_subid, (ad, sms_slot))
106                 for ad in self.android_devices]
107        if multithread_func(self.log, tasks):
108            asserts.skip("Fail to to set up sms to slot %s", sms_slot)
109        else:
110            ad.log.info("set up sms to slot %s", sms_slot)
111
112        for x in range(loop):
113            self.log.info("%s loop: %s/%s", self.current_test_name, x + 1,
114                          loop)
115            if case == IDLE_CASE:
116                asserts.assert_true(
117                    self._dsds_in_out_service_idle_test(idle_time),
118                    "Fail: %s." % ("_dsds_in_out_service_idle_test failure"),
119                    extras={"failure_cause": self.my_error_msg})
120            elif case == DATA_TRANSFER_CASE:
121                asserts.assert_true(
122                    self._dsds_in_out_service_data_transfer_test(idle_time),
123                    "Fail: %s." %
124                    ("_dsds_in_out_service_data_transfer_test failure"),
125                    extras={"failure_cause": self.my_error_msg})
126            elif case == DATA_OFF_CASE:
127                asserts.assert_true(
128                    self._dsds_in_out_service_data_off_test(idle_time),
129                    "Fail: %s." %
130                    ("_dsds_in_out_service_data_off_test failure"),
131                    extras={"failure_cause": self.my_error_msg})
132            elif case == IN_CALL_CASE:
133                asserts.assert_true(
134                    self._dsds_in_out_service_in_call_test(idle_time),
135                    "Fail: %s." %
136                    ("_dsds_in_out_service_in_call_test failure"),
137                    extras={"failure_cause": self.my_error_msg})
138            elif case == CALL_DATA_CASE:
139                asserts.assert_true(
140                    self._dsds_in_out_service_in_call_transfer_test(idle_time),
141                    "Fail: %s." %
142                    ("_dsds_in_out_service_in_call_transfer_test failure"),
143                    extras={"failure_cause": self.my_error_msg})
144
145            tasks = [(wait_for_network_service, (
146                self.log,
147                ad,
148            )) for ad in self.android_devices]
149            if not multithread_func(self.log, tasks):
150                asserts.assert_true(
151                    False,
152                    "Fail: %s." % ("wait_for_network_service failure"),
153                    extras={"failure_cause": self.my_error_msg})
154            tasks = [(self.verify_device_status, (ad, VOICE_CALL))
155                     for ad in self.android_devices]
156            asserts.assert_true(multithread_func(self.log, tasks),
157                                "Fail: %s." % ("verify_device_status failure"),
158                                extras={"failure_cause": self.my_error_msg})
159        return True
160
161    def _dsds_in_out_service_idle_test(self, idle_time=60):
162        '''
163            (1) UE is in idle
164            (2) Move UE from coverage area to no service area and UE shows no service
165            (3) Wait for a period of time, then re-enter coverage area
166
167            Args:
168                idle_time: idle time at no service area
169            Returns:
170                True if pass; False if fail
171        '''
172        return self._in_out_service_idle(idle_time)
173
174    def _dsds_in_out_service_in_call_transfer_test(self, idle_time=60):
175        '''
176            (1) UE is performing data transfer (E.g. Use FTP or browse tools)
177            (2) UE makes a MO call
178            (3) Move UE from coverage area to no service area and UE shows no service
179            (4) Wait for a period of time, then re-enter coverage area
180
181            Args:
182                idle_time: idle time at no service area
183            Returns:
184                True if pass; False if fail
185        '''
186        error_msg = ""
187        tasks_a = [(active_file_download_test, (
188            self.log,
189            ad,
190        )) for ad in self.android_devices]
191        tasks_b = [(mo_voice_call, (self.log, ad, VOICE_CALL, False))
192                   for ad in self.android_devices]
193        tasks_b.extend(tasks_a)
194        if not multithread_func(self.log, tasks_b):
195            error_msg = "fail to perfrom data transfer/voice call"
196            self.my_error_msg += error_msg
197            return False
198        self._in_out_service_idle(idle_time)
199        return True
200
201    def _dsds_in_out_service_in_call_test(self, idle_time=60):
202        '''
203            (1) UE is in call
204            (2) Move UE from coverage area to no service area and UE shows no service
205            (3) Wait for a period of time, then re-enter coverage area
206
207            Args:
208                idle_time: idle time at no service area
209            Returns:
210                True if pass; False if fail
211        '''
212        error_msg = ""
213        tasks = [(mo_voice_call, (self.log, ad, VOICE_CALL, False))
214                 for ad in self.android_devices]
215        if not multithread_func(self.log, tasks):
216            error_msg = "MO voice call fail"
217            self.my_error_msg += error_msg
218            self.log.error(error_msg)
219            return False
220        return self._in_out_service_idle(idle_time)
221
222    def _dsds_in_out_service_data_off_test(self, idle_time=60):
223        '''
224            (1) Disable UE mobile data
225            (2) Move UE from coverage area to no service area and UE shows no service
226            (3) Wait for a period of time, then re-enter coverage area
227
228            Args:
229                idle_time: idle time at no service area
230            Returns:
231                True if pass; False if fail
232        '''
233        for ad in self.android_devices:
234            ad.log.info("Turn off mobile data")
235            ad.droid.telephonyToggleDataConnection(False)
236            if not wait_for_cell_data_connection(self.log, ad, False):
237                self.my_error_msg += "fail to turn off mobile data"
238                return False
239        self._in_out_service_idle(idle_time)
240        for ad in self.android_devices:
241            ad.log.info("Turn on mobile data")
242            ad.droid.telephonyToggleDataConnection(True)
243            #If True, it will wait for status to be DATA_STATE_CONNECTED
244            if not wait_for_cell_data_connection(self.log, ad, True):
245                self.my_error_msg += "fail to turn on mobile data"
246                return False
247        return True
248
249    def _dsds_in_out_service_data_transfer_test(self,
250                                                idle_time=60,
251                                                file_name="10MB"):
252        '''
253            (1) UE is performing data transfer (E.g. Use FTP or browse tools)
254            (2) Move UE from coverage area to no service area and UE shows no service
255            (3) Wait for 1 min, then re-enter coverage area
256
257            Args:
258                idle_time: idle time at no service area
259                file_name:
260            Returns:
261                True if pass; False if fail
262            Raises:
263                TestFailure if not success.
264        '''
265        tasks_a = [(self._in_out_service_idle, (idle_time))]
266        tasks_b = [(active_file_download_test, (self.log, ad, file_name))
267                   for ad in self.android_devices]
268        tasks_b.extend(tasks_a)
269        if not multithread_func(self.log, tasks_b):
270            error_msg = " data transfer fail. "
271            self.my_error_msg += error_msg
272            self.log.error(error_msg)
273        tasks = [(self.verify_device_status, (ad, VOICE_CALL))
274                 for ad in self.android_devices]
275        asserts.assert_true(multithread_func(self.log, tasks),
276                            "Fail: %s." % ("verify_device_status failure"),
277                            extras={"failure_cause": self.my_error_msg})
278        return True
279
280    def _in_out_service_idle(self, idle_time):
281        '''
282            adjust cellular signal
283
284            Args:
285                idle_time: idle time at no service area
286            Returns:
287                True if pass; False if fail
288        '''
289        self.adjust_cellular_signal(NO_SERVICE_POWER_LEVEL)
290        time.sleep(idle_time)
291        self.adjust_cellular_signal(IN_SERVICE_POWER_LEVEL)
292        return True
293
294    @test_tracker_info(uuid="053465d8-a682-404c-a0fb-8e79f6ca581d")
295    @TelephonyBaseTest.tel_test_wrap
296    def test_in_out_idle_msim_4g_esim_4g_dds_sim1_1min(self,
297                                                       loop=50,
298                                                       idle_time=60):
299        '''
300            1.8.17 - [DDS:SIM1][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
301            Stationary idle mode - 1 min
302
303            Args:
304                loop: repeat this test cases for how many times
305                idle_time: idle time at no service area
306            Returns:
307                True if pass; False if fail
308        '''
309        loop = self.user_params.get("4g_dsds_io_cycle", 1)
310        return self._dsds_in_out_service_test(IDLE_CASE, loop, idle_time, 0)
311
312    @test_tracker_info(uuid="1ba35ced-41d1-456d-84e2-a40a0d7402b2")
313    @TelephonyBaseTest.tel_test_wrap
314    def test_in_out_idle_msim_4g_esim_4g_dds_sim2_1min(self,
315                                                       loop=50,
316                                                       idle_time=60):
317        '''
318            1.8.18 - [DDS:SIM2][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
319            Stationary idle mode - 1 min
320
321            Args:
322                loop: repeat this test cases for how many times
323                idle_time: idle time at no service area
324            Returns:
325                True if pass; False if fail
326        '''
327        loop = self.user_params.get("4g_dsds_io_cycle", 1)
328        return self._dsds_in_out_service_test(IDLE_CASE, loop, idle_time, 1)
329
330    @test_tracker_info(uuid="53697dd9-a2f6-4eb5-8b2c-5c9f2a5417ad")
331    @TelephonyBaseTest.tel_test_wrap
332    def test_in_out_idle_msim_4g_esim_4g_dds_sim1_2min(self,
333                                                       loop=1,
334                                                       idle_time=120):
335        '''
336            1.8.19 - [DDS:SIM1][SIM1:VoLTE, SIM2:VoLTE] In/Out service
337            Stationary idle mode - 2 mins
338
339            Args:
340                loop: repeat this test cases for how many times
341                idle_time: idle time at no service area
342            Returns:
343                True if pass; False if fail
344        '''
345        loop = self.user_params.get("4g_dsds_io_cycle", 1)
346        return self._dsds_in_out_service_test(IDLE_CASE, loop, idle_time, 0)
347
348    @test_tracker_info(uuid="f329bb22-c74f-4688-9983-eaf88131a630")
349    @TelephonyBaseTest.tel_test_wrap
350    def test_in_out_idle_msim_4g_esim_4g_dds_sim2_2min(self,
351                                                       loop=1,
352                                                       idle_time=120):
353        '''
354            1.8.20 - [DDS:SIM2][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
355            Stationary idle mode - 2 mins
356
357            Args:
358                loop: repeat this test cases for how many times
359                idle_time: idle time at no service area
360            Returns:
361                True if pass; False if fail
362        '''
363        loop = self.user_params.get("4g_dsds_io_cycle", 1)
364        return self._dsds_in_out_service_test(IDLE_CASE, loop, idle_time, 1)
365
366    @test_tracker_info(uuid="4d8cba59-921b-441c-94dc-8c43a12593ea")
367    @TelephonyBaseTest.tel_test_wrap
368    def test_in_out_idle_msim_4g_esim_4g_dds_sim1_5min(self,
369                                                       loop=1,
370                                                       idle_time=300):
371        '''
372            1.8.21 - [DDS:SIM1][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
373            Stationary idle mode - 5 mins
374
375            Args:
376                loop: repeat this test cases for how many times
377                idle_time: idle time at no service area
378            Returns:
379                True if pass; False if fail
380        '''
381        loop = self.user_params.get("4g_dsds_io_cycle", 1)
382        return self._dsds_in_out_service_test(IDLE_CASE, loop, idle_time, 0)
383
384    @test_tracker_info(uuid="dfb3646f-b21f-41f4-a70b-f7ca93ff56ec")
385    @TelephonyBaseTest.tel_test_wrap
386    def test_in_out_idle_msim_4g_esim_4g_dds_sim2_5min(self,
387                                                       loop=1,
388                                                       idle_time=300):
389        '''
390            1.8.22 - [DDS:SIM2][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
391            Stationary idle mode - 5 mins
392
393            Args:
394                loop: repeat this test cases for how many times
395                idle_time: idle time at no service area
396            Returns:
397                True if pass; False if fail
398        '''
399        loop = self.user_params.get("4g_dsds_io_cycle", 1)
400        return self._dsds_in_out_service_test(IDLE_CASE, loop, idle_time, 1)
401
402    @test_tracker_info(uuid="95e026e1-8f3e-4b9e-8d13-96a2d3be2d23")
403    @TelephonyBaseTest.tel_test_wrap
404    def test_in_out_idle_msim_4g_esim_4g_dds_sim1_10min(
405            self, loop=1, idle_time=600):
406        '''
407            1.8.23 - [DDS:SIM1][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
408            Stationary idle mode - 10 mins
409
410            Args:
411                loop: repeat this test cases for how many times
412                idle_time: idle time at no service area
413            Returns:
414                True if pass; False if fail
415        '''
416        loop = self.user_params.get("4g_dsds_io_cycle", 1)
417        return self._dsds_in_out_service_test(IDLE_CASE, loop, idle_time, 0)
418
419    @test_tracker_info(uuid="935ed9be-94ef-4f46-b742-4bfac16b876d")
420    @TelephonyBaseTest.tel_test_wrap
421    def test_in_out_idle_msim_4g_esim_4g_dds_sim2_10min(
422            self, loop=1, idle_time=600):
423        '''
424            1.8.24 - [DDS:SIM2][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
425            Stationary idle mode - 10 mins
426
427            Args:
428                loop: repeat this test cases for how many times
429                idle_time: idle time at no service area
430            Returns:
431                True if pass; False if fail
432        '''
433        loop = self.user_params.get("4g_dsds_io_cycle", 1)
434        return self._dsds_in_out_service_test(IDLE_CASE, loop, idle_time, 1)
435
436    @test_tracker_info(uuid="919e478e-6ea4-4bdc-b7d8-0252c7fa1510")
437    @TelephonyBaseTest.tel_test_wrap
438    def test_in_out_data_transfer_msim_4g_esim_4g_dds_sim1_1min(
439            self, loop=20, idle_time=60):
440        '''
441            1.8.25 - [DDS:SIM1][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
442            Stationary data transfer - 1 min
443
444            Args:
445                loop: repeat this test cases for how many times
446                idle_time: idle time at no service area
447            Returns:
448                True if pass; False if fail
449        '''
450        loop = self.user_params.get("4g_dsds_io_cycle", 1)
451        return self._dsds_in_out_service_test(DATA_TRANSFER_CASE, loop,
452                                              idle_time, 0)
453
454    @test_tracker_info(uuid="0826b234-7619-4ad9-b1e9-81d4d7e51be4")
455    @TelephonyBaseTest.tel_test_wrap
456    def test_in_out_data_transfer_msim_4g_esim_4g_dds_sim2_1min(
457            self, loop=20, idle_time=60):
458        '''
459            1.8.26 - [DDS:SIM2][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
460            Stationary data transfer - 1 min
461
462            Args:
463                loop: repeat this test cases for how many times
464                idle_time: idle time at no service area
465            Returns:
466                True if pass; False if fail
467        '''
468        loop = self.user_params.get("4g_dsds_io_cycle", 1)
469        return self._dsds_in_out_service_test(DATA_TRANSFER_CASE, loop,
470                                              idle_time, 1)
471
472    @test_tracker_info(uuid="baf5a72d-2a44-416b-b50d-80a4e6d75373")
473    @TelephonyBaseTest.tel_test_wrap
474    def test_in_out_data_transfer_msim_4g_esim_4g_dds_sim1_2min(
475            self, loop=20, idle_time=120):
476        '''
477            1.8.27 - [DDS:SIM1][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
478            Stationary data transfer - 2 mins
479
480            Args:
481                loop: repeat this test cases for how many times
482                idle_time: idle time at no service area
483            Returns:
484                True if pass; False if fail
485        '''
486        loop = self.user_params.get("4g_dsds_io_cycle", 1)
487        return self._dsds_in_out_service_test(DATA_TRANSFER_CASE, loop,
488                                              idle_time, 0)
489
490    @test_tracker_info(uuid="e74bbe30-6ced-4122-8088-3f7f7bcd35d1")
491    @TelephonyBaseTest.tel_test_wrap
492    def test_in_out_data_transfer_msim_4g_esim_4g_dds_sim2_2min(
493            self, loop=20, idle_time=120):
494        '''
495            1.8.28 - [DDS:SIM2][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
496            Stationary data transfer - 2 mins
497
498            Args:
499                loop: repeat this test cases for how many times
500                idle_time: idle time at no service area
501            Returns:
502                True if pass; False if fail
503        '''
504        loop = self.user_params.get("4g_dsds_io_cycle", 1)
505        return self._dsds_in_out_service_test(DATA_TRANSFER_CASE, loop,
506                                              idle_time, 1)
507
508    @test_tracker_info(uuid="d605bdc1-c262-424b-aa05-dd64db0f150d")
509    @TelephonyBaseTest.tel_test_wrap
510    def test_in_out_data_transfer_msim_4g_esim_4g_dds_sim1_5min(
511            self, loop=20, idle_time=300):
512        '''
513            1.8.29 - [DDS:SIM1][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
514            Stationary data transfer - 5 mins
515
516            Args:
517                loop: repeat this test cases for how many times
518                idle_time: idle time at no service area
519            Returns:
520                True if pass; False if fail
521        '''
522        loop = self.user_params.get("4g_dsds_io_cycle", 1)
523        return self._dsds_in_out_service_test(DATA_TRANSFER_CASE, loop,
524                                              idle_time, 0)
525
526    @test_tracker_info(uuid="590f6292-c19e-44f9-9050-8e4ad6ef0047")
527    @TelephonyBaseTest.tel_test_wrap
528    def test_in_out_data_transfer_msim_4g_esim_4g_dds_sim2_5min(
529            self, loop=20, idle_time=300):
530        '''
531            1.8.30 - [DDS:SIM2][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
532            Stationary data transfer - 5 mins
533
534            Args:
535                loop: repeat this test cases for how many times
536                idle_time: idle time at no service area
537            Returns:
538                True if pass; False if fail
539        '''
540        loop = self.user_params.get("4g_dsds_io_cycle", 1)
541        return self._dsds_in_out_service_test(DATA_TRANSFER_CASE, loop,
542                                              idle_time, 1)
543
544    @test_tracker_info(uuid="6d4c631d-d4b1-4974-bcf5-f63d655a43d8")
545    @TelephonyBaseTest.tel_test_wrap
546    def test_in_out_data_transfer_msim_4g_esim_4g_dds_sim1_10min(
547            self, loop=20, idle_time=600):
548        '''
549            1.8.31 - [DDS:SIM1][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
550            Stationary data transfer - 10 mins
551
552            Args:
553                loop: repeat this test cases for how many times
554                idle_time: idle time at no service area
555            Returns:
556                True if pass; False if fail
557        '''
558        loop = self.user_params.get("4g_dsds_io_cycle", 1)
559        return self._dsds_in_out_service_test(DATA_TRANSFER_CASE, loop,
560                                              idle_time, 0)
561
562    @test_tracker_info(uuid="ec4c4b08-d306-4d95-af07-485953afe741")
563    @TelephonyBaseTest.tel_test_wrap
564    def test_in_out_data_transfer_msim_4g_esim_4g_dds_sim2_10min(
565            self, loop=20, idle_time=600):
566        '''
567            1.8.32 - [DDS:SIM2][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
568            Stationary data transfer - 10 mins
569
570            Args:
571                loop: repeat this test cases for how many times
572                idle_time: idle time at no service area
573            Returns:
574                True if pass; False if fail
575        '''
576        loop = self.user_params.get("4g_dsds_io_cycle", 1)
577        return self._dsds_in_out_service_test(DATA_TRANSFER_CASE, loop,
578                                              idle_time, 1)
579
580    @test_tracker_info(uuid="9a3827bd-132b-42de-968d-802b7e2e22cc")
581    @TelephonyBaseTest.tel_test_wrap
582    def test_in_out_data_off_msim_4g_esim_4g_dds_sim1_1min(
583            self, loop=50, idle_time=60):
584        '''
585            1.8.33 - [DDS:SIM1][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
586            Stationary data off - 1 min
587
588            Args:
589                loop: repeat this test cases for how many times
590                idle_time: idle time at no service area
591            Returns:
592                True if pass; False if fail
593        '''
594        loop = self.user_params.get("4g_dsds_io_cycle", 1)
595        return self._dsds_in_out_service_test(DATA_OFF_CASE, loop, idle_time,
596                                              0)
597
598    @test_tracker_info(uuid="4c42e33b-188c-4c62-8def-f47c46a07555")
599    @TelephonyBaseTest.tel_test_wrap
600    def test_in_out_data_off_msim_4g_esim_4g_dds_sim1_2min(
601            self, loop=50, idle_time=120):
602        '''
603            1.8.34 - [DDS:SIM1][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
604            Stationary data off - 2 mins
605
606            Args:
607                loop: repeat this test cases for how many times
608                idle_time: idle time at no service area
609            Returns:
610                True if pass; False if fail
611        '''
612        loop = self.user_params.get("4g_dsds_io_cycle", 1)
613        return self._dsds_in_out_service_test(DATA_OFF_CASE, loop, idle_time,
614                                              0)
615
616    @test_tracker_info(uuid="d40ee1cb-0e63-43f4-8b45-6a3a9bc1fcaa")
617    @TelephonyBaseTest.tel_test_wrap
618    def test_in_out_data_off_msim_4g_esim_4g_dds_sim1_5min(
619            self, loop=10, idle_time=300):
620        '''
621            1.8.35 - [DDS:SIM1][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
622            Stationary data off - 5 mins
623
624            Args:
625                loop: repeat this test cases for how many times
626                idle_time: idle time at no service area
627            Returns:
628                True if pass; False if fail
629        '''
630        loop = self.user_params.get("4g_dsds_io_cycle", 1)
631        return self._dsds_in_out_service_test(DATA_OFF_CASE,
632                                              loop,
633                                              idle_time,
634                                              dds_slot=0)
635
636    @test_tracker_info(uuid="a0bb09bf-36c2-45cc-91d3-5441fd90a2ee")
637    @TelephonyBaseTest.tel_test_wrap
638    def test_in_out_data_off_msim_4g_esim_4g_dds_sim1_10min(
639            self, loop=10, idle_time=600):
640        '''
641            1.8.36 - [DDS:SIM1][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
642            Stationary data off - 10 mins
643
644            Args:
645                loop: repeat this test cases for how many times
646                idle_time: idle time at no service area
647            Returns:
648                True if pass; False if fail
649        '''
650        loop = self.user_params.get("4g_dsds_io_cycle", 1)
651        return self._dsds_in_out_service_test(DATA_OFF_CASE,
652                                              loop,
653                                              idle_time,
654                                              dds_slot=0)
655
656    @test_tracker_info(uuid="d267f0bb-427a-4bed-9d78-20dbc193588f")
657    @TelephonyBaseTest.tel_test_wrap
658    def test_in_out_in_call_msim_4g_esim_4g_dds_sim1_call_sim1_1min(
659            self, loop=10, idle_time=60):
660        '''
661            1.8.37 - [DDS:SIM1][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
662            Stationary incall - 1 min
663
664            Args:
665                loop: repeat this test cases for how many times
666                idle_time: idle time at no service area
667            Returns:
668                True if pass; False if fail
669        '''
670        loop = self.user_params.get("4g_dsds_io_cycle", 1)
671        return self._dsds_in_out_service_test(IN_CALL_CASE,
672                                              loop,
673                                              idle_time,
674                                              dds_slot=0,
675                                              voice_slot=0,
676                                              sms_slot=0)
677
678    @test_tracker_info(uuid="f0fcfc8f-4867-4b3c-94b8-4b406fa4ce8f")
679    @TelephonyBaseTest.tel_test_wrap
680    def test_in_out_in_call_msim_4g_esim_4g_dds_sim2_call_sim2_1min(
681            self, loop=10, idle_time=60):
682        '''
683            1.8.38 - [DDS:SIM2][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
684            Stationary incall - 1 min
685
686            Args:
687                loop: repeat this test cases for how many times
688                idle_time: idle time at no service area
689            Returns:
690                True if pass; False if fail
691        '''
692        loop = self.user_params.get("4g_dsds_io_cycle", 1)
693        return self._dsds_in_out_service_test(IN_CALL_CASE,
694                                              loop,
695                                              idle_time,
696                                              dds_slot=1,
697                                              voice_slot=1,
698                                              sms_slot=1)
699
700    @test_tracker_info(uuid="5f96c891-fdb3-4367-afba-539eeb57ff0f")
701    @TelephonyBaseTest.tel_test_wrap
702    def test_in_out_in_call_msim_4g_esim_4g_dds_sim1_call_sim1_2min(
703            self, loop=10, idle_time=120):
704        '''
705            1.8.39 - [DDS:SIM1][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
706            Stationary incall - 2 mins
707
708            Args:
709                loop: repeat this test cases for how many times
710                idle_time: idle time at no service area
711            Returns:
712                True if pass; False if fail
713        '''
714        loop = self.user_params.get("4g_dsds_io_cycle", 1)
715        return self._dsds_in_out_service_test(IN_CALL_CASE,
716                                              loop,
717                                              idle_time,
718                                              dds_slot=0,
719                                              voice_slot=0,
720                                              sms_slot=0)
721
722    @test_tracker_info(uuid="3920a8b7-492b-4bc4-9b3d-6d7df9861934")
723    @TelephonyBaseTest.tel_test_wrap
724    def test_in_out_in_call_msim_4g_esim_4g_dds_sim2_call_sim2_2min(
725            self, loop=10, idle_time=120):
726        '''
727            1.8.40 - [DDS:SIM2][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
728            Stationary incall - 2 mins
729
730            Args:
731                loop: repeat this test cases for how many times
732                idle_time: idle time at no service area
733            Returns:
734                True if pass; False if fail
735        '''
736        loop = self.user_params.get("4g_dsds_io_cycle", 1)
737        return self._dsds_in_out_service_test(IN_CALL_CASE,
738                                              loop,
739                                              idle_time,
740                                              dds_slot=1,
741                                              voice_slot=1,
742                                              sms_slot=1)
743
744    @test_tracker_info(uuid="b8fac57b-fdf8-48e6-a51f-349a512d2df7")
745    @TelephonyBaseTest.tel_test_wrap
746    def test_in_out_in_call_msim_4g_esim_4g_dds_sim1_call_sim1_5min(
747            self, loop=10, idle_time=300):
748        '''
749            1.8.41 - [DDS:SIM1][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
750            Stationary incall - 5 mins
751
752            Args:
753                loop: repeat this test cases for how many times
754                idle_time: idle time at no service area
755            Returns:
756                True if pass; False if fail
757        '''
758        loop = self.user_params.get("4g_dsds_io_cycle", 1)
759        return self._dsds_in_out_service_test(IN_CALL_CASE,
760                                              loop,
761                                              idle_time,
762                                              dds_slot=0,
763                                              voice_slot=0,
764                                              sms_slot=0)
765
766    @test_tracker_info(uuid="0f0f7749-5cf8-4030-aae5-d28cb3a26d9b")
767    @TelephonyBaseTest.tel_test_wrap
768    def test_in_out_in_call_msim_4g_esim_4g_dds_sim2_call_sim2_5min(
769            self, loop=10, idle_time=300):
770        '''
771            1.8.42 - [DDS:SIM2][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
772            Stationary incall - 5 mins
773
774            Args:
775                loop: repeat this test cases for how many times
776                idle_time: idle time at no service area
777            Returns:
778                True if pass; False if fail
779        '''
780        loop = self.user_params.get("4g_dsds_io_cycle", 1)
781        return self._dsds_in_out_service_test(IN_CALL_CASE,
782                                              loop,
783                                              idle_time,
784                                              dds_slot=1,
785                                              voice_slot=1,
786                                              sms_slot=1)
787
788    @test_tracker_info(uuid="53c8bc90-b9a6-46c7-a412-fe5b9f8df3c3")
789    @TelephonyBaseTest.tel_test_wrap
790    def test_in_out_in_call_msim_4g_esim_4g_dds_sim1_call_sim1_10min(
791            self, loop=10, idle_time=600):
792        '''
793            1.8.43 - [DDS:SIM1][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
794            Stationary incall - 10 mins
795            (1) SIM1 (pSIM): Carrier1, VoLTE
796            (2) SIM2 (eSIM): Carrier2, VoLTE
797            (3) DDS (Data preferred) on SIM1
798            (4) Call/SMS Preference: on SIM1
799            Args:
800                loop: repeat this test cases for how many times
801                idle_time: idle time at no service area
802            Returns:
803                True if pass; False if fail
804        '''
805        loop = self.user_params.get("4g_dsds_io_cycle", 1)
806        return self._dsds_in_out_service_test(IN_CALL_CASE,
807                                              loop,
808                                              idle_time,
809                                              dds_slot=0,
810                                              voice_slot=0,
811                                              sms_slot=0)
812
813    @test_tracker_info(uuid="cff1893e-ea14-4e32-83ae-9116ffd96da4")
814    @TelephonyBaseTest.tel_test_wrap
815    def test_in_out_in_call_msim_4g_esim_4g_dds_sim2_call_sim2_10min(
816            self, loop=10, idle_time=600):
817        '''
818            1.8.44 - [DDS:SIM2][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
819            Stationary incall - 10 mins
820
821            Args:
822                loop: repeat this test cases for how many times
823                idle_time: idle time at no service area
824            Returns:
825                True if pass; False if fail
826        '''
827        loop = self.user_params.get("4g_dsds_io_cycle", 1)
828        return self._dsds_in_out_service_test(IN_CALL_CASE,
829                                              loop,
830                                              idle_time,
831                                              dds_slot=1,
832                                              voice_slot=1,
833                                              sms_slot=1)
834
835    @test_tracker_info(uuid="a73d70d2-d5dd-4901-8cfe-6e54bdd4ddc3")
836    @TelephonyBaseTest.tel_test_wrap
837    def test_in_out_call_data_msim_4g_esim_4g_dds_sim1_call_sim1_1min(
838            self, loop=10, idle_time=60):
839        '''
840            1.8.45 - [DDS:SIM1][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
841            Stationary incall + data transfer - 1 min
842
843            Args:
844                loop: repeat this test cases for how many times
845                idle_time: idle time at no service area
846            Returns:
847                True if pass; False if fail
848        '''
849        loop = self.user_params.get("4g_dsds_io_cycle", 1)
850        return self._dsds_in_out_service_test(CALL_DATA_CASE,
851                                              loop,
852                                              idle_time,
853                                              dds_slot=0,
854                                              voice_slot=0,
855                                              sms_slot=0)
856
857    @test_tracker_info(uuid="6d331e0e-368d-4752-810c-ad497ccb0001")
858    @TelephonyBaseTest.tel_test_wrap
859    def test_in_out_call_data_msim_4g_esim_4g_dds_sim2_call_sim2_1min(
860            self, loop=10, idle_time=60):
861        '''
862            1.8.46 - [DDS:SIM2][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
863            Stationary incall + data transfer - 1 min
864
865            Args:
866                loop: repeat this test cases for how many times
867                idle_time: idle time at no service area
868            Returns:
869                True if pass; False if fail
870        '''
871        loop = self.user_params.get("4g_dsds_io_cycle", 1)
872        return self._dsds_in_out_service_test(CALL_DATA_CASE,
873                                              loop,
874                                              idle_time,
875                                              dds_slot=1,
876                                              voice_slot=1,
877                                              sms_slot=1)
878
879    @test_tracker_info(uuid="2b4c5912-f654-45ad-8195-284c602c194f")
880    @TelephonyBaseTest.tel_test_wrap
881    def test_in_out_call_data_msim_4g_esim_4g_dds_sim1_call_sim1_2min(
882            self, loop=10, idle_time=120):
883        '''
884            1.8.47 - [DDS:SIM1][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
885            Stationary incall + data transfer - 2 mins
886
887            Args:
888                loop: repeat this test cases for how many times
889                idle_time: idle time at no service area
890            Returns:
891                True if pass; False if fail
892        '''
893        loop = self.user_params.get("4g_dsds_io_cycle", 1)
894        return self._dsds_in_out_service_test(CALL_DATA_CASE,
895                                              loop,
896                                              idle_time,
897                                              dds_slot=0,
898                                              voice_slot=0,
899                                              sms_slot=0)
900
901    @test_tracker_info(uuid="d0428b18-6c5b-42d9-96fd-423a0512b95e")
902    @TelephonyBaseTest.tel_test_wrap
903    def test_in_out_call_data_msim_4g_esim_4g_dds_sim2_call_sim2_2min(
904            self, loop=10, idle_time=120):
905        '''
906            1.8.48 - [DDS:SIM2][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
907            Stationary incall + data transfer - 2 mins
908
909            Args:
910                loop: repeat this test cases for how many times
911                idle_time: idle time at no service area
912            Returns:
913                True if pass; False if fail
914        '''
915        loop = self.user_params.get("4g_dsds_io_cycle", 1)
916        return self._dsds_in_out_service_test(CALL_DATA_CASE,
917                                              loop,
918                                              idle_time,
919                                              dds_slot=1,
920                                              voice_slot=1,
921                                              sms_slot=1)
922
923    @test_tracker_info(uuid="66b2ec18-d2f8-46b3-8626-0688f4f7c0dc")
924    @TelephonyBaseTest.tel_test_wrap
925    def test_in_out_call_data_msim_4g_esim_4g_dds_sim1_call_sim1_5min(
926            self, loop=10, idle_time=300):
927        '''
928            1.8.49 - [DDS:SIM1][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
929            Stationary incall + data transfer - 5 mins
930
931            Args:
932                loop: repeat this test cases for how many times
933                idle_time: idle time at no service area
934            Returns:
935                True if pass; False if fail
936        '''
937        loop = self.user_params.get("4g_dsds_io_cycle", 1)
938        return self._dsds_in_out_service_test(CALL_DATA_CASE,
939                                              loop,
940                                              idle_time,
941                                              dds_slot=0,
942                                              voice_slot=0,
943                                              sms_slot=0)
944
945    @test_tracker_info(uuid="4634689f-3ab5-4826-9057-668b0fe15402")
946    @TelephonyBaseTest.tel_test_wrap
947    def test_in_out_call_data_msim_4g_esim_4g_dds_sim2_call_sim2_5min(
948            self, loop=10, idle_time=300):
949        '''
950            1.8.50 - [DDS:SIM2][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
951            Stationary incall + data transfer - 5 mins
952
953            Args:
954                loop: repeat this test cases for how many times
955                idle_time: idle time at no service area
956            Returns:
957                True if pass; False if fail
958        '''
959        loop = self.user_params.get("4g_dsds_io_cycle", 1)
960        return self._dsds_in_out_service_test(CALL_DATA_CASE,
961                                              loop,
962                                              idle_time,
963                                              dds_slot=1,
964                                              voice_slot=1,
965                                              sms_slot=1)
966
967    @test_tracker_info(uuid="5a097f66-dbd4-49d4-957c-d0e9584de36b")
968    @TelephonyBaseTest.tel_test_wrap
969    def test_in_out_call_data_msim_4g_esim_4g_dds_sim1_call_sim1_10min(
970            self, loop=10, idle_time=600):
971        '''
972            1.8.51 - [DDS:SIM1][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
973            Stationary incall + data transfer - 10 mins
974
975            Args:
976                loop: repeat this test cases for how many times
977                idle_time: idle time at no service area
978            Returns:
979                True if pass; False if fail
980        '''
981        loop = self.user_params.get("4g_dsds_io_cycle", 1)
982        return self._dsds_in_out_service_test(CALL_DATA_CASE,
983                                              loop,
984                                              idle_time,
985                                              dds_slot=0,
986                                              voice_slot=0,
987                                              sms_slot=0)
988
989    @test_tracker_info(uuid="d99c0700-27b1-4b0c-881b-ccf908a70287")
990    @TelephonyBaseTest.tel_test_wrap
991    def test_in_out_call_data_msim_4g_esim_4g_dds_sim2_call_sim2_10min(
992            self, loop=10, idle_time=600):
993        '''
994            1.8.52 - [DDS:SIM2][SIM1:VoLTE, SIM2:VoLTE] In/Out service -
995            Stationary incall + data transfer - 10 mins
996
997            Args:
998                loop: repeat this test cases for how many times
999                idle_time: idle time at no service area
1000            Returns:
1001                True if pass; False if fail
1002        '''
1003        loop = self.user_params.get("4g_dsds_io_cycle", 1)
1004        return self._dsds_in_out_service_test(CALL_DATA_CASE,
1005                                              loop,
1006                                              idle_time,
1007                                              dds_slot=1,
1008                                              voice_slot=1,
1009                                              sms_slot=1)
1010