1#!/usr/bin/env python3
2#
3#   Copyright 2016 - 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"""
17Sanity tests for voice tests in telephony
18"""
19import time
20
21from acts.test_decorators import test_tracker_info
22from acts.controllers.anritsu_lib._anritsu_utils import AnritsuError
23from acts.controllers.anritsu_lib.md8475a import CsfbType
24from acts.controllers.anritsu_lib.md8475a import MD8475A
25from acts.controllers.anritsu_lib.md8475a import VirtualPhoneAutoAnswer
26from acts.controllers.anritsu_lib.md8475a import VirtualPhoneStatus
27from acts.test_utils.tel.anritsu_utils import WAIT_TIME_ANRITSU_REG_AND_CALL
28from acts.test_utils.tel.anritsu_utils import call_mo_setup_teardown
29from acts.test_utils.tel.anritsu_utils import ims_call_cs_teardown
30from acts.test_utils.tel.anritsu_utils import call_mt_setup_teardown
31from acts.test_utils.tel.anritsu_utils import set_system_model_1x
32from acts.test_utils.tel.anritsu_utils import set_system_model_1x_evdo
33from acts.test_utils.tel.anritsu_utils import set_system_model_gsm
34from acts.test_utils.tel.anritsu_utils import set_system_model_lte
35from acts.test_utils.tel.anritsu_utils import set_system_model_lte_1x
36from acts.test_utils.tel.anritsu_utils import set_system_model_lte_wcdma
37from acts.test_utils.tel.anritsu_utils import set_system_model_lte_gsm
38from acts.test_utils.tel.anritsu_utils import set_system_model_wcdma
39from acts.test_utils.tel.anritsu_utils import set_usim_parameters
40from acts.test_utils.tel.anritsu_utils import set_post_sim_params
41from acts.test_utils.tel.tel_defines import CALL_TEARDOWN_PHONE
42from acts.test_utils.tel.tel_defines import RAT_FAMILY_CDMA2000
43from acts.test_utils.tel.tel_defines import RAT_FAMILY_GSM
44from acts.test_utils.tel.tel_defines import RAT_FAMILY_LTE
45from acts.test_utils.tel.tel_defines import RAT_FAMILY_UMTS
46from acts.test_utils.tel.tel_defines import RAT_1XRTT
47from acts.test_utils.tel.tel_defines import NETWORK_MODE_CDMA
48from acts.test_utils.tel.tel_defines import NETWORK_MODE_GSM_ONLY
49from acts.test_utils.tel.tel_defines import NETWORK_MODE_GSM_UMTS
50from acts.test_utils.tel.tel_defines import NETWORK_MODE_LTE_CDMA_EVDO
51from acts.test_utils.tel.tel_defines import NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA
52from acts.test_utils.tel.tel_defines import NETWORK_MODE_LTE_GSM_WCDMA
53from acts.test_utils.tel.tel_defines import WAIT_TIME_IN_CALL
54from acts.test_utils.tel.tel_defines import WAIT_TIME_IN_CALL_FOR_IMS
55from acts.test_utils.tel.tel_test_utils import ensure_network_rat
56from acts.test_utils.tel.tel_test_utils import ensure_phones_idle
57from acts.test_utils.tel.tel_test_utils import toggle_airplane_mode_by_adb
58from acts.test_utils.tel.tel_test_utils import toggle_volte
59from acts.test_utils.tel.tel_test_utils import set_preferred_apn_by_adb
60from acts.test_utils.tel.tel_test_utils import start_qxdm_loggers
61from acts.test_utils.tel.tel_voice_utils import phone_idle_volte
62from acts.test_utils.tel.TelephonyBaseTest import TelephonyBaseTest
63
64DEFAULT_CALL_NUMBER = "0123456789"
65
66
67class TelLabVoiceTest(TelephonyBaseTest):
68    def setup_class(self):
69        super().setup_class()
70        try:
71            self.stress_test_number = int(
72                self.user_params["stress_test_number"])
73            self.log.info("Executing {} calls per test in stress test mode".
74                          format(self.stress_test_number))
75        except KeyError:
76            self.stress_test_number = 0
77            self.log.info(
78                "No 'stress_test_number' defined: running single iteration tests"
79            )
80
81        self.ad = self.android_devices[0]
82        self.ad.sim_card = getattr(self.ad, "sim_card", None)
83        self.md8475a_ip_address = self.user_params[
84            "anritsu_md8475a_ip_address"]
85        self.wlan_option = self.user_params.get("anritsu_wlan_option", False)
86        self.md8475_version = self.user_params.get("md8475", "A")
87
88        setattr(self, 'voice_call_number', DEFAULT_CALL_NUMBER)
89        if 'voice_call_number' in self.user_params:
90            self.voice_call_number = self.user_params['voice_call_number']
91            self.log.info("Using provided voice call number: {}".format(
92                self.voice_call_number))
93
94        if self.ad.sim_card == "VzW12349":
95            set_preferred_apn_by_adb(self.ad, "VZWINTERNET")
96
97        try:
98            self.anritsu = MD8475A(self.md8475a_ip_address, self.wlan_option,
99                                   self.md8475_version)
100        except AnritsuError:
101            self.log.error("Error in connecting to Anritsu Simulator")
102            return False
103        return True
104
105    def setup_test(self):
106        try:
107            if getattr(self, "qxdm_log", True):
108                start_qxdm_loggers(self.log, self.android_devices)
109            self.ad.droid.telephonyFactoryReset()
110            if self.ad.sim_card == "VzW12349":
111                self.ad.droid.imsSetVolteProvisioning(True)
112        except Exception as e:
113            self.ad.log.error(e)
114        toggle_airplane_mode_by_adb(self.log, self.ad, True)
115        # get a handle to virtual phone
116        self.virtualPhoneHandle = self.anritsu.get_VirtualPhone()
117        return True
118
119    def teardown_test(self):
120        self.log.info("Stopping Simulation")
121        self.anritsu.stop_simulation()
122        toggle_airplane_mode_by_adb(self.log, self.ad, True)
123        return True
124
125    def teardown_class(self):
126        self.anritsu.disconnect()
127        return True
128
129    def _setup_voice_call(self,
130                          set_simulation_func,
131                          phone_setup_func,
132                          phone_idle_func_after_registration=None,
133                          is_ims_call=False,
134                          is_wait_for_registration=True,
135                          csfb_type=None,
136                          srvcc=None,
137                          mo=True,
138                          voice_number=DEFAULT_CALL_NUMBER,
139                          teardown_side=CALL_TEARDOWN_PHONE,
140                          wait_time_in_call=WAIT_TIME_IN_CALL):
141        try:
142            set_simulation_func(self.anritsu, self.user_params,
143                                self.ad.sim_card)
144            set_usim_parameters(self.anritsu, self.ad.sim_card)
145            if is_ims_call or srvcc or csfb_type:
146                set_post_sim_params(self.anritsu, self.user_params,
147                                    self.ad.sim_card)
148            self.virtualPhoneHandle.auto_answer = (VirtualPhoneAutoAnswer.ON,
149                                                   2)
150            if srvcc != None:
151                if srvcc == "Alert":
152                    self.anritsu.send_command("IMSCSCFAUTOANSWER 1,DISABLE")
153                self.anritsu.start_simulation()
154                self.anritsu.send_command("IMSSTARTVN 1")
155                self.anritsu.send_command("IMSSTARTVN 2")
156                self.anritsu.send_command("IMSSTARTVN 3")
157                check_ims_reg = True
158                check_ims_calling = True
159            else:
160                self.anritsu.start_simulation()
161            if is_ims_call or csfb_type:
162                self.anritsu.send_command("IMSSTARTVN 1")
163                self.anritsu.send_command("IMSSTARTVN 2")
164                self.anritsu.send_command("IMSSTARTVN 3")
165
166            iterations = 1
167            if self.stress_test_number > 0:
168                iterations = self.stress_test_number
169            successes = 0
170            for i in range(1, iterations + 1):
171                if self.stress_test_number:
172                    self.log.info(
173                        "Running iteration {} of {}".format(i, iterations))
174                # FIXME: There's no good reason why this must be true;
175                # I can only assume this was done to work around a problem
176                self.ad.droid.telephonyToggleDataConnection(False)
177
178                # turn off all other BTS to ensure UE registers on BTS1
179                sim_model = (self.anritsu.get_simulation_model()).split(",")
180                no_of_bts = len(sim_model)
181                for i in range(2, no_of_bts + 1):
182                    self.anritsu.send_command(
183                        "OUTOFSERVICE OUT,BTS{}".format(i))
184
185                if phone_setup_func is not None:
186                    if not phone_setup_func(self.ad):
187                        self.log.warning(
188                            "phone_setup_func failed. Rebooting UE")
189                        self.ad.reboot()
190                        time.sleep(30)
191                        if self.ad.sim_card == "VzW12349":
192                            set_preferred_apn_by_adb(self.ad, "VZWINTERNET")
193                        if not phone_setup_func(self.ad):
194                            self.log.error("phone_setup_func failed.")
195                            continue
196
197                if is_wait_for_registration:
198                    self.anritsu.wait_for_registration_state()
199
200                if phone_idle_func_after_registration:
201                    if not phone_idle_func_after_registration(self.log,
202                                                              self.ad):
203                        continue
204
205                for i in range(2, no_of_bts + 1):
206                    self.anritsu.send_command(
207                        "OUTOFSERVICE IN,BTS{}".format(i))
208
209                time.sleep(WAIT_TIME_ANRITSU_REG_AND_CALL)
210                if srvcc:
211                    if not ims_call_cs_teardown(
212                            self.log, self.ad, self.anritsu, voice_number,
213                            CALL_TEARDOWN_PHONE, False, check_ims_reg,
214                            check_ims_calling, srvcc, mo,
215                            WAIT_TIME_IN_CALL_FOR_IMS, WAIT_TIME_IN_CALL):
216                        if mo:
217                            self.log.error(
218                                "Phone {} Failed to make voice call to {}"
219                                .format(self.ad.serial, voice_number))
220                        else:
221                            self.log.error(
222                                "Phone {} failed to answer voice call."
223                                .format(self.ad.serial))
224                        continue
225                else:
226                    if not call_mo_setup_teardown(
227                            self.log, self.ad, self.anritsu, voice_number,
228                            CALL_TEARDOWN_PHONE, False, WAIT_TIME_IN_CALL,
229                            is_ims_call):
230                        self.log.error(
231                            "Phone {} Failed to make voice call to {}"
232                            .format(self.ad.serial, voice_number))
233                        continue
234                successes += 1
235                if self.stress_test_number:
236                    self.log.info("Passed iteration {}".format(i))
237            if self.stress_test_number:
238                self.log.info("Total of {} successes out of {} attempts".
239                              format(successes, iterations))
240            return True if successes == iterations else False
241
242        except AnritsuError as e:
243            self.log.error("Error in connection with Anritsu Simulator: " +
244                           str(e))
245            return False
246        except Exception as e:
247            self.log.error("Exception during voice call procedure: " + str(e))
248            return False
249        return True
250
251    def _phone_setup_lte_wcdma(self, ad):
252        toggle_volte(self.log, ad, False)
253        return ensure_network_rat(
254            self.log,
255            ad,
256            NETWORK_MODE_LTE_GSM_WCDMA,
257            RAT_FAMILY_LTE,
258            toggle_apm_after_setting=True)
259
260    def _phone_setup_lte_1x(self, ad):
261        return ensure_network_rat(
262            self.log,
263            ad,
264            NETWORK_MODE_LTE_CDMA_EVDO,
265            RAT_FAMILY_LTE,
266            toggle_apm_after_setting=True)
267
268    def _phone_setup_wcdma(self, ad):
269        return ensure_network_rat(
270            self.log,
271            ad,
272            NETWORK_MODE_GSM_UMTS,
273            RAT_FAMILY_UMTS,
274            toggle_apm_after_setting=True)
275
276    def _phone_setup_gsm(self, ad):
277        return ensure_network_rat(
278            self.log,
279            ad,
280            NETWORK_MODE_GSM_ONLY,
281            RAT_FAMILY_GSM,
282            toggle_apm_after_setting=True)
283
284    def _phone_setup_1x(self, ad):
285        return ensure_network_rat(
286            self.log,
287            ad,
288            NETWORK_MODE_CDMA,
289            RAT_FAMILY_CDMA2000,
290            toggle_apm_after_setting=True)
291
292    def _phone_setup_airplane_mode(self, ad):
293        return toggle_airplane_mode_by_adb(self.log, ad, True)
294
295    def _phone_setup_volte_airplane_mode(self, ad):
296        toggle_volte(self.log, ad, True)
297        return toggle_airplane_mode_by_adb(self.log, ad, True)
298
299    def _phone_setup_volte(self, ad):
300        ad.droid.telephonyToggleDataConnection(True)
301        toggle_volte(self.log, ad, True)
302        return ensure_network_rat(
303            self.log,
304            ad,
305            NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA,
306            RAT_FAMILY_LTE,
307            toggle_apm_after_setting=True)
308
309    """ Tests Begin """
310
311    @test_tracker_info(uuid="56c42e16-3936-4c51-8b8b-4866f54cc0bc")
312    @TelephonyBaseTest.tel_test_wrap
313    def test_voice_call_lte_wcdma_csfb_redirection(self):
314        """ Test Voice call functionality on LTE (CSFB to WCDMA).
315            CSFB type is REDIRECTION
316
317        Steps:
318        1. Setup CallBox on LTE and WCDMA network, make sure DUT register on LTE network.
319        2. Make an voice call to DEFAULT_CALL_NUMBER. Make sure DUT CSFB to WCDMA.
320        3. Make sure Anritsu receives the call and accept.
321        4. Tear down the call.
322
323        Expected Results:
324        2. Voice call succeed. DUT CSFB to WCDMA.
325        3. Anritsu can accept the call.
326        4. Tear down call succeed.
327
328        Returns:
329            True if pass; False if fail
330        """
331        return self._setup_voice_call(
332            set_system_model_lte_wcdma,
333            self._phone_setup_lte_wcdma,
334            voice_number=self.voice_call_number,
335            csfb_type=CsfbType.CSFB_TYPE_REDIRECTION)
336
337    @test_tracker_info(uuid="dcc1428f-9b7d-4064-8313-f1f5e428e0c7")
338    @TelephonyBaseTest.tel_test_wrap
339    def test_voice_call_lte_wcdma_csfb_handover(self):
340        """ Test Voice call functionality on LTE (CSFB to WCDMA).
341            CSFB type is HANDOVER
342
343        Steps:
344        1. Setup CallBox on LTE and WCDMA network, make sure DUT register on LTE network.
345        2. Make an voice call to DEFAULT_CALL_NUMBER. Make sure DUT CSFB to WCDMA.
346        3. Make sure Anritsu receives the call and accept.
347        4. Tear down the call.
348
349        Expected Results:
350        2. Voice call succeed. DUT CSFB to WCDMA.
351        3. Anritsu can accept the call.
352        4. Tear down call succeed.
353
354        Returns:
355            True if pass; False if fail
356        """
357        return self._setup_voice_call(
358            set_system_model_lte_wcdma,
359            self._phone_setup_lte_wcdma,
360            voice_number=self.voice_call_number,
361            csfb_type=CsfbType.CSFB_TYPE_HANDOVER)
362
363    @test_tracker_info(uuid="e250b134-d5e9-48ca-b224-eb0e07648275")
364    @TelephonyBaseTest.tel_test_wrap
365    def test_voice_call_lte_1x_csfb(self):
366        """ Test Voice call functionality on LTE (CSFB to 1x).
367
368        Steps:
369        1. Setup CallBox on LTE and CDMA 1X network, make sure DUT register on LTE network.
370        2. Make an voice call to DEFAULT_CALL_NUMBER. Make sure DUT CSFB to 1x.
371        3. Make sure Anritsu receives the call and accept.
372        4. Tear down the call.
373
374        Expected Results:
375        2. Voice call succeed. DUT CSFB to 1x.
376        3. Anritsu can accept the call.
377        4. Tear down call succeed.
378
379        Returns:
380            True if pass; False if fail
381        """
382        return self._setup_voice_call(
383            set_system_model_lte_1x,
384            self._phone_setup_lte_1x,
385            voice_number=self.voice_call_number)
386
387    @test_tracker_info(uuid="fcbe0f5d-51c2-46c8-8ff3-2daa1d91b936")
388    @TelephonyBaseTest.tel_test_wrap
389    def test_voice_call_wcdma(self):
390        """ Test Voice call functionality on WCDMA
391
392        Steps:
393        1. Setup CallBox on WCDMA network, make sure DUT register on WCDMA network.
394        2. Make an voice call to DEFAULT_CALL_NUMBER.
395        3. Make sure Anritsu receives the call and accept.
396        4. Tear down the call.
397
398        Expected Results:
399        2. Voice call succeed.
400        3. Anritsu can accept the call.
401        4. Tear down call succeed.
402
403        Returns:
404            True if pass; False if fail
405        """
406        return self._setup_voice_call(
407            set_system_model_wcdma,
408            self._phone_setup_wcdma,
409            voice_number=self.voice_call_number)
410
411    @test_tracker_info(uuid="077f851b-2c8e-4b1d-adc2-0326d3346157")
412    @TelephonyBaseTest.tel_test_wrap
413    def test_voice_call_gsm(self):
414        """ Test Voice call functionality on GSM
415
416        Steps:
417        1. Setup CallBox on GSM network, make sure DUT register on GSM network.
418        2. Make an voice call to DEFAULT_CALL_NUMBER.
419        3. Make sure Anritsu receives the call and accept.
420        4. Tear down the call.
421
422        Expected Results:
423        2. Voice call succeed.
424        3. Anritsu can accept the call.
425        4. Tear down call succeed.
426
427        Returns:
428            True if pass; False if fail
429        """
430        return self._setup_voice_call(
431            set_system_model_gsm,
432            self._phone_setup_gsm,
433            voice_number=self.voice_call_number)
434
435    @test_tracker_info(uuid="80376fb3-44fc-43b7-be99-2ccd3bd2913e")
436    @TelephonyBaseTest.tel_test_wrap
437    def test_voice_call_1x(self):
438        """ Test Voice call functionality on CDMA 1X
439
440        Steps:
441        1. Setup CallBox on 1x network, make sure DUT register on 1x network.
442        2. Make an voice call to DEFAULT_CALL_NUMBER.
443        3. Make sure Anritsu receives the call and accept.
444        4. Tear down the call.
445
446        Expected Results:
447        2. Voice call succeed.
448        3. Anritsu can accept the call.
449        4. Tear down call succeed.
450
451        Returns:
452            True if pass; False if fail
453        """
454        return self._setup_voice_call(
455            set_system_model_1x,
456            self._phone_setup_1x,
457            voice_number=self.voice_call_number)
458
459    @test_tracker_info(uuid="1f8ae218-042d-4114-9fc7-4401a503b3b4")
460    @TelephonyBaseTest.tel_test_wrap
461    def test_voice_call_1x_evdo(self):
462        """ Test Voice call functionality on CDMA 1X with EVDO
463
464        Steps:
465        1. Setup CallBox on 1x and EVDO network, make sure DUT register on 1x network.
466        2. Make an voice call to DEFAULT_CALL_NUMBER.
467        3. Make sure Anritsu receives the call and accept.
468        4. Tear down the call.
469
470        Expected Results:
471        2. Voice call succeed.
472        3. Anritsu can accept the call.
473        4. Tear down call succeed.
474
475        Returns:
476            True if pass; False if fail
477        """
478        return self._setup_voice_call(
479            set_system_model_1x_evdo,
480            self._phone_setup_1x,
481            voice_number=self.voice_call_number)
482
483    @test_tracker_info(uuid="7641ffc0-c1b3-42b8-92d6-00ae53719f8d")
484    @TelephonyBaseTest.tel_test_wrap
485    def test_voice_call_volte_wcdma_srvcc(self):
486        """ Test Voice call functionality,
487        VoLTE to WCDMA SRVCC
488        Steps:
489        1. Setup CallBox on VoLTE network with WCDMA.
490        2. Turn on DUT and enable VoLTE. Make an voice call to DEFAULT_CALL_NUMBER.
491        3. Check if VoLTE voice call connected successfully.
492        4. Handover the call to WCDMA and check if the call is still up.
493        5. Tear down the call.
494
495        Expected Results:
496        1. VoLTE Voice call is made successfully.
497        2. After SRVCC, the DEFAULT_CALL_NUMBER call is not dropped.
498        3. Tear down call succeed.
499
500        Returns:
501            True if pass; False if fail
502        """
503        return self._setup_voice_call(
504            set_system_model_lte_wcdma,
505            self._phone_setup_volte,
506            phone_idle_volte,
507            srvcc="InCall",
508            voice_number=self.voice_call_number,
509            wait_time_in_call=WAIT_TIME_IN_CALL_FOR_IMS)
510
511    @test_tracker_info(uuid="0d63e797-b4bc-4094-98c3-70060e5ea91b")
512    @TelephonyBaseTest.tel_test_wrap
513    def test_voice_call_volte_gsm_srvcc(self):
514        """ Test Voice call functionality,
515        VoLTE to GSM SRVCC
516        Steps:
517        1. Setup CallBox on VoLTE network with GSM.
518        2. Turn on DUT and enable VoLTE. Make an voice call to DEFAULT_CALL_NUMBER.
519        3. Check if VoLTE voice call connected successfully.
520        4. Handover the call to GSM and check if the call is still up.
521        5. Tear down the call.
522
523        Expected Results:
524        1. VoLTE Voice call is made successfully.
525        2. After SRVCC, the DEFAULT_CALL_NUMBER call is not dropped.
526        3. Tear down call succeed.
527
528        Returns:
529            True if pass; False if fail
530        """
531        return self._setup_voice_call(
532            set_system_model_lte_gsm,
533            self._phone_setup_volte,
534            phone_idle_volte,
535            srvcc="InCall",
536            voice_number=self.voice_call_number,
537            wait_time_in_call=WAIT_TIME_IN_CALL_FOR_IMS)
538
539    @test_tracker_info(uuid="f73f6cc0-79c8-47b3-9867-ea7390dfee41")
540    @TelephonyBaseTest.tel_test_wrap
541    def test_voice_call_volte_wcdma_asrvcc(self):
542        """ Test Voice call functionality,
543        VoLTE to WCDMA aSRVCC
544        Steps:
545        1. Setup CallBox on VoLTE network with WCDMA.
546        2. Turn on DUT and enable VoLTE. Make an voice call to DEFAULT_CALL_NUMBER.
547        3. Check if Virtual UA in CSCF server rings.
548        4. Handover the call to WCDMA and check if the call is connected.
549        5. Tear down the call.
550
551        Expected Results:
552        1. Virtual UA is rining.
553        2. After aSRVCC, the DEFAULT_CALL_NUMBER call is connected.
554        3. Tear down call succeed.
555
556        Returns:
557            True if pass; False if fail
558        """
559        return self._setup_voice_call(
560            set_system_model_lte_wcdma,
561            self._phone_setup_volte,
562            phone_idle_volte,
563            srvcc="Alert",
564            voice_number=self.voice_call_number)
565
566    @test_tracker_info(uuid="823e8e10-58bd-476d-ba4b-ec436ac424fb")
567    @TelephonyBaseTest.tel_test_wrap
568    def test_voice_call_volte_gsm_asrvcc(self):
569        """ Test Voice call functionality,
570        VoLTE to GSM aSRVCC
571        Steps:
572        1. Setup CallBox on VoLTE network with GSM.
573        2. Turn on DUT and enable VoLTE. Make an voice call to DEFAULT_CALL_NUMBER.
574        3. Check if Virtual UA in CSCF server rings.
575        4. Handover the call to GSM and check if the call is connected.
576        5. Tear down the call.
577
578        Expected Results:
579        1. Virtual UA is rining.
580        2. After aSRVCC, the DEFAULT_CALL_NUMBER call is connected.
581        3. Tear down call succeed.
582
583        Returns:
584            True if pass; False if fail
585        """
586        return self._setup_voice_call(
587            set_system_model_lte_gsm,
588            self._phone_setup_volte,
589            phone_idle_volte,
590            srvcc="Alert",
591            voice_number=self.voice_call_number,
592            wait_time_in_call=WAIT_TIME_IN_CALL_FOR_IMS)
593
594    @test_tracker_info(uuid="cd066cb1-6d12-4e29-90b9-f44054f00a00")
595    @TelephonyBaseTest.tel_test_wrap
596    def test_voice_call_volte_wcdma_asrvcc_mt(self):
597        """ Test Voice call functionality,
598        MT VoLTE to WCDMA aSRVCC
599        Steps:
600        1. Setup CallBox on VoLTE network with WCDMA.
601        2. Turn on DUT and enable VoLTE. Make a VoLTE call from MD8475A to UE.
602        3. Check if Virtual UA in CSCF server calling.
603        4. Handover the call to WCDMA and check if the call is connected.
604        5. Tear down the call.
605
606        Expected Results:
607        1. Virtual UA is rining.
608        2. After aSRVCC, the DEFAULT_CALL_NUMBER call is connected.
609        3. Tear down call succeed.
610
611        Returns:
612            True if pass; False if fail
613        """
614        return self._setup_voice_call(
615            set_system_model_lte_wcdma,
616            self._phone_setup_volte,
617            phone_idle_volte,
618            srvcc="Alert",
619            mo=False,
620            voice_number=self.voice_call_number)
621
622    @test_tracker_info(uuid="b23ebec3-7e5c-4aca-a749-e34307c56d58")
623    @TelephonyBaseTest.tel_test_wrap
624    def test_voice_call_volte_gsm_asrvcc_mt(self):
625        """ Test Voice call functionality,
626        MT VoLTE to GSM aSRVCC
627        Steps:
628        1. Setup CallBox on VoLTE network with GSM.
629        2. Turn on DUT and enable VoLTE. Make a VoLTE call from MD8475A to UE.
630        3. Check if Virtual UA in CSCF server calling.
631        4. Handover the call to GSM and check if the call is connected.
632        5. Tear down the call.
633
634        Expected Results:
635        1. Virtual UA is rining.
636        2. After aSRVCC, the DEFAULT_CALL_NUMBER call is connected.
637        3. Tear down call succeed.
638
639        Returns:
640            True if pass; False if fail
641        """
642        return self._setup_voice_call(
643            set_system_model_lte_gsm,
644            self._phone_setup_volte,
645            phone_idle_volte,
646            srvcc="Alert",
647            mo=False,
648            voice_number=self.voice_call_number,
649            wait_time_in_call=WAIT_TIME_IN_CALL_FOR_IMS)
650
651    @test_tracker_info(uuid="b81b3a0e-a7e3-4b30-889f-7c015bdc6980")
652    @TelephonyBaseTest.tel_test_wrap
653    def test_voice_call_volte(self):
654        """ Test Voice call functionality on VoLTE
655
656        Steps:
657        1. Setup CallBox on VoLTE network.
658        2. Turn on DUT and enable VoLTE. Make an voice call to DEFAULT_CALL_NUMBER.
659        3. Make sure Anritsu receives the call and accept.
660        4. Tear down the call.
661
662        Expected Results:
663        2. Voice call succeed.
664        3. Anritsu can accept the call.
665        4. Tear down call succeed.
666
667        Returns:
668            True if pass; False if fail
669        """
670        return self._setup_voice_call(
671            set_system_model_lte,
672            self._phone_setup_volte,
673            phone_idle_volte,
674            is_ims_call=True,
675            voice_number=self.voice_call_number,
676            wait_time_in_call=WAIT_TIME_IN_CALL_FOR_IMS)
677
678    """ Tests End """
679