blob: b1056608ac1140b0f4deccb97cb4a850334017f9 [file] [log] [blame]
#!/usr/bin/env python3.4
#
# Copyright 2022 - Google
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Test Script for Telephony Pre Check In Sanity
"""
import time
from acts import signals
from acts.test_decorators import test_tracker_info
from acts_contrib.test_utils.tel.loggers.protos.telephony_metric_pb2 import TelephonyVoiceTestResult
from acts_contrib.test_utils.tel.loggers.telephony_metric_logger import TelephonyMetricLogger
from acts_contrib.test_utils.tel.TelephonyBaseTest import TelephonyBaseTest
from acts_contrib.test_utils.tel.tel_data_utils import get_mobile_data_usage
from acts_contrib.test_utils.tel.tel_data_utils import remove_mobile_data_usage_limit
from acts_contrib.test_utils.tel.tel_data_utils import set_mobile_data_usage_limit
from acts_contrib.test_utils.tel.tel_data_utils import test_call_setup_in_active_data_transfer
from acts_contrib.test_utils.tel.tel_data_utils import test_call_setup_in_active_youtube_video
from acts_contrib.test_utils.tel.tel_data_utils import call_epdg_to_epdg_wfc
from acts_contrib.test_utils.tel.tel_data_utils import test_wifi_cell_switching_in_call
from acts_contrib.test_utils.tel.tel_defines import CARRIER_VZW
from acts_contrib.test_utils.tel.tel_defines import DIRECTION_MOBILE_ORIGINATED
from acts_contrib.test_utils.tel.tel_defines import DIRECTION_MOBILE_TERMINATED
from acts_contrib.test_utils.tel.tel_defines import GEN_2G
from acts_contrib.test_utils.tel.tel_defines import GEN_4G
from acts_contrib.test_utils.tel.tel_defines import GEN_3G
from acts_contrib.test_utils.tel.tel_defines import PHONE_TYPE_CDMA
from acts_contrib.test_utils.tel.tel_defines import PHONE_TYPE_GSM
from acts_contrib.test_utils.tel.tel_defines import TOTAL_LONG_CALL_DURATION
from acts_contrib.test_utils.tel.tel_defines import WAIT_TIME_IN_CALL
from acts_contrib.test_utils.tel.tel_defines import WAIT_TIME_IN_CALL_FOR_IMS
from acts_contrib.test_utils.tel.tel_defines import WAIT_TIME_ANDROID_STATE_SETTLING
from acts_contrib.test_utils.tel.tel_defines import WFC_MODE_CELLULAR_PREFERRED
from acts_contrib.test_utils.tel.tel_defines import WFC_MODE_WIFI_ONLY
from acts_contrib.test_utils.tel.tel_defines import WFC_MODE_WIFI_PREFERRED
from acts_contrib.test_utils.tel.tel_phone_setup_utils import phone_idle_2g
from acts_contrib.test_utils.tel.tel_phone_setup_utils import phone_idle_3g
from acts_contrib.test_utils.tel.tel_phone_setup_utils import phone_idle_csfb
from acts_contrib.test_utils.tel.tel_phone_setup_utils import phone_idle_iwlan
from acts_contrib.test_utils.tel.tel_phone_setup_utils import phone_idle_volte
from acts_contrib.test_utils.tel.tel_phone_setup_utils import phone_setup_csfb
from acts_contrib.test_utils.tel.tel_phone_setup_utils import phone_setup_iwlan
from acts_contrib.test_utils.tel.tel_phone_setup_utils import phone_setup_iwlan_cellular_preferred
from acts_contrib.test_utils.tel.tel_phone_setup_utils import phone_setup_voice_2g
from acts_contrib.test_utils.tel.tel_phone_setup_utils import phone_setup_voice_3g
from acts_contrib.test_utils.tel.tel_phone_setup_utils import phone_setup_voice_general
from acts_contrib.test_utils.tel.tel_phone_setup_utils import phone_setup_volte
from acts_contrib.test_utils.tel.tel_subscription_utils import get_incoming_voice_sub_id
from acts_contrib.test_utils.tel.tel_subscription_utils import get_outgoing_voice_sub_id
from acts_contrib.test_utils.tel.tel_test_utils import install_dialer_apk
from acts_contrib.test_utils.tel.tel_test_utils import num_active_calls
from acts_contrib.test_utils.tel.tel_test_utils import STORY_LINE
from acts_contrib.test_utils.tel.tel_voice_utils import hangup_call
from acts_contrib.test_utils.tel.tel_voice_utils import hold_unhold_test
from acts_contrib.test_utils.tel.tel_voice_utils import initiate_call
from acts_contrib.test_utils.tel.tel_voice_utils import is_phone_in_call
from acts_contrib.test_utils.tel.tel_voice_utils import is_phone_in_call_1x
from acts_contrib.test_utils.tel.tel_voice_utils import is_phone_in_call_2g
from acts_contrib.test_utils.tel.tel_voice_utils import is_phone_in_call_3g
from acts_contrib.test_utils.tel.tel_voice_utils import is_phone_in_call_csfb
from acts_contrib.test_utils.tel.tel_voice_utils import is_phone_in_call_iwlan
from acts_contrib.test_utils.tel.tel_voice_utils import is_phone_in_call_not_iwlan
from acts_contrib.test_utils.tel.tel_voice_utils import is_phone_in_call_wcdma
from acts_contrib.test_utils.tel.tel_voice_utils import is_phone_in_call_volte
from acts_contrib.test_utils.tel.tel_voice_utils import _test_call_long_duration
from acts_contrib.test_utils.tel.tel_voice_utils import call_setup_teardown
from acts_contrib.test_utils.tel.tel_voice_utils import call_voicemail_erase_all_pending_voicemail
from acts_contrib.test_utils.tel.tel_voice_utils import two_phone_call_leave_voice_mail
from acts_contrib.test_utils.tel.tel_voice_utils import two_phone_call_long_seq
from acts_contrib.test_utils.tel.tel_voice_utils import two_phone_call_short_seq
from acts_contrib.test_utils.tel.tel_voice_utils import wait_for_in_call_active
from acts_contrib.test_utils.tel.tel_voice_utils import wait_for_ringing_call
from acts_contrib.test_utils.tel.tel_wifi_utils import set_wifi_to_default
from acts.libs.utils.multithread import multithread_func
DEFAULT_PING_DURATION = 120 # in seconds
CallResult = TelephonyVoiceTestResult.CallResult.Value
class TelLiveVoiceTest(TelephonyBaseTest):
def setup_class(self):
super().setup_class()
self.stress_test_number = self.get_stress_test_number()
self.long_call_duration = self.user_params.get(
"long_call_duration",
TOTAL_LONG_CALL_DURATION)
self.number_of_devices = 2
self.call_server_number = self.user_params.get(
"call_server_number", STORY_LINE)
self.tel_logger = TelephonyMetricLogger.for_test_case()
self.dialer_util = self.user_params.get("dialer_apk", None)
if isinstance(self.dialer_util, list):
self.dialer_util = self.dialer_util[0]
if self.dialer_util:
ads = self.android_devices
for ad in ads:
install_dialer_apk(ad, self.dialer_util)
def get_carrier_name(self, ad):
return ad.adb.getprop("gsm.sim.operator.alpha")
def check_band_support(self,ad):
carrier = ad.adb.getprop("gsm.sim.operator.alpha")
if int(ad.adb.getprop("ro.product.first_api_level")) > 30 and (
carrier == CARRIER_VZW):
raise signals.TestSkip(
"Device Doesn't Support 2g/3G Band.")
""" Tests Begin """
@TelephonyBaseTest.tel_test_wrap
@test_tracker_info(uuid="c5009f8c-eb1d-4cd9-85ce-604298bbeb3e")
def test_call_to_answering_machine(self):
""" Voice call to an answering machine.
1. Make Sure PhoneA attached to voice network.
2. Call from PhoneA to Storyline
3. Verify call is in ACTIVE state
4. Hangup Call from PhoneA
Raises:
TestFailure if not success.
"""
ad = self.android_devices[0]
if not phone_setup_voice_general(ad.log, ad):
ad.log.error("Phone Failed to Set Up Properly for Voice.")
return False
for iteration in range(3):
result = True
ad.log.info("Attempt %d", iteration + 1)
if not initiate_call(ad.log, ad, self.call_server_number):
ad.log.error("Call Failed to Initiate")
result = False
continue
if not wait_for_in_call_active(ad, 60, 3):
ad.log.error("Waiting for Call in Active Failed")
result = False
time.sleep(WAIT_TIME_IN_CALL)
if not is_phone_in_call(ad.log, ad):
ad.log.error("Call Dropped")
result = False
if not hangup_call(ad.log, ad):
ad.log.error("Call Failed to Hangup")
result = False
if result:
ad.log.info("Call test PASS in iteration %d", iteration + 1)
return True
time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
ad.log.info("Call test FAIL in all 3 iterations")
return False
@TelephonyBaseTest.tel_test_wrap
@test_tracker_info(uuid="fca3f9e1-447a-416f-9a9c-50b7161981bf")
def test_call_mo_voice_general(self):
""" General voice to voice call.
1. Make Sure PhoneA attached to voice network.
2. Make Sure PhoneB attached to voice network.
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
tasks = [(phone_setup_voice_general, (self.log, ads[0])),
(phone_setup_voice_general, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_short_seq(self.log, ads[0], None, None, ads[1],
None, None)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@TelephonyBaseTest.tel_test_wrap
@test_tracker_info(uuid="69faeb84-3830-47c0-ad80-dc657381a83b")
def test_call_mt_voice_general(self):
""" General voice to voice call.
1. Make Sure PhoneA attached to voice network.
2. Make Sure PhoneB attached to voice network.
3. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneB.
4. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneA.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
tasks = [(phone_setup_voice_general, (self.log, ads[0])),
(phone_setup_voice_general, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_short_seq(self.log, ads[1], None, None, ads[0],
None, None)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="b2de097b-70e1-4242-b555-c1aa0a5acd8c")
@TelephonyBaseTest.tel_test_wrap
def test_call_volte_to_volte(self):
""" VoLTE to VoLTE call test
1. Make Sure PhoneA is in LTE mode (with VoLTE).
2. Make Sure PhoneB is in LTE mode (with VoLTE).
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
tasks = [(phone_setup_volte, (self.log, ads[0])), (phone_setup_volte,
(self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_short_seq(
self.log, ads[0], phone_idle_volte, is_phone_in_call_volte, ads[1],
phone_idle_volte, is_phone_in_call_volte, None,
WAIT_TIME_IN_CALL_FOR_IMS)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="3c7f5a09-0177-4469-9994-cd5e7dd7c7fe")
@TelephonyBaseTest.tel_test_wrap
def test_call_volte_to_volte_7_digit_dialing(self):
""" VoLTE to VoLTE call test, dial with 7 digit number
1. Make Sure PhoneA is in LTE mode (with VoLTE).
2. Make Sure PhoneB is in LTE mode (with VoLTE).
3. Call from PhoneA to PhoneB by 7-digit phone number, accept on PhoneB.
Returns:
True if pass; False if fail.
"""
ads = self.android_devices
if ads[0].droid.telephonyGetSimCountryIso() == "ca":
raise signals.TestSkip("7 digit dialing not supported")
tasks = [(phone_setup_volte, (self.log, ads[0])), (phone_setup_volte,
(self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
return False
return call_setup_teardown(
self.log,
ads[0],
ads[1],
ads[0],
is_phone_in_call_volte,
is_phone_in_call_volte,
WAIT_TIME_IN_CALL_FOR_IMS,
dialing_number_length=7)
@test_tracker_info(uuid="721ef935-a03c-4d0f-85b9-4753d857162f")
@TelephonyBaseTest.tel_test_wrap
def test_call_volte_to_volte_10_digit_dialing(self):
""" VoLTE to VoLTE call test, dial with 10 digit number
1. Make Sure PhoneA is in LTE mode (with VoLTE).
2. Make Sure PhoneB is in LTE mode (with VoLTE).
3. Call from PhoneA to PhoneB by 10-digit phone number, accept on PhoneB.
Returns:
True if pass; False if fail.
"""
if self.android_devices[0].droid.telephonyGetSimCountryIso() == "ca":
raise signals.TestSkip("10 digit dialing not supported")
ads = self.android_devices
tasks = [(phone_setup_volte, (self.log, ads[0])), (phone_setup_volte,
(self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
return False
if not call_setup_teardown(
self.log,
ads[0],
ads[1],
ads[0],
is_phone_in_call_volte,
is_phone_in_call_volte,
WAIT_TIME_IN_CALL_FOR_IMS,
dialing_number_length=10):
return False
return True
@test_tracker_info(uuid="4fd3aa62-2398-4cee-994e-7fc5cadbcbc1")
@TelephonyBaseTest.tel_test_wrap
def test_call_volte_to_volte_11_digit_dialing(self):
""" VoLTE to VoLTE call test, dial with 11 digit number
1. Make Sure PhoneA is in LTE mode (with VoLTE).
2. Make Sure PhoneB is in LTE mode (with VoLTE).
3. Call from PhoneA to PhoneB by 11-digit phone number, accept on PhoneB.
Returns:
True if pass; False if fail.
"""
ads = self.android_devices
tasks = [(phone_setup_volte, (self.log, ads[0])), (phone_setup_volte,
(self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
return False
return call_setup_teardown(
self.log,
ads[0],
ads[1],
ads[0],
is_phone_in_call_volte,
is_phone_in_call_volte,
WAIT_TIME_IN_CALL_FOR_IMS,
dialing_number_length=11)
@test_tracker_info(uuid="969abdac-6a57-442a-9c40-48199bd8d556")
@TelephonyBaseTest.tel_test_wrap
def test_call_volte_to_volte_12_digit_dialing(self):
""" VoLTE to VoLTE call test, dial with 12 digit number
1. Make Sure PhoneA is in LTE mode (with VoLTE).
2. Make Sure PhoneB is in LTE mode (with VoLTE).
3. Call from PhoneA to PhoneB by 12-digit phone number, accept on PhoneB.
Returns:
True if pass; False if fail.
"""
ads = self.android_devices
tasks = [(phone_setup_volte, (self.log, ads[0])), (phone_setup_volte,
(self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
return False
return call_setup_teardown(
self.log,
ads[0],
ads[1],
ads[0],
is_phone_in_call_volte,
is_phone_in_call_volte,
WAIT_TIME_IN_CALL_FOR_IMS,
dialing_number_length=12)
@test_tracker_info(uuid="6b13a03d-c9ff-43d7-9798-adbead7688a4")
@TelephonyBaseTest.tel_test_wrap
def test_call_volte_to_csfb_3g(self):
""" VoLTE to CSFB 3G call test
1. Make Sure PhoneA is in LTE mode (with VoLTE).
2. Make Sure PhoneB is in LTE mode (without VoLTE).
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
self.check_band_support(ads[0])
tasks = [(phone_setup_volte, (self.log, ads[0])), (phone_setup_csfb,
(self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_short_seq(
self.log, ads[0], phone_idle_volte, is_phone_in_call_volte, ads[1],
phone_idle_csfb, is_phone_in_call_csfb, None)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="38096fdb-324a-4ce0-8836-8bbe713cffc2")
@TelephonyBaseTest.tel_test_wrap
def test_call_volte_to_csfb_for_tmo(self):
""" VoLTE to CSFB 3G call test for TMobile
1. Make Sure PhoneA is in LTE mode (with VoLTE).
2. Make Sure PhoneB is in LTE mode (without VoLTE, CSFB to WCDMA/GSM).
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
self.check_band_support(ads[0])
tasks = [(phone_setup_volte, (self.log, ads[0])), (phone_setup_csfb,
(self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_short_seq(self.log, ads[0], phone_idle_volte,
None, ads[1], phone_idle_csfb,
is_phone_in_call_csfb, None)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="82f9515d-a52b-4dec-93a5-997ffdbca76c")
@TelephonyBaseTest.tel_test_wrap
def test_call_volte_to_csfb_1x_long(self):
""" VoLTE to CSFB 1x call test
1. Make Sure PhoneA is in LTE mode (with VoLTE).
2. Make Sure PhoneB is in LTE mode (without VoLTE, CSFB to 1x).
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
5. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneB.
6. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneA.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
# Make Sure PhoneB is CDMA phone.
if ads[1].droid.telephonyGetPhoneType() != PHONE_TYPE_CDMA:
self.log.error(
"PhoneB not cdma phone, can not csfb 1x. Stop test.")
self.tel_logger.set_result(CallResult("UNAVAILABLE_NETWORK_TYPE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "PhoneB not cdma, cannot csfb 1x."})
tasks = [(phone_setup_volte, (self.log, ads[0])), (phone_setup_csfb,
(self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_long_seq(
self.log, ads[0], phone_idle_volte, is_phone_in_call_volte, ads[1],
phone_idle_csfb, is_phone_in_call_1x, None)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="2e57fad6-5eaf-4e7d-8353-8aa6f4c52776")
@TelephonyBaseTest.tel_test_wrap
def test_call_volte_to_csfb_long(self):
""" VoLTE to CSFB WCDMA call test
1. Make Sure PhoneA is in LTE mode (with VoLTE).
2. Make Sure PhoneB is in LTE mode (without VoLTE, CSFB to WCDMA/GSM).
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
5. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneB.
6. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneA.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
# Make Sure PhoneB is GSM phone.
if ads[1].droid.telephonyGetPhoneType() != PHONE_TYPE_GSM:
self.log.error(
"PhoneB not gsm phone, can not csfb wcdma. Stop test.")
self.tel_logger.set_result(CallResult("UNAVAILABLE_NETWORK_TYPE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "PhoneB not gsm, cannot csfb wcdma."})
tasks = [(phone_setup_volte, (self.log, ads[0])), (phone_setup_csfb,
(self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Setup Properly")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Setup Properly"})
result = two_phone_call_long_seq(
self.log, ads[0], phone_idle_volte, is_phone_in_call_volte, ads[1],
phone_idle_csfb, is_phone_in_call_csfb, None)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="4bab759f-7610-4cec-893c-0a8aed95f70c")
@TelephonyBaseTest.tel_test_wrap
def test_call_volte_to_3g(self):
""" VoLTE to 3G call test
1. Make Sure PhoneA is in LTE mode (with VoLTE).
2. Make Sure PhoneB is in 3G mode.
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
self.check_band_support(ads[0])
tasks = [(phone_setup_volte, (self.log, ads[0])),
(phone_setup_voice_3g, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
result = two_phone_call_short_seq(
self.log, ads[0], phone_idle_volte, is_phone_in_call_volte, ads[1],
phone_idle_3g, is_phone_in_call_3g, None)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="b394cdc5-d88d-4659-8a26-0e58fde69974")
@TelephonyBaseTest.tel_test_wrap
def test_call_volte_to_3g_1x_long(self):
""" VoLTE to 3G 1x call test
1. Make Sure PhoneA is in LTE mode (with VoLTE).
2. Make Sure PhoneB is in 3G 1x mode.
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
5. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneB.
6. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneA.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
self.check_band_support(ads[0])
# Make Sure PhoneB is CDMA phone.
if ads[1].droid.telephonyGetPhoneType() != PHONE_TYPE_CDMA:
self.log.error("PhoneB not cdma phone, can not 3g 1x. Stop test.")
self.tel_logger.set_result(CallResult("UNAVAILABLE_NETWORK_TYPE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "PhoneB not cdma phone, can not 3g 1x."})
tasks = [(phone_setup_volte, (self.log, ads[0])),
(phone_setup_voice_3g, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_long_seq(
self.log, ads[0], phone_idle_volte, is_phone_in_call_volte, ads[1],
phone_idle_3g, is_phone_in_call_1x, None)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="b39a74a9-2a89-4c0b-ac4e-71ed9317bd75")
@TelephonyBaseTest.tel_test_wrap
def test_call_volte_to_3g_wcdma_long(self):
""" VoLTE to 3G WCDMA call test
1. Make Sure PhoneA is in LTE mode (with VoLTE).
2. Make Sure PhoneB is in 3G WCDMA mode.
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
5. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneB.
6. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneA.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
self.check_band_support(ads[0])
# Make Sure PhoneB is GSM phone.
if ads[1].droid.telephonyGetPhoneType() != PHONE_TYPE_GSM:
self.log.error(
"PhoneB not gsm phone, can not 3g wcdma. Stop test.")
self.tel_logger.set_result(CallResult('UNAVAILABLE_NETWORK_TYPE'))
raise signals.TestFailure("Failed",
extras={"fail_reason": "PhoneB not gsm phone, can not 3g wcdma."})
tasks = [(phone_setup_volte, (self.log, ads[0])),
(phone_setup_voice_3g, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "PhoneB not gsm phone, can not 3g wcdma."})
result = two_phone_call_long_seq(
self.log, ads[0], phone_idle_volte, is_phone_in_call_volte, ads[1],
phone_idle_3g, is_phone_in_call_wcdma, None)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="573bbcf1-6cbd-4084-9cb7-e14fb6c9521e")
@TelephonyBaseTest.tel_test_wrap
def test_call_volte_to_2g(self):
""" VoLTE to 2G call test
1. Make Sure PhoneA is in LTE mode (with VoLTE).
2. Make Sure PhoneB is in 2G mode.
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
self.check_band_support(ads[0])
tasks = [(phone_setup_volte, (self.log, ads[0])),
(phone_setup_voice_2g, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_short_seq(
self.log, ads[0], phone_idle_volte, is_phone_in_call_volte, ads[1],
phone_idle_2g, is_phone_in_call_2g, None)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="a4a043c0-f4ba-4405-9262-42c752cc4487")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_to_epdg_wfc_wifi_only(self):
""" WiFi Only, WiFi calling to WiFi Calling test
1. Setup PhoneA WFC mode: WIFI_ONLY.
2. Setup PhoneB WFC mode: WIFI_ONLY.
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
Returns:
True if pass; False if fail.
"""
return call_epdg_to_epdg_wfc(self.log,
self.android_devices,
False,
WFC_MODE_WIFI_ONLY,
self.wifi_network_ssid,
self.wifi_network_pass)
@test_tracker_info(uuid="ae171d58-d4c1-43f7-aa93-4860b4b28d53")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_to_epdg_wfc_wifi_preferred(self):
""" WiFi Preferred, WiFi calling to WiFi Calling test
1. Setup PhoneA WFC mode: WIFI_PREFERRED.
2. Setup PhoneB WFC mode: WIFI_PREFERRED.
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
Returns:
True if pass; False if fail.
"""
return call_epdg_to_epdg_wfc(self.log,
self.android_devices,
False,
WFC_MODE_WIFI_PREFERRED,
self.wifi_network_ssid,
self.wifi_network_pass)
@test_tracker_info(uuid="ece58857-fedc-49a9-bf10-b76bd78a51f2")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_to_epdg_wfc_cellular_preferred(self):
""" Cellular Preferred, WiFi calling to WiFi Calling test
1. Setup PhoneA WFC mode: CELLULAR_PREFERRED.
2. Setup PhoneB WFC mode: CELLULAR_PREFERRED.
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
Raises:
TestFailure if not success.
"""
ads = [self.android_devices[0], self.android_devices[1]]
tasks = [(phone_setup_iwlan_cellular_preferred,
(self.log, ads[0], self.wifi_network_ssid,
self.wifi_network_pass)),
(phone_setup_iwlan_cellular_preferred,
(self.log, ads[1], self.wifi_network_ssid,
self.wifi_network_pass))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_short_seq(
self.log, ads[0], None, is_phone_in_call_not_iwlan, ads[1], None,
is_phone_in_call_not_iwlan, None, WAIT_TIME_IN_CALL_FOR_IMS)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="0d63c250-d9e7-490c-8c48-0a6afbad5f88")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_to_epdg_apm_wfc_wifi_only(self):
""" Airplane + WiFi Only, WiFi calling to WiFi Calling test
1. Setup PhoneA in airplane mode, WFC mode: WIFI_ONLY.
2. Setup PhoneB in airplane mode, WFC mode: WIFI_ONLY.
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
Returns:
True if pass; False if fail.
"""
return call_epdg_to_epdg_wfc(self.log,
self.android_devices,
True,
WFC_MODE_WIFI_ONLY,
self.wifi_network_ssid,
self.wifi_network_pass)
@test_tracker_info(uuid="7678e4ee-29c6-4319-93ab-d555501d1876")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_to_epdg_apm_wfc_wifi_preferred(self):
""" Airplane + WiFi Preferred, WiFi calling to WiFi Calling test
1. Setup PhoneA in airplane mode, WFC mode: WIFI_PREFERRED.
2. Setup PhoneB in airplane mode, WFC mode: WIFI_PREFERRED.
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
Returns:
True if pass; False if fail.
"""
return call_epdg_to_epdg_wfc(self.log,
self.android_devices,
True,
WFC_MODE_WIFI_PREFERRED,
self.wifi_network_ssid,
self.wifi_network_pass)
@test_tracker_info(uuid="8f5c637e-683a-448d-9443-b2b39626ab19")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_to_epdg_apm_wfc_cellular_preferred(self):
""" Airplane + Cellular Preferred, WiFi calling to WiFi Calling test
1. Setup PhoneA in airplane mode, WFC mode: CELLULAR_PREFERRED.
2. Setup PhoneB in airplane mode, WFC mode: CELLULAR_PREFERRED.
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
Returns:
True if pass; False if fail.
"""
return call_epdg_to_epdg_wfc(self.log,
self.android_devices,
True,
WFC_MODE_CELLULAR_PREFERRED,
self.wifi_network_ssid,
self.wifi_network_pass)
@test_tracker_info(uuid="0b51666e-c83c-40b5-ba0f-737e64bc82a2")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_to_volte_wfc_wifi_only(self):
""" WiFi Only, WiFi calling to VoLTE test
1. Setup PhoneA WFC mode: WIFI_ONLY.
2. Make Sure PhoneB is in LTE mode (with VoLTE enabled).
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
tasks = [(phone_setup_iwlan,
(self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_volte, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_short_seq(
self.log, ads[0], phone_idle_iwlan, is_phone_in_call_iwlan, ads[1],
phone_idle_volte, is_phone_in_call_volte, None,
WAIT_TIME_IN_CALL_FOR_IMS)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="6e0630a9-63b2-4ea1-8ec9-6560f001905c")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_to_volte_wfc_wifi_preferred(self):
""" WiFi Preferred, WiFi calling to VoLTE test
1. Setup PhoneA WFC mode: WIFI_PREFERRED.
2. Make Sure PhoneB is in LTE mode (with VoLTE enabled).
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
tasks = [(phone_setup_iwlan,
(self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_volte, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_short_seq(
self.log, ads[0], phone_idle_iwlan, is_phone_in_call_iwlan, ads[1],
phone_idle_volte, is_phone_in_call_volte, None,
WAIT_TIME_IN_CALL_FOR_IMS)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="51077985-2229-491f-9a54-1ff53871758c")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_to_volte_apm_wfc_wifi_only(self):
""" Airplane + WiFi Only, WiFi calling to VoLTE test
1. Setup PhoneA in airplane mode, WFC mode: WIFI_ONLY.
2. Make Sure PhoneB is in LTE mode (with VoLTE enabled).
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
tasks = [(phone_setup_iwlan,
(self.log, ads[0], True, WFC_MODE_WIFI_ONLY,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_volte, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_short_seq(
self.log, ads[0], phone_idle_iwlan, is_phone_in_call_iwlan, ads[1],
phone_idle_volte, is_phone_in_call_volte, None,
WAIT_TIME_IN_CALL_FOR_IMS)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="fff9edcd-1ace-4f2d-a09b-06f3eea56cca")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_to_volte_apm_wfc_wifi_preferred(self):
""" Airplane + WiFi Preferred, WiFi calling to VoLTE test
1. Setup PhoneA in airplane mode, WFC mode: WIFI_PREFERRED.
2. Make Sure PhoneB is in LTE mode (with VoLTE enabled).
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
tasks = [(phone_setup_iwlan,
(self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_volte, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_short_seq(
self.log, ads[0], phone_idle_iwlan, is_phone_in_call_iwlan, ads[1],
phone_idle_volte, is_phone_in_call_volte, None,
WAIT_TIME_IN_CALL_FOR_IMS)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="8591554e-4e38-406c-97bf-8921d5329c47")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_to_csfb_3g_wfc_wifi_only(self):
""" WiFi Only, WiFi calling to CSFB 3G test
1. Setup PhoneA WFC mode: WIFI_ONLY.
2. Make Sure PhoneB is in LTE mode (with VoLTE disabled).
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
self.check_band_support(ads[0])
# Turn OFF WiFi for Phone B
set_wifi_to_default(self.log, ads[1])
tasks = [(phone_setup_iwlan,
(self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_csfb, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_short_seq(
self.log, ads[0], phone_idle_iwlan, is_phone_in_call_iwlan, ads[1],
phone_idle_csfb, is_phone_in_call_csfb, None)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="9711888d-5b1e-4d05-86e9-98f94f46098b")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_to_csfb_3g_wfc_wifi_preferred(self):
""" WiFi Preferred, WiFi calling to CSFB 3G test
1. Setup PhoneA WFC mode: WIFI_PREFERRED.
2. Make Sure PhoneB is in LTE mode (with VoLTE disabled).
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
self.check_band_support(ads[0])
# Turn OFF WiFi for Phone B
set_wifi_to_default(self.log, ads[1])
tasks = [(phone_setup_iwlan,
(self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_csfb, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_short_seq(
self.log, ads[0], phone_idle_iwlan, is_phone_in_call_iwlan, ads[1],
phone_idle_csfb, is_phone_in_call_csfb, None)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="902c96a4-858f-43ff-bd56-6d7d27004320")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_to_csfb_3g_apm_wfc_wifi_only(self):
""" Airplane + WiFi Only, WiFi calling to CSFB 3G test
1. Setup PhoneA in airplane mode, WFC mode: WIFI_ONLY.
2. Make Sure PhoneB is in LTE mode (with VoLTE disabled).
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
self.check_band_support(ads[0])
# Turn OFF WiFi for Phone B
set_wifi_to_default(self.log, ads[1])
tasks = [(phone_setup_iwlan,
(self.log, ads[0], True, WFC_MODE_WIFI_ONLY,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_csfb, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_short_seq(
self.log, ads[0], phone_idle_iwlan, is_phone_in_call_iwlan, ads[1],
phone_idle_csfb, is_phone_in_call_csfb, None)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="362a5396-ebda-4706-a73a-d805e5028fd7")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_to_csfb_3g_apm_wfc_wifi_preferred(self):
""" Airplane + WiFi Preferred, WiFi calling to CSFB 3G test
1. Setup PhoneA in airplane mode, WFC mode: WIFI_PREFERRED.
2. Make Sure PhoneB is in LTE mode (with VoLTE disabled).
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
self.check_band_support(ads[0])
# Turn OFF WiFi for Phone B
set_wifi_to_default(self.log, ads[1])
tasks = [(phone_setup_iwlan,
(self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_csfb, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_short_seq(
self.log, ads[0], phone_idle_iwlan, is_phone_in_call_iwlan, ads[1],
phone_idle_csfb, is_phone_in_call_csfb, None)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="647bb859-46bc-4e3e-b6ab-7944d3bbcc26")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_to_3g_wfc_wifi_only(self):
""" WiFi Only, WiFi calling to 3G test
1. Setup PhoneA WFC mode: WIFI_ONLY.
2. Make Sure PhoneB is in 3G mode.
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
self.check_band_support(ads[0])
# Turn OFF WiFi for Phone B
set_wifi_to_default(self.log, ads[1])
tasks = [(phone_setup_iwlan,
(self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_voice_3g, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_short_seq(
self.log, ads[0], phone_idle_iwlan, is_phone_in_call_iwlan, ads[1],
phone_idle_3g, is_phone_in_call_3g, None)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="3688ea1f-a52d-4a35-9df4-d5ed0985e49b")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_to_3g_wfc_wifi_preferred(self):
""" WiFi Preferred, WiFi calling to 3G test
1. Setup PhoneA WFC mode: WIFI_PREFERRED.
2. Make Sure PhoneB is in 3G mode.
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
self.check_band_support(ads[0])
# Turn OFF WiFi for Phone B
set_wifi_to_default(self.log, ads[1])
tasks = [(phone_setup_iwlan,
(self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_voice_3g, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_short_seq(
self.log, ads[0], phone_idle_iwlan, is_phone_in_call_iwlan, ads[1],
phone_idle_3g, is_phone_in_call_3g, None)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="f4efc821-fbaf-4ec2-b89b-5a47354344f0")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_to_3g_apm_wfc_wifi_only(self):
""" Airplane + WiFi Only, WiFi calling to 3G test
1. Setup PhoneA in airplane mode, WFC mode: WIFI_ONLY.
2. Make Sure PhoneB is in 3G mode.
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
self.check_band_support(ads[0])
# Turn OFF WiFi for Phone B
set_wifi_to_default(self.log, ads[1])
tasks = [(phone_setup_iwlan,
(self.log, ads[0], True, WFC_MODE_WIFI_ONLY,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_voice_3g, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_short_seq(
self.log, ads[0], phone_idle_iwlan, is_phone_in_call_iwlan, ads[1],
phone_idle_3g, is_phone_in_call_3g, None)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="2b1345b7-3b62-44bd-91ad-9c5a4925b0e1")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_to_3g_apm_wfc_wifi_preferred(self):
""" Airplane + WiFi Preferred, WiFi calling to 3G test
1. Setup PhoneA in airplane mode, WFC mode: WIFI_PREFERRED.
2. Make Sure PhoneB is in 3G mode.
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
self.check_band_support(ads[0])
# Turn OFF WiFi for Phone B
set_wifi_to_default(self.log, ads[1])
tasks = [(phone_setup_iwlan,
(self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_voice_3g, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_short_seq(
self.log, ads[0], phone_idle_iwlan, is_phone_in_call_iwlan, ads[1],
phone_idle_3g, is_phone_in_call_3g, None)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="7b3fea22-114a-442e-aa12-dde3b6001681")
@TelephonyBaseTest.tel_test_wrap
def test_call_csfb_3g_to_csfb_3g(self):
""" CSFB 3G to CSFB 3G call test
1. Make Sure PhoneA is in LTE mode, VoLTE disabled.
2. Make Sure PhoneB is in LTE mode, VoLTE disabled.
3. Call from PhoneA to PhoneB, accept on PhoneA, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneA, hang up on PhoneB.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
self.check_band_support(ads[0])
# Turn OFF WiFi for Phone B
set_wifi_to_default(self.log, ads[1])
tasks = [(phone_setup_csfb, (self.log, ads[0])), (phone_setup_csfb,
(self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_short_seq(
self.log, ads[0], phone_idle_csfb, is_phone_in_call_csfb, ads[1],
phone_idle_csfb, is_phone_in_call_csfb, None)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="91d751ea-40c8-4ffc-b9d3-03d0ad0902bd")
@TelephonyBaseTest.tel_test_wrap
def test_call_3g_to_3g(self):
""" 3G to 3G call test
1. Make Sure PhoneA is in 3G mode.
2. Make Sure PhoneB is in 3G mode.
3. Call from PhoneA to PhoneB, accept on PhoneA, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneA, hang up on PhoneB.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
self.check_band_support(ads[0])
# Turn OFF WiFi for Phone B
set_wifi_to_default(self.log, ads[1])
tasks = [(phone_setup_voice_3g, (self.log, ads[0])),
(phone_setup_voice_3g, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_short_seq(
self.log, ads[0], phone_idle_3g, is_phone_in_call_3g, ads[1],
phone_idle_3g, is_phone_in_call_3g, None)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="df57c481-010a-4d21-a5c1-5116917871b2")
@TelephonyBaseTest.tel_test_wrap
def test_call_volte_to_volte_long(self):
""" VoLTE to VoLTE call test
1. Make Sure PhoneA is in LTE mode (with VoLTE).
2. Make Sure PhoneB is in LTE mode (with VoLTE).
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
5. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneB.
6. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneA.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
tasks = [(phone_setup_volte, (self.log, ads[0])), (phone_setup_volte,
(self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_long_seq(
self.log, ads[0], phone_idle_volte, is_phone_in_call_volte, ads[1],
phone_idle_volte, is_phone_in_call_volte, None,
WAIT_TIME_IN_CALL_FOR_IMS)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="b0712d8a-71cf-405f-910c-8592da082660")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_to_epdg_long_wfc_wifi_only(self):
""" WiFi Only, WiFi calling to WiFi Calling test
1. Setup PhoneA WFC mode: WIFI_ONLY.
2. Setup PhoneB WFC mode: WIFI_ONLY.
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
5. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneB.
6. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneA.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
tasks = [(phone_setup_iwlan,
(self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_iwlan,
(self.log, ads[1], False, WFC_MODE_WIFI_ONLY,
self.wifi_network_ssid, self.wifi_network_pass))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_long_seq(
self.log, ads[0], phone_idle_iwlan, is_phone_in_call_iwlan, ads[1],
phone_idle_iwlan, is_phone_in_call_iwlan, None,
WAIT_TIME_IN_CALL_FOR_IMS)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="a7293d6c-0fdb-4842-984a-e4c6395fd41d")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_to_epdg_long_wfc_wifi_preferred(self):
""" WiFi Preferred, WiFi calling to WiFi Calling test
1. Setup PhoneA WFC mode: WIFI_PREFERRED.
2. Setup PhoneB WFC mode: WIFI_PREFERRED.
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
5. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneB.
6. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneA.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
tasks = [(phone_setup_iwlan,
(self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_iwlan,
(self.log, ads[1], False, WFC_MODE_WIFI_PREFERRED,
self.wifi_network_ssid, self.wifi_network_pass))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_long_seq(
self.log, ads[0], phone_idle_iwlan, is_phone_in_call_iwlan, ads[1],
phone_idle_iwlan, is_phone_in_call_iwlan, None,
WAIT_TIME_IN_CALL_FOR_IMS)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="029af2a7-aba4-406b-9095-b32da57a7cdb")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_to_epdg_long_apm_wfc_wifi_only(self):
""" Airplane + WiFi Only, WiFi calling to WiFi Calling test
1. Setup PhoneA in airplane mode, WFC mode: WIFI_ONLY.
2. Setup PhoneB in airplane mode, WFC mode: WIFI_ONLY.
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
5. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneB.
6. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneA.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
tasks = [(phone_setup_iwlan,
(self.log, ads[0], True, WFC_MODE_WIFI_ONLY,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_iwlan,
(self.log, ads[1], True, WFC_MODE_WIFI_ONLY,
self.wifi_network_ssid, self.wifi_network_pass))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_long_seq(
self.log, ads[0], phone_idle_iwlan, is_phone_in_call_iwlan, ads[1],
phone_idle_iwlan, is_phone_in_call_iwlan, None,
WAIT_TIME_IN_CALL_FOR_IMS)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="3c751d79-7159-4407-a63c-96f835dd6cb0")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_to_epdg_long_apm_wfc_wifi_preferred(self):
""" Airplane + WiFi Preferred, WiFi calling to WiFi Calling test
1. Setup PhoneA in airplane mode, WFC mode: WIFI_PREFERRED.
2. Setup PhoneB in airplane mode, WFC mode: WIFI_PREFERRED.
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
5. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneB.
6. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneA.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
tasks = [(phone_setup_iwlan,
(self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_iwlan,
(self.log, ads[1], True, WFC_MODE_WIFI_PREFERRED,
self.wifi_network_ssid, self.wifi_network_pass))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_long_seq(
self.log, ads[0], phone_idle_iwlan, is_phone_in_call_iwlan, ads[1],
phone_idle_iwlan, is_phone_in_call_iwlan, None,
WAIT_TIME_IN_CALL_FOR_IMS)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="9deab765-e2da-4826-bae8-ba8755551a1b")
@TelephonyBaseTest.tel_test_wrap
def test_call_csfb_3g_to_csfb_3g_long(self):
""" CSFB 3G to CSFB 3G call test
1. Make Sure PhoneA is in LTE mode, VoLTE disabled.
2. Make Sure PhoneB is in LTE mode, VoLTE disabled.
3. Call from PhoneA to PhoneB, accept on PhoneA, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneA, hang up on PhoneB.
5. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneB.
6. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneA.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
self.check_band_support(ads[0])
# Turn OFF WiFi for Phone B
set_wifi_to_default(self.log, ads[1])
tasks = [(phone_setup_csfb, (self.log, ads[0])), (phone_setup_csfb,
(self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_long_seq(
self.log, ads[0], phone_idle_csfb, is_phone_in_call_csfb, ads[1],
phone_idle_csfb, is_phone_in_call_csfb, None)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="54768178-818f-4126-9e50-4f49e43a6fd3")
@TelephonyBaseTest.tel_test_wrap
def test_call_3g_to_3g_long(self):
""" 3G to 3G call test
1. Make Sure PhoneA is in 3G mode.
2. Make Sure PhoneB is in 3G mode.
3. Call from PhoneA to PhoneB, accept on PhoneA, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneA, hang up on PhoneB.
5. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneB.
6. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneA.
Raises:
TestFailure if not success.
"""
ads = self.android_devices
self.check_band_support(ads[0])
# Turn OFF WiFi for Phone B
set_wifi_to_default(self.log, ads[1])
tasks = [(phone_setup_voice_3g, (self.log, ads[0])),
(phone_setup_voice_3g, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
self.tel_logger.set_result(CallResult("CALL_SETUP_FAILURE"))
raise signals.TestFailure("Failed",
extras={"fail_reason": "Phone Failed to Set Up Properly."})
result = two_phone_call_long_seq(
self.log, ads[0], phone_idle_3g, is_phone_in_call_3g, ads[1],
phone_idle_3g, is_phone_in_call_3g, None)
self.tel_logger.set_result(result.result_value)
if not result:
raise signals.TestFailure("Failed",
extras={"fail_reason": str(result.result_value)})
@test_tracker_info(uuid="")
@TelephonyBaseTest.tel_test_wrap
def test_call_volte_to_volte_loop(self):
""" Stress test: VoLTE to VoLTE call test
1. Make Sure PhoneA is in LTE mode (with VoLTE).
2. Make Sure PhoneB is in LTE mode (with VoLTE).
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
5. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneB.
6. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneA.
7. Repeat step 3~6.
Returns:
True if pass; False if fail.
"""
# TODO: b/26338422 Make this a parameter
MINIMUM_SUCCESS_RATE = .95
ads = self.android_devices
tasks = [(phone_setup_volte, (self.log, ads[0])), (phone_setup_volte,
(self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
return False
success_count = 0
fail_count = 0
for i in range(1, self.stress_test_number + 1):
if two_phone_call_long_seq(
self.log, ads[0], phone_idle_volte, is_phone_in_call_volte,
ads[1], phone_idle_volte, is_phone_in_call_volte, None,
WAIT_TIME_IN_CALL_FOR_IMS):
success_count += 1
result_str = "Succeeded"
else:
fail_count += 1
result_str = "Failed"
self.log.info("Iteration %s %s. Current: %s / %s passed.", i,
result_str, success_count, self.stress_test_number)
self.log.info("Final Count - Success: %s, Failure: %s - %s%",
success_count, fail_count,
str(100 * success_count / (success_count + fail_count)))
if success_count / (
success_count + fail_count) >= MINIMUM_SUCCESS_RATE:
return True
else:
return False
@test_tracker_info(uuid="dfa2c1a7-0e9a-42f2-b3ba-7e196df87e1b")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_to_epdg_loop_wfc_wifi_only(self):
""" Stress test: WiFi Only, WiFi calling to WiFi Calling test
1. Setup PhoneA WFC mode: WIFI_ONLY.
2. Setup PhoneB WFC mode: WIFI_ONLY.
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
5. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneB.
6. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneA.
7. Repeat step 3~6.
Returns:
True if pass; False if fail.
"""
# TODO: b/26338422 Make this a parameter
MINIMUM_SUCCESS_RATE = .95
ads = self.android_devices
tasks = [(phone_setup_iwlan,
(self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_iwlan,
(self.log, ads[1], False, WFC_MODE_WIFI_ONLY,
self.wifi_network_ssid, self.wifi_network_pass))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
return False
success_count = 0
fail_count = 0
for i in range(1, self.stress_test_number + 1):
if two_phone_call_long_seq(
self.log, ads[0], phone_idle_iwlan, is_phone_in_call_iwlan,
ads[1], phone_idle_iwlan, is_phone_in_call_iwlan, None,
WAIT_TIME_IN_CALL_FOR_IMS):
success_count += 1
result_str = "Succeeded"
else:
fail_count += 1
result_str = "Failed"
self.log.info("Iteration %s %s. Current: %s / %s passed.", i,
result_str, success_count, self.stress_test_number)
self.log.info("Final Count - Success: %s, Failure: %s - %s%",
success_count, fail_count,
str(100 * success_count / (success_count + fail_count)))
if success_count / (
success_count + fail_count) >= MINIMUM_SUCCESS_RATE:
return True
else:
return False
@test_tracker_info(uuid="382f97ad-65d4-4ebb-a31b-aa243e01bce4")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_to_epdg_loop_wfc_wifi_preferred(self):
""" Stress test: WiFi Preferred, WiFi Calling to WiFi Calling test
1. Setup PhoneA WFC mode: WIFI_PREFERRED.
2. Setup PhoneB WFC mode: WIFI_PREFERRED.
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
5. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneB.
6. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneA.
7. Repeat step 3~6.
Returns:
True if pass; False if fail.
"""
# TODO: b/26338422 Make this a parameter
MINIMUM_SUCCESS_RATE = .95
ads = self.android_devices
tasks = [(phone_setup_iwlan,
(self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_iwlan,
(self.log, ads[1], False, WFC_MODE_WIFI_PREFERRED,
self.wifi_network_ssid, self.wifi_network_pass))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
return False
success_count = 0
fail_count = 0
for i in range(1, self.stress_test_number + 1):
if two_phone_call_long_seq(
self.log, ads[0], phone_idle_iwlan, is_phone_in_call_iwlan,
ads[1], phone_idle_iwlan, is_phone_in_call_iwlan, None,
WAIT_TIME_IN_CALL_FOR_IMS):
success_count += 1
result_str = "Succeeded"
else:
fail_count += 1
result_str = "Failed"
self.log.info("Iteration %s %s. Current: %s / %s passed.", i,
result_str, success_count, self.stress_test_number)
self.log.info("Final Count - Success: %s, Failure: %s - %s%",
success_count, fail_count,
str(100 * success_count / (success_count + fail_count)))
if success_count / (
success_count + fail_count) >= MINIMUM_SUCCESS_RATE:
return True
else:
return False
@test_tracker_info(uuid="c820e2ea-8a14-421c-b608-9074b716f7dd")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_to_epdg_loop_apm_wfc_wifi_only(self):
""" Stress test: Airplane + WiFi Only, WiFi Calling to WiFi Calling test
1. Setup PhoneA in airplane mode, WFC mode: WIFI_ONLY.
2. Setup PhoneB in airplane mode, WFC mode: WIFI_ONLY.
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
5. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneB.
6. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneA.
7. Repeat step 3~6.
Returns:
True if pass; False if fail.
"""
# TODO: b/26338422 Make this a parameter
MINIMUM_SUCCESS_RATE = .95
ads = self.android_devices
tasks = [(phone_setup_iwlan,
(self.log, ads[0], True, WFC_MODE_WIFI_ONLY,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_iwlan,
(self.log, ads[1], True, WFC_MODE_WIFI_ONLY,
self.wifi_network_ssid, self.wifi_network_pass))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
return False
success_count = 0
fail_count = 0
for i in range(1, self.stress_test_number + 1):
if two_phone_call_long_seq(
self.log, ads[0], phone_idle_iwlan, is_phone_in_call_iwlan,
ads[1], phone_idle_iwlan, is_phone_in_call_iwlan, None,
WAIT_TIME_IN_CALL_FOR_IMS):
success_count += 1
result_str = "Succeeded"
else:
fail_count += 1
result_str = "Failed"
self.log.info("Iteration %s %s. Current: %s / %s passed.", i,
result_str, success_count, self.stress_test_number)
self.log.info("Final Count - Success: %s, Failure: %s - %s%",
success_count, fail_count,
str(100 * success_count / (success_count + fail_count)))
if success_count / (
success_count + fail_count) >= MINIMUM_SUCCESS_RATE:
return True
else:
return False
@test_tracker_info(uuid="3b8cb344-1551-4244-845d-b864501f2fb4")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_to_epdg_loop_apm_wfc_wifi_preferred(self):
""" Stress test: Airplane + WiFi Preferred, WiFi Calling to WiFi Calling test
1. Setup PhoneA in airplane mode, WFC mode: WIFI_PREFERRED.
2. Setup PhoneB in airplane mode, WFC mode: WIFI_PREFERRED.
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
5. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneB.
6. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneA.
7. Repeat step 3~6.
Returns:
True if pass; False if fail.
"""
# TODO: b/26338422 Make this a parameter
MINIMUM_SUCCESS_RATE = .95
ads = self.android_devices
tasks = [(phone_setup_iwlan,
(self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_iwlan,
(self.log, ads[1], True, WFC_MODE_WIFI_PREFERRED,
self.wifi_network_ssid, self.wifi_network_pass))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
return False
success_count = 0
fail_count = 0
for i in range(1, self.stress_test_number + 1):
if two_phone_call_long_seq(
self.log, ads[0], phone_idle_iwlan, is_phone_in_call_iwlan,
ads[1], phone_idle_iwlan, is_phone_in_call_iwlan, None,
WAIT_TIME_IN_CALL_FOR_IMS):
success_count += 1
result_str = "Succeeded"
else:
fail_count += 1
result_str = "Failed"
self.log.info("Iteration %s %s. Current: %s / %s passed.", i,
result_str, success_count, self.stress_test_number)
self.log.info("Final Count - Success: %s, Failure: %s - %s%",
success_count, fail_count,
str(100 * success_count / (success_count + fail_count)))
if success_count / (
success_count + fail_count) >= MINIMUM_SUCCESS_RATE:
return True
else:
return False
@test_tracker_info(uuid="")
@TelephonyBaseTest.tel_test_wrap
def test_call_csfb_3g_to_csfb_3g_loop(self):
""" Stress test: CSFB 3G to CSFB 3G call test
1. Make Sure PhoneA is in LTE mode, VoLTE disabled.
2. Make Sure PhoneB is in LTE mode, VoLTE disabled.
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
5. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneB.
6. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneA.
7. Repeat step 3~6.
Returns:
True if pass; False if fail.
"""
# TODO: b/26338422 Make this a parameter
MINIMUM_SUCCESS_RATE = .95
ads = self.android_devices
self.check_band_support(ads[0])
tasks = [(phone_setup_csfb, (self.log, ads[0])), (phone_setup_csfb,
(self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
return False
success_count = 0
fail_count = 0
for i in range(1, self.stress_test_number + 1):
if two_phone_call_long_seq(
self.log, ads[0], phone_idle_csfb, is_phone_in_call_csfb,
ads[1], phone_idle_csfb, is_phone_in_call_csfb, None):
success_count += 1
result_str = "Succeeded"
else:
fail_count += 1
result_str = "Failed"
self.log.info("Iteration %s %s. Current: %s / %s passed.", i,
result_str, success_count, self.stress_test_number)
self.log.info("Final Count - Success: %s, Failure: %s", success_count,
fail_count)
if success_count / (
success_count + fail_count) >= MINIMUM_SUCCESS_RATE:
return True
else:
return False
@test_tracker_info(uuid="")
@TelephonyBaseTest.tel_test_wrap
def test_call_3g_to_3g_loop(self):
""" Stress test: 3G to 3G call test
1. Make Sure PhoneA is in 3G mode
2. Make Sure PhoneB is in 3G mode
3. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneA.
4. Call from PhoneA to PhoneB, accept on PhoneB, hang up on PhoneB.
5. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneB.
6. Call from PhoneB to PhoneA, accept on PhoneA, hang up on PhoneA.
7. Repeat step 3~6.
Returns:
True if pass; False if fail.
"""
# TODO: b/26338422 Make this a parameter
MINIMUM_SUCCESS_RATE = .95
ads = self.android_devices
self.check_band_support(ads[0])
tasks = [(phone_setup_voice_3g, (self.log, ads[0])),
(phone_setup_voice_3g, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
return False
success_count = 0
fail_count = 0
for i in range(1, self.stress_test_number + 1):
if two_phone_call_long_seq(
self.log, ads[0], phone_idle_3g, is_phone_in_call_3g,
ads[1], phone_idle_3g, is_phone_in_call_3g, None):
success_count += 1
result_str = "Succeeded"
else:
fail_count += 1
result_str = "Failed"
self.log.info("Iteration %s %s. Current: %s / %s passed.", i,
result_str, success_count, self.stress_test_number)
self.log.info("Final Count - Success: %s, Failure: %s", success_count,
fail_count)
if success_count / (
success_count + fail_count) >= MINIMUM_SUCCESS_RATE:
return True
else:
return False
@test_tracker_info(uuid="4043c68a-c5d4-4e1d-9010-ef65b205cab1")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_mo_hold_unhold_wfc_wifi_only(self):
""" WiFi Only, WiFi calling MO call hold/unhold test
1. Setup PhoneA WFC mode: WIFI_ONLY.
2. Make sure PhoneB can make/receive voice call.
3. Call from PhoneA to PhoneB, accept on PhoneB.
4. Hold and unhold on PhoneA.
Returns:
True if pass; False if fail.
"""
ads = self.android_devices
tasks = [(phone_setup_iwlan,
(self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_voice_general, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
return False
ads[0].droid.telecomCallClearCallList()
if num_active_calls(self.log, ads[0]) != 0:
ads[0].log.error("Call List is not empty.")
return False
self.log.info("Begin MO Call Hold/Unhold Test.")
if not call_setup_teardown(
self.log,
ads[0],
ads[1],
ad_hangup=None,
verify_caller_func=is_phone_in_call_iwlan,
verify_callee_func=None):
return False
if not hold_unhold_test(ads[0].log, ads)[0]:
self.log.error("Hold/Unhold test fail.")
return False
if not hangup_call(self.log, ads[0]):
self.log.error("Call Hangup Failed")
return False
return True
@test_tracker_info(uuid="0667535e-dcad-49f0-9b4b-fa45d6c75f5b")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_mo_hold_unhold_wfc_wifi_preferred(self):
""" WiFi Preferred, WiFi calling MO call hold/unhold test
1. Setup PhoneA WFC mode: WIFI_PREFERRED.
2. Make sure PhoneB can make/receive voice call.
3. Call from PhoneA to PhoneB, accept on PhoneB.
4. Hold and unhold on PhoneA.
Returns:
True if pass; False if fail.
"""
ads = self.android_devices
tasks = [(phone_setup_iwlan,
(self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_voice_general, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
return False
ads[0].droid.telecomCallClearCallList()
if num_active_calls(self.log, ads[0]) != 0:
ads[0].log.error("Call List is not empty.")
return False
self.log.info("Begin MO Call Hold/Unhold Test.")
if not call_setup_teardown(
self.log,
ads[0],
ads[1],
ad_hangup=None,
verify_caller_func=is_phone_in_call_iwlan,
verify_callee_func=None):
return False
if not hold_unhold_test(ads[0].log, ads)[0]:
self.log.error("Hold/Unhold test fail.")
return False
if not hangup_call(self.log, ads[0]):
self.log.error("Call Hangup Failed")
return False
return True
@test_tracker_info(uuid="cf318b4c-c920-4e80-b73f-2f092c03a144")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_mo_hold_unhold_apm_wfc_wifi_only(self):
""" Airplane + WiFi Only, WiFi calling MO call hold/unhold test
1. Setup PhoneA in airplane mode, WFC mode: WIFI_ONLY.
2. Make sure PhoneB can make/receive voice call.
3. Call from PhoneA to PhoneB, accept on PhoneB.
4. Hold and unhold on PhoneA.
Returns:
True if pass; False if fail.
"""
ads = self.android_devices
tasks = [(phone_setup_iwlan,
(self.log, ads[0], True, WFC_MODE_WIFI_ONLY,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_voice_general, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
return False
ads[0].droid.telecomCallClearCallList()
if num_active_calls(self.log, ads[0]) != 0:
ads[0].log.error("Call List is not empty.")
return False
self.log.info("Begin MO Call Hold/Unhold Test.")
if not call_setup_teardown(
self.log,
ads[0],
ads[1],
ad_hangup=None,
verify_caller_func=is_phone_in_call_iwlan,
verify_callee_func=None):
return False
if not hold_unhold_test(ads[0].log, ads)[0]:
self.log.error("Hold/Unhold test fail.")
return False
if not hangup_call(self.log, ads[0]):
self.log.error("Call Hangup Failed")
return False
return True
@test_tracker_info(uuid="ace36801-1e7b-4f06-aa0b-17affc8df069")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_mo_hold_unhold_apm_wfc_wifi_preferred(self):
""" Airplane + WiFi Preferred, WiFi calling MO call hold/unhold test
1. Setup PhoneA in airplane mode, WFC mode: WIFI_PREFERRED.
2. Make sure PhoneB can make/receive voice call.
3. Call from PhoneA to PhoneB, accept on PhoneB.
4. Hold and unhold on PhoneA.
Returns:
True if pass; False if fail.
"""
ads = self.android_devices
tasks = [(phone_setup_iwlan,
(self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_voice_general, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
return False
ads[0].droid.telecomCallClearCallList()
if num_active_calls(self.log, ads[0]) != 0:
ads[0].log.error("Call List is not empty.")
return False
self.log.info("Begin MO Call Hold/Unhold Test.")
if not call_setup_teardown(
self.log,
ads[0],
ads[1],
ad_hangup=None,
verify_caller_func=is_phone_in_call_iwlan,
verify_callee_func=None):
return False
if not hold_unhold_test(ads[0].log, ads)[0]:
self.log.error("Hold/Unhold test fail.")
return False
if not hangup_call(self.log, ads[0]):
self.log.error("Call Hangup Failed")
return False
return True
@test_tracker_info(uuid="2ad32874-0d39-4475-8ae3-d6dccda675f5")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_mt_hold_unhold_wfc_wifi_only(self):
""" WiFi Only, WiFi calling MT call hold/unhold test
1. Setup PhoneA WFC mode: WIFI_ONLY.
2. Make sure PhoneB can make/receive voice call.
3. Call from PhoneB to PhoneA, accept on PhoneA.
4. Hold and unhold on PhoneA.
Returns:
True if pass; False if fail.
"""
ads = self.android_devices
tasks = [(phone_setup_iwlan,
(self.log, ads[0], False, WFC_MODE_WIFI_ONLY,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_voice_general, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
return False
ads[0].droid.telecomCallClearCallList()
if num_active_calls(self.log, ads[0]) != 0:
ads[0].log.error("Call List is not empty.")
return False
self.log.info("Begin MT Call Hold/Unhold Test.")
if not call_setup_teardown(
self.log,
ads[1],
ads[0],
ad_hangup=None,
verify_caller_func=None,
verify_callee_func=is_phone_in_call_iwlan):
return False
if not hold_unhold_test(ads[0].log, ads)[0]:
self.log.error("Hold/Unhold test fail.")
return False
if not hangup_call(self.log, ads[0]):
self.log.error("Call Hangup Failed")
return False
return True
@test_tracker_info(uuid="3efd5d59-30ee-45f5-8966-56ce8fadf9a1")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_mt_hold_unhold_wfc_wifi_preferred(self):
""" WiFi Preferred, WiFi calling MT call hold/unhold test
1. Setup PhoneA WFC mode: WIFI_PREFERRED.
2. Make sure PhoneB can make/receive voice call.
3. Call from PhoneB to PhoneA, accept on PhoneA.
4. Hold and unhold on PhoneA.
Returns:
True if pass; False if fail.
"""
ads = self.android_devices
tasks = [(phone_setup_iwlan,
(self.log, ads[0], False, WFC_MODE_WIFI_PREFERRED,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_voice_general, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
return False
ads[0].droid.telecomCallClearCallList()
if num_active_calls(self.log, ads[0]) != 0:
ads[0].log.error("Call List is not empty.")
return False
self.log.info("Begin MT Call Hold/Unhold Test.")
if not call_setup_teardown(
self.log,
ads[1],
ads[0],
ad_hangup=None,
verify_caller_func=None,
verify_callee_func=is_phone_in_call_iwlan):
return False
if not hold_unhold_test(ads[0].log, ads)[0]:
self.log.error("Hold/Unhold test fail.")
return False
return True
@test_tracker_info(uuid="35ed0f89-7435-4d3b-9ebc-c5cdc3f7e32b")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_mt_hold_unhold_apm_wfc_wifi_only(self):
""" Airplane + WiFi Only, WiFi calling MT call hold/unhold test
1. Setup PhoneA in airplane mode, WFC mode: WIFI_ONLY.
2. Make sure PhoneB can make/receive voice call.
3. Call from PhoneB to PhoneA, accept on PhoneA.
4. Hold and unhold on PhoneA.
Returns:
True if pass; False if fail.
"""
ads = self.android_devices
tasks = [(phone_setup_iwlan,
(self.log, ads[0], True, WFC_MODE_WIFI_ONLY,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_voice_general, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
return False
ads[0].droid.telecomCallClearCallList()
if num_active_calls(self.log, ads[0]) != 0:
ads[0].log.error("Call List is not empty.")
return False
self.log.info("Begin MT Call Hold/Unhold Test.")
if not call_setup_teardown(
self.log,
ads[1],
ads[0],
ad_hangup=None,
verify_caller_func=None,
verify_callee_func=is_phone_in_call_iwlan):
return False
if not hold_unhold_test(ads[0].log, ads)[0]:
self.log.error("Hold/Unhold test fail.")
return False
if not hangup_call(self.log, ads[0]):
self.log.error("Call Hangup Failed")
return False
return True
@test_tracker_info("37ad003b-6426-42f7-b528-ec7c1842fd18")
@TelephonyBaseTest.tel_test_wrap
def test_call_epdg_mt_hold_unhold_apm_wfc_wifi_preferred(self):
""" Airplane + WiFi Preferred, WiFi calling MT call hold/unhold test
1. Setup PhoneA in airplane mode, WFC mode: WIFI_PREFERRED.
2. Make sure PhoneB can make/receive voice call.
3. Call from PhoneB to PhoneA, accept on PhoneA.
4. Hold and unhold on PhoneA.
Returns:
True if pass; False if fail.
"""
ads = self.android_devices
tasks = [(phone_setup_iwlan,
(self.log, ads[0], True, WFC_MODE_WIFI_PREFERRED,
self.wifi_network_ssid, self.wifi_network_pass)),
(phone_setup_voice_general, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
return False
ads[0].droid.telecomCallClearCallList()
if num_active_calls(self.log, ads[0]) != 0:
ads[0].log.error("Call List is not empty.")
return False
self.log.info("Begin MT Call Hold/Unhold Test.")
if not call_setup_teardown(
self.log,
ads[1],
ads[0],
ad_hangup=None,
verify_caller_func=None,
verify_callee_func=is_phone_in_call_iwlan):
return False
if not hold_unhold_test(ads[0].log, ads)[0]:
self.log.error("Hold/Unhold test fail.")
return False
if not hangup_call(self.log, ads[0]):
self.log.error("Call Hangup Failed")
return False
return True
@test_tracker_info(uuid="fa37cd37-c30a-4caa-80b4-52507995ec77")
@TelephonyBaseTest.tel_test_wrap
def test_call_volte_mo_hold_unhold(self):
""" VoLTE MO call hold/unhold test
1. Make Sure PhoneA is in LTE mode (with VoLTE).
2. Make Sure PhoneB is able to make/receive call.
3. Call from PhoneA to PhoneB, accept on PhoneB.
4. Hold and unhold on PhoneA.
Returns:
True if pass; False if fail.
"""
ads = self.android_devices
tasks = [(phone_setup_volte, (self.log, ads[0])),
(phone_setup_voice_general, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
return False
ads[0].droid.telecomCallClearCallList()
if num_active_calls(self.log, ads[0]) != 0:
ads[0].log.error("Call List is not empty.")
return False
self.log.info("Begin MO Call Hold/Unhold Test.")
if not call_setup_teardown(
self.log,
ads[0],
ads[1],
ad_hangup=None,
verify_caller_func=is_phone_in_call_volte,
verify_callee_func=None):
return False
if not hold_unhold_test(ads[0].log, ads)[0]:
self.log.error("Hold/Unhold test fail.")
return False
if not hangup_call(self.log, ads[0]):
self.log.error("Call Hangup Failed")
return False
return True
@test_tracker_info(uuid="28a9acb3-83e8-4dd1-82bf-173da8bd2eca")
@TelephonyBaseTest.tel_test_wrap
def test_call_volte_mt_hold_unhold(self):
""" VoLTE MT call hold/unhold test
1. Make Sure PhoneA is in LTE mode (with VoLTE).
2. Make Sure PhoneB is able to make/receive call.
3. Call from PhoneB to PhoneA, accept on PhoneA.
4. Hold and unhold on PhoneA.
Returns:
True if pass; False if fail.
"""
ads = self.android_devices
tasks = [(phone_setup_volte, (self.log, ads[0])),
(phone_setup_voice_general, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
return False
ads[0].droid.telecomCallClearCallList()
if num_active_calls(self.log, ads[0]) != 0:
ads[0].log.error("Call List is not empty.")
return False
self.log.info("Begin MT Call Hold/Unhold Test.")
if not call_setup_teardown(
self.log,
ads[1],
ads[0],
ad_hangup=None,
verify_caller_func=None,
verify_callee_func=is_phone_in_call_volte):
return False
if not hold_unhold_test(ads[0].log, ads)[0]:
self.log.error("Hold/Unhold test fail.")
return False
if not hangup_call(self.log, ads[0]):
self.log.error("Call Hangup Failed")
return False
return True
@test_tracker_info(uuid="ffe724ae-4223-4c15-9fed-9aba17de9a63")
@TelephonyBaseTest.tel_test_wrap
def test_call_wcdma_mo_hold_unhold(self):
""" MO WCDMA hold/unhold test
1. Make Sure PhoneA is in 3G WCDMA mode.
2. Make Sure PhoneB is able to make/receive call.
3. Call from PhoneA to PhoneB, accept on PhoneB.
4. Hold and unhold on PhoneA.
Returns:
True if pass; False if fail.
"""
ads = self.android_devices
self.check_band_support(ads[0])
# make sure PhoneA is GSM phone before proceed.
if (ads[0].droid.telephonyGetPhoneType() != PHONE_TYPE_GSM):
ads[0].log.error(
"Not GSM phone, abort this wcdma hold/unhold test.")
raise signals.TestSkip(
"Not GSM phone, abort this wcdma hold/unhold test")
tasks = [(phone_setup_voice_3g, (self.log, ads[0])),
(phone_setup_voice_general, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
return False
ads[0].droid.telecomCallClearCallList()
if num_active_calls(self.log, ads[0]) != 0:
ads[0].log.error("Call List is not empty.")
return False
self.log.info("Begin MO Call Hold/Unhold Test.")
if not call_setup_teardown(
self.log,
ads[0],
ads[1],
ad_hangup=None,
verify_caller_func=is_phone_in_call_3g,
verify_callee_func=None):
return False
if not hold_unhold_test(ads[0].log, ads)[0]:
self.log.error("Hold/Unhold test fail.")
return False
if not hangup_call(self.log, ads[0]):
self.log.error("Call Hangup Failed")
return False
return True
@test_tracker_info(uuid="23805165-01ce-4351-83d3-73c9fb3bda76")
@TelephonyBaseTest.tel_test_wrap
def test_call_wcdma_mt_hold_unhold(self):
""" MT WCDMA hold/unhold test
1. Make Sure PhoneA is in 3G WCDMA mode.
2. Make Sure PhoneB is able to make/receive call.
3. Call from PhoneB to PhoneA, accept on PhoneA.
4. Hold and unhold on PhoneA.
Returns:
True if pass; False if fail.
"""
ads = self.android_devices
self.check_band_support(ads[0])
# make sure PhoneA is GSM phone before proceed.
if (ads[0].droid.telephonyGetPhoneType() != PHONE_TYPE_GSM):
ads[0].log.error(
"Not GSM phone, abort this wcdma hold/unhold test.")
raise signals.TestSkip(
"Not GSM phone, abort this wcdma hold/unhold test")
tasks = [(phone_setup_voice_3g, (self.log, ads[0])),
(phone_setup_voice_general, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
return False
ads[0].droid.telecomCallClearCallList()
if num_active_calls(self.log, ads[0]) != 0:
ads[0].log.error("Call List is not empty.")
return False
self.log.info("Begin MT Call Hold/Unhold Test.")
if not call_setup_teardown(
self.log,
ads[1],
ads[0],
ad_hangup=None,
verify_caller_func=None,
verify_callee_func=is_phone_in_call_3g):
return False
if not hold_unhold_test(ads[0].log, ads)[0]:
self.log.error("Hold/Unhold test fail.")
return False
if not hangup_call(self.log, ads[0]):
self.log.error("Call Hangup Failed")
return False
return True
@test_tracker_info(uuid="08c846c7-1978-4ece-8f2c-731129947699")
@TelephonyBaseTest.tel_test_wrap
def test_call_csfb_mo_hold_unhold(self):
""" MO CSFB WCDMA/GSM hold/unhold test
1. Make Sure PhoneA is in LTE mode (VoLTE disabled).
2. Make Sure PhoneB is able to make/receive call.
3. Call from PhoneA to PhoneB, accept on PhoneB.
4. Hold and unhold on PhoneA.
Returns:
True if pass; False if fail.
"""
ads = self.android_devices
# make sure PhoneA is GSM phone before proceed.
if (ads[0].droid.telephonyGetPhoneType() != PHONE_TYPE_GSM):
self.log.error("Not GSM phone, abort this wcdma hold/unhold test.")
raise signals.TestSkip(
"Not GSM phone, abort this wcdma hold/unhold test")
tasks = [(phone_setup_csfb, (self.log, ads[0])),
(phone_setup_voice_general, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
return False
ads[0].droid.telecomCallClearCallList()
if num_active_calls(self.log, ads[0]) != 0:
ads[0].log.error("Call List is not empty.")
return False
self.log.info("Begin MO Call Hold/Unhold Test.")
if not call_setup_teardown(
self.log,
ads[0],
ads[1],
ad_hangup=None,
verify_caller_func=is_phone_in_call_csfb,
verify_callee_func=None):
return False
if not hold_unhold_test(ads[0].log, ads)[0]:
self.log.error("Hold/Unhold test fail.")
return False
if not hangup_call(self.log, ads[0]):
self.log.error("Call Hangup Failed")
return False
return True
@test_tracker_info(uuid="a6405fe6-c732-4ae6-bbae-e912a124f4a2")
@TelephonyBaseTest.tel_test_wrap
def test_call_csfb_mt_hold_unhold(self):
""" MT CSFB WCDMA/GSM hold/unhold test
1. Make Sure PhoneA is in LTE mode (VoLTE disabled).
2. Make Sure PhoneB is able to make/receive call.
3. Call from PhoneB to PhoneA, accept on PhoneA.
4. Hold and unhold on PhoneA.
Returns:
True if pass; False if fail.
"""
ads = self.android_devices
# make sure PhoneA is GSM phone before proceed.
if (ads[0].droid.telephonyGetPhoneType() != PHONE_TYPE_GSM):
ads[0].log.error(
"Not GSM phone, abort this wcdma hold/unhold test.")
raise signals.TestSkip(
"Not GSM phone, abort this wcdma hold/unhold test")
tasks = [(phone_setup_csfb, (self.log, ads[0])),
(phone_setup_voice_general, (self.log, ads[1]))]
if not multithread_func(self.log, tasks):
self.log.error("Phone Failed to Set Up Properly.")
return False
ads[0].droid.telecomCallClearCallList()
if num_active_calls(self.log, ads[0]) != 0:
ads[0].log.error("Call List is not empty.")
return False
self.log.info("Begin MT Call Hold/Unhold Test.")
if not call_setup_teardown(
self.log,
ads[1],
ads[0],
ad_hangup=None,
verify_caller_func=None,
verify_callee_func=is_phone_in_call_csfb):
return False
if not hold_unhold_test(ads[0].log, ads)[0]:
self.log.error("Hold/Unhold test fail.")
return False
if not hangup_call(self.log, ads[0]):
self.log.error("Call Hangup Failed")
return False
return True
@test_tracker_info(uuid="5edc5034-90ef-4113-926f-05407ed60a87")
@TelephonyBaseTest.tel_test_wrap