def test_mms_mt_4g(self): """Test MMS text function between two phone. Phones in LTE network. Airplane mode is off. Send SMS from PhoneB to PhoneA. Verify received message on PhoneA is correct. Returns: True if success. False if failed. """ self.log.error("Test Case is non-functional: b/21569494") return False ads = self.android_devices 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 return mms_send_receive_verify( self.log, ads[1], ads[0], [("Test Message", "Basic Message Body", None)])
def test_sms_mt_in_call_iwlan(self): """ Test MT SMS, Phone in APM, WiFi connected, WFC WiFi Preferred mode. Make Sure PhoneA APM, WiFi connected, WFC WiFi preferred mode. Make sure PhoneA report iwlan as data rat. Make Sure PhoneB is able to make/receive call/sms. Call from PhoneA to PhoneB, accept on PhoneB. Receive SMS 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 self.log.info("Begin In Call SMS 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 return self._sms_test_mt(ads)
def test_sms_mt_in_call_vt(self): """ Test MT SMS, Phone in ongoing VT call. Make Sure PhoneA and PhoneB in LTE and can make VT call. Make Video Call from PhoneA to PhoneB, accept on PhoneB as Video Call. Receive SMS on PhoneA. Returns: True if pass; False if fail. """ ads = self.android_devices tasks = [(phone_setup_video, (self.log, ads[0])), (phone_setup_video, (self.log, ads[1]))] if not multithread_func(self.log, tasks): self.log.error("Phone Failed to Set Up Properly.") return False if not video_call_setup_teardown( self.log, ads[0], ads[1], None, video_state=VT_STATE_BIDIRECTIONAL, verify_caller_func=is_phone_in_call_video_bidirectional, verify_callee_func=is_phone_in_call_video_bidirectional): self.log.error("Failed to setup a call") return False return self._sms_test_mt(ads)
def test_sms_mt_in_call_volte(self): """ Test MT SMS during a MO VoLTE call. Make Sure PhoneA is in LTE mode (with VoLTE). Make Sure PhoneB is able to make/receive call. Call from PhoneA to PhoneB, accept on PhoneB, receive SMS on PhoneA. 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 self.log.info("Begin In Call SMS 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 self._sms_test_mt(ads): self.log.error("SMS test fail.") return False return True
def network_switch_test(self, carrier): tasks = [(self.operator_network_switch, [ad, carrier]) for ad in self.android_devices] if not multithread_func(self.log, tasks): abort_all_tests(self.log, "Unable to switch to network %s" % carrier) return True
def test_msim_voice_general(self): """ DSDS 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. 5. Perform steps 3 and 4 with both sub_ids Returns: True if pass; False if fail. """ ads = self.android_devices tasks = [(phone_setup_voice_general_for_slot, (self.log, ads[0], 0)), (phone_setup_voice_general_for_slot, (self.log, ads[1], 0)), (phone_setup_voice_general_for_slot, (self.log, ads[0], 1)), (phone_setup_voice_general_for_slot, (self.log, ads[1], 1))] if not multithread_func(self.log, tasks): self.log.error("Phone Failed to Set Up Properly.") return False return two_phone_call_msim_short_seq(self.log, ads[0], None, None, ads[1], None, None, None)
def _setup_vt(self): ads = self.android_devices tasks = [(phone_setup_video, (self.log, ads[0])), (phone_setup_video, (self.log, ads[1]))] if not multithread_func(self.log, tasks): self.log.error("Phone Failed to Set Up Properly.") return False return True
def test_smoke_wfc_call_sms(self): ads = self.android_devices sms_idle_result = False sms_incall_result = False call_result = False self.log.info("--------start test_smoke_wfc_call_sms--------") for ad in [ads[0], ads[1]]: if not ad.droid.imsIsWfcEnabledByPlatform(): self.log.info("WFC not supported by platform.") return True try: ensure_phones_default_state(self.log, ads) 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 WiFI Calling.") return False self.log.info("1. Verify SMS in idle.") if sms_send_receive_verify(self.log, ads[0], ads[1], [rand_ascii_str(50)]): sms_idle_result = True self.log.info("2. Setup WiFi Call.") 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=is_phone_in_call_iwlan): self.log.error("Setup WiFi Call Failed.") self.log.info("sms_idle_result:{}".format(sms_idle_result)) return False self.log.info("3. Verify SMS in call.") if sms_send_receive_verify(self.log, ads[0], ads[1], [rand_ascii_str(51)]): sms_incall_result = True self.log.info("4. Verify Call not drop and hangup.") if (is_phone_in_call_iwlan(self.log, ads[0]) and is_phone_in_call_iwlan(self.log, ads[1]) and hangup_call(self.log, ads[0])): call_result = True return (call_result and sms_idle_result and sms_incall_result) finally: self.log.info( "Summary for test run. Testbed:<{}>. <WFC> SMS idle: {}, " "SMS in call: {}, Voice Call: {}".format( getattr(self, Config.ikey_testbed_name.value), sms_idle_result, sms_incall_result, call_result))
def __init__(self, controllers): BaseTestClass.__init__(self, controllers) self.wifi_network_ssid = self.user_params.get( "wifi_network_ssid") or self.user_params.get( "wifi_network_ssid_2g") or self.user_params.get( "wifi_network_ssid_5g") self.wifi_network_pass = self.user_params.get( "wifi_network_pass") or self.user_params.get( "wifi_network_pass_2g") or self.user_params.get( "wifi_network_ssid_5g") self.log_path = getattr(logging, "log_path", None) self.qxdm_log = self.user_params.get("qxdm_log", True) self.enable_radio_log_on = self.user_params.get( "enable_radio_log_on", True) tasks = [(self._init_device, [ad]) for ad in self.android_devices] multithread_func(self.log, tasks) self.skip_reset_between_cases = self.user_params.get( "skip_reset_between_cases", True) self.log_path = getattr(logging, "log_path", None)
def test_project_fi_account_activation(self): """Test activate Fi account. Returns: True if success. False if failed. """ tasks = [(self._account_registration, [ad]) for ad in self.android_devices] try: if not multithread_func(self.log, tasks): abort_all_tests(self.log, "Unable to activate Fi account!") except Exception as e: self.log.error(e) abort_all_tests(self.log, "Unable to activate Fi account!") return True
def test_sms_mt_2g(self): """Test SMS basic function between two phone. Phones in 3g network. Airplane mode is off. Send SMS from PhoneB to PhoneA. Verify received message on PhoneA is correct. Returns: True if success. False if failed. """ ads = self.android_devices tasks = [(phone_setup_voice_2g, (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 return self._sms_test_mt(ads)
def test_ota_upgrade(self): ota_package = self.user_params.get("ota_package") if isinstance(ota_package, list): ota_package = ota_package[0] if ota_package and "dev/null" not in ota_package: self.log.info("Upgrade with ota_package %s", ota_package) self.log.info("Before OTA upgrade: %s", get_info(self.android_devices)) else: raise signals.TestSkip("No ota_package is defined") ota_util = self.user_params.get("ota_util") if isinstance(ota_util, list): ota_util = ota_util[0] if ota_util: if "update_engine_client.zip" in ota_util: self.user_params["UpdateDeviceOtaTool"] = ota_util self.user_params["ota_tool"] = "UpdateDeviceOtaTool" else: self.user_params["AdbSideloadOtaTool"] = ota_util self.user_params["ota_tool"] = "AdbSideloadOtaTool" self.log.info("OTA upgrade with %s by %s", ota_package, self.user_params["ota_tool"]) ota_updater.initialize(self.user_params, self.android_devices) tasks = [(self._ota_upgrade, [ad]) for ad in self.android_devices] try: result = multithread_func(self.log, tasks) except Exception as err: abort_all_tests(self.log, "Unable to do ota upgrade: %s" % err) device_info = get_info(self.android_devices) self.log.info("After OTA upgrade: %s", device_info) self.results.add_controller_info("AndroidDevice", device_info) if len(self.android_devices) > 1: caller = self.android_devices[0] callee = self.android_devices[1] return call_setup_teardown( self.log, caller, callee, caller, self._get_call_verification_function(caller), self._get_call_verification_function(callee)) and result return result
def test_internet_access_during_video_call(self): """ Test Internet access during VT<->VT call. Make Sure PhoneA is in LTE mode (with Video Calling). Make Sure PhoneB is in LTE mode (with Video Calling). Call from PhoneA to PhoneB as Bi-Directional Video, Accept on PhoneB as video call. Verify PhoneA have Internet access. Hang up on PhoneA. Returns: True if pass; False if fail. """ ads = self.android_devices tasks = [(phone_setup_video, (self.log, ads[0])), (phone_setup_video, (self.log, ads[1]))] if not multithread_func(self.log, tasks): self.log.error("Phone Failed to Set Up Properly.") return False self.log.info("Step1: Make MO VT call.") if not video_call_setup_teardown( self.log, ads[0], ads[1], None, video_state=VT_STATE_BIDIRECTIONAL, verify_caller_func=is_phone_in_call_video_bidirectional, verify_callee_func=is_phone_in_call_video_bidirectional): self.log.error("Failed to setup+teardown a call") return False self.log.info("Step2: Verify Internet on PhoneA.") if not verify_http_connection(self.log, ads[0]): self.log.error("Verify Internet on PhoneA failed.") return False return hangup_call(self.log, ads[0])
def test_call_video_to_video_wifi_preferred_apm(self): """ Test ViWifi<->ViWifi call functionality in APM Mode. Make Sure PhoneA is in iWLAN mode (with Video Calling). Make Sure PhoneB is in iWLAN mode (with Video Calling). Turn on APM Mode Connect to Wifi Call from PhoneA to PhoneB as Bi-Directional Video, Accept on PhoneB as video call, hang up 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_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 if not video_call_setup_teardown( self.log, ads[0], ads[1], ads[0], video_state=VT_STATE_BIDIRECTIONAL, verify_caller_func=is_phone_in_call_viwifi_bidirectional, verify_callee_func=is_phone_in_call_viwifi_bidirectional): self.log.error("Failed to setup+teardown a call") return False return True
def test_sms_mt_in_call_wcdma(self): """ Test MT SMS during a MO wcdma call. Make Sure PhoneA is in wcdma mode. Make Sure PhoneB is able to make/receive call. Call from PhoneA to PhoneB, accept on PhoneB, receive SMS 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 SMS test.") return False tasks = [(phone_setup_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 return self._mt_sms_in_3g_call(ads)
def test_sms_mt_iwlan(self): """ Test MT SMS, Phone in APM, WiFi connected, WFC WiFi Preferred mode. Make Sure PhoneA APM, WiFi connected, WFC WiFi preferred mode. Make sure PhoneA report iwlan as data rat. Make Sure PhoneB is able to make/receive call/sms. Receive SMS 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 return self._sms_test_mt(ads)
def test_msim_sms_general(self): """Test SMS basic function between two phone. Phones in any network. Airplane mode is off. Send SMS from PhoneA (sub_id 0 and 1) to PhoneB (sub_id 0 and 1) Verify received message on PhoneB is correct. Returns: True if success. False if failed. """ ads = self.android_devices tasks = [(phone_setup_voice_general_for_slot, (self.log, ads[0], 0)), (phone_setup_voice_general_for_slot, (self.log, ads[1], 0)), (phone_setup_voice_general_for_slot, (self.log, ads[0], 1)), (phone_setup_voice_general_for_slot, (self.log, ads[1], 1))] if not multithread_func(self.log, tasks): self.log.error("Phone Failed to Set Up Properly.") return False time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING) return self._sms_test_dsds(ads)
def test_sms_mo_in_call_csfb_1x(self): """ Test MO SMS during a MO csfb 1x call. Make Sure PhoneA is in LTE mode (no VoLTE). Make Sure PhoneB is able to make/receive call. Call from PhoneA to PhoneB, accept on PhoneB, send SMS on PhoneA. Returns: True if pass; False if fail. """ ads = self.android_devices # make sure PhoneA is CDMA phone before proceed. if (ads[0].droid.telephonyGetPhoneType() != PHONE_TYPE_CDMA): self.log.error("Not CDMA phone, abort this csfb 1x SMS test.") return False 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 self.log.info("Begin In Call SMS Test.") if not call_setup_teardown(self.log, ads[0], ads[1], ad_hangup=None, verify_caller_func=is_phone_in_call_1x, verify_callee_func=None): return False if not self._sms_test_mo(ads): self.log.error("SMS test fail.") return False return True
def setup_class(self): qxdm_log_mask_cfg = self.user_params.get("qxdm_log_mask_cfg", None) if isinstance(qxdm_log_mask_cfg, list): qxdm_log_mask_cfg = qxdm_log_mask_cfg[0] if qxdm_log_mask_cfg and "dev/null" in qxdm_log_mask_cfg: qxdm_log_mask_cfg = None sim_conf_file = self.user_params.get("sim_conf_file") if not sim_conf_file: self.log.info("\"sim_conf_file\" is not provided test bed config!") else: if isinstance(sim_conf_file, list): sim_conf_file = sim_conf_file[0] # If the sim_conf_file is not a full path, attempt to find it # relative to the config file. if not os.path.isfile(sim_conf_file): sim_conf_file = os.path.join( self.user_params[Config.key_config_path], sim_conf_file) if not os.path.isfile(sim_conf_file): self.log.error("Unable to load user config %s ", sim_conf_file) tasks = [(self._setup_device, [ad, sim_conf_file, qxdm_log_mask_cfg]) for ad in self.android_devices] return multithread_func(self.log, tasks)
def test_sms_mt_in_call_gsm(self): """ Test MT SMS during a MO gsm call. Make Sure PhoneA is in gsm mode. Make Sure PhoneB is able to make/receive call. Call from PhoneA to PhoneB, accept on PhoneB, receive SMS 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 gsm SMS test.") return False tasks = [(phone_setup_voice_2g, (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 self.log.info("Begin In Call SMS Test.") if not call_setup_teardown(self.log, ads[0], ads[1], ad_hangup=None, verify_caller_func=is_phone_in_call_2g, verify_callee_func=None): return False if not self._sms_test_mt(ads): self.log.error("SMS test fail.") return False return True
def setup_class(self): super().setup_class() self.wifi_network_ssid = self.user_params.get( "wifi_network_ssid") or self.user_params.get( "wifi_network_ssid_2g") or self.user_params.get( "wifi_network_ssid_5g") self.wifi_network_pass = self.user_params.get( "wifi_network_pass") or self.user_params.get( "wifi_network_pass_2g") or self.user_params.get( "wifi_network_ssid_5g") self.log_path = getattr(logging, "log_path", None) self.qxdm_log = self.user_params.get("qxdm_log", True) self.sdm_log = self.user_params.get("sdm_log", False) self.enable_radio_log_on = self.user_params.get( "enable_radio_log_on", False) self.cbrs_esim = self.user_params.get("cbrs_esim", False) self.account_util = self.user_params.get("account_util", None) self.save_passing_logs = self.user_params.get("save_passing_logs", False) if isinstance(self.account_util, list): self.account_util = self.account_util[0] self.fi_util = self.user_params.get("fi_util", None) if isinstance(self.fi_util, list): self.fi_util = self.fi_util[0] tasks = [(self._init_device, [ad]) for ad in self.android_devices] multithread_func(self.log, tasks) self.skip_reset_between_cases = self.user_params.get( "skip_reset_between_cases", True) self.log_path = getattr(logging, "log_path", None) self.sim_config = { "config":SINGLE_SIM_CONFIG, "number_of_sims":1 } for ad in self.android_devices: if hasattr(ad, "dsds"): self.sim_config = { "config":MULTI_SIM_CONFIG, "number_of_sims":2 } break if "anritsu_md8475a_ip_address" in self.user_params: return qxdm_log_mask_cfg = self.user_params.get("qxdm_log_mask_cfg", None) if isinstance(qxdm_log_mask_cfg, list): qxdm_log_mask_cfg = qxdm_log_mask_cfg[0] if qxdm_log_mask_cfg and "dev/null" in qxdm_log_mask_cfg: qxdm_log_mask_cfg = None sim_conf_file = self.user_params.get("sim_conf_file") if not sim_conf_file: self.log.info("\"sim_conf_file\" is not provided test bed config!") else: if isinstance(sim_conf_file, list): sim_conf_file = sim_conf_file[0] # If the sim_conf_file is not a full path, attempt to find it # relative to the config file. if not os.path.isfile(sim_conf_file): sim_conf_file = os.path.join( self.user_params[Config.key_config_path.value], sim_conf_file) if not os.path.isfile(sim_conf_file): self.log.error("Unable to load user config %s ", sim_conf_file) tasks = [(self._setup_device, [ad, sim_conf_file, qxdm_log_mask_cfg]) for ad in self.android_devices] return multithread_func(self.log, tasks)
def test_smoke_volte_call_data_sms(self): try: ads = self.android_devices sms_idle_result = False sms_incall_result = False data_idle_result = False data_incall_result = False call_result = False self.log.info( "--------start test_smoke_volte_call_data_sms--------") ensure_phones_default_state(self.log, ads) 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 VoLTE.") return False # This is to reduce call fail in VoLTE mode. # TODO: b/26338170 remove sleep, use proper API to check DUT status. time.sleep(10) self.log.info("1. SMS in LTE idle.") sms_idle_result = sms_send_receive_verify(self.log, ads[0], ads[1], [rand_ascii_str(50)]) self.log.info("2. Data in LTE idle.") if (wait_for_cell_data_connection(self.log, ads[0], True) and verify_http_connection(self.log, ads[0])): data_idle_result = True self.log.info("3. Setup VoLTE Call.") 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=is_phone_in_call_volte, wait_time_in_call=WAIT_TIME_IN_CALL_FOR_IMS): self.log.error("Setup VoLTE Call Failed.") return False self.log.info("4. Verify SMS in call.") sms_incall_result = sms_send_receive_verify( self.log, ads[0], ads[1], [rand_ascii_str(51)]) self.log.info("5. Verify Data in call.") if (wait_for_cell_data_connection(self.log, ads[0], True) and verify_http_connection(self.log, ads[0])): data_incall_result = True self.log.info("6. Verify Call not drop and hangup.") if (is_phone_in_call_volte(self.log, ads[0]) and is_phone_in_call_volte(self.log, ads[1]) and hangup_call(self.log, ads[0])): call_result = True return (sms_idle_result and data_idle_result and call_result and sms_incall_result and data_incall_result) finally: self.log.info( "Summary for test run. Testbed:<{}>. <VoLTE> SMS idle: {}, " "Data idle: {}, SMS in call: {}, Data in call: {}, " "Voice Call: {}".format( getattr(self, Config.ikey_testbed_name.value), sms_idle_result, data_idle_result, sms_incall_result, data_incall_result, call_result))
def test_smoke_3g_call_data_sms(self): try: ads = self.android_devices sms_idle_result = False sms_incall_result = False data_idle_result = False data_incall_result = False call_result = False self.log.info("--------start test_smoke_3g_call_data_sms--------") ensure_phones_default_state(self.log, ads) 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 3G.") return False self.log.info("1. SMS in 3G idle.") sms_idle_result = sms_send_receive_verify(self.log, ads[0], ads[1], [rand_ascii_str(50)]) self.log.info("2. Data in 3G idle.") if (wait_for_cell_data_connection(self.log, ads[0], True) and verify_http_connection(self.log, ads[0])): data_idle_result = True self.log.info("3. Setup 3G Call.") 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=is_phone_in_call_3g): self.log.error("Setup 3G Call Failed.") return False self.log.info("4. Verify SMS in call.") sms_incall_result = sms_send_receive_verify( self.log, ads[0], ads[1], [rand_ascii_str(51)]) self.log.info("5. Verify Data in call.") if is_rat_svd_capable( get_network_rat(self.log, ads[0], NETWORK_SERVICE_VOICE)): if (wait_for_cell_data_connection(self.log, ads[0], True) and verify_http_connection(self.log, ads[0])): data_incall_result = True else: self.log.info("Data in call not supported on current RAT." "Skip Data verification.") data_incall_result = SKIP self.log.info("6. Verify Call not drop and hangup.") if (is_phone_in_call_3g(self.log, ads[0]) and is_phone_in_call_3g(self.log, ads[1]) and hangup_call(self.log, ads[0])): call_result = True return (sms_idle_result and data_idle_result and call_result and sms_incall_result and ((data_incall_result is True) or (data_incall_result == SKIP))) finally: self.log.info( "Summary for test run. Testbed:<{}>. <3G> SMS idle: {}, " "Data idle: {}, SMS in call: {}, Data in call: {}, " "Voice Call: {}".format( getattr(self, Config.ikey_testbed_name.value), sms_idle_result, data_idle_result, sms_incall_result, data_incall_result, call_result))
def _test_msim_call_voice(self, mo_slot, mt_slot, dds_slot, mo_rat=["", ""], mt_rat=["", ""], call_direction="mo"): """Make MO/MT voice call at specific slot in specific RAT with DDS at specific slot. Test step: 1. Get sub IDs of specific slots of both MO and MT devices. 2. Switch DDS to specific slot. 3. Check HTTP connection after DDS switch. 4. Set up phones in desired RAT. 5. Make voice call. Args: mo_slot: Slot making MO call (0 or 1) mt_slot: Slot receiving MT call (0 or 1) dds_slot: Preferred data slot mo_rat: RAT for both slots of MO device mt_rat: RAT for both slots of MT device call_direction: "mo" or "mt" Returns: TestFailure if failed. """ ads = self.android_devices if call_direction == "mo": ad_mo = ads[0] ad_mt = ads[1] else: ad_mo = ads[1] ad_mt = ads[0] if mo_slot is not None: mo_sub_id = get_subid_from_slot_index(self.log, ad_mo, mo_slot) if mo_sub_id == INVALID_SUB_ID: ad_mo.log.warning("Failed to get sub ID ar slot %s.", mo_slot) return False mo_other_sub_id = get_subid_from_slot_index( self.log, ad_mo, 1 - mo_slot) set_incoming_voice_sub_id(ad_mo, mo_sub_id) else: _, mo_sub_id, _ = get_subid_on_same_network_of_host_ad(ads) if mo_sub_id == INVALID_SUB_ID: ad_mo.log.warning("Failed to get sub ID ar slot %s.", mo_slot) return False mo_slot = "auto" set_incoming_voice_sub_id(ad_mo, mo_sub_id) ad_mo.log.info("Sub ID for outgoing call at slot %s: %s", mo_slot, get_outgoing_voice_sub_id(ad_mo)) if mt_slot is not None: mt_sub_id = get_subid_from_slot_index(self.log, ad_mt, mt_slot) if mt_sub_id == INVALID_SUB_ID: ad_mt.log.warning("Failed to get sub ID at slot %s.", mt_slot) return False mt_other_sub_id = get_subid_from_slot_index( self.log, ad_mt, 1 - mt_slot) set_incoming_voice_sub_id(ad_mt, mt_sub_id) else: _, mt_sub_id, _ = get_subid_on_same_network_of_host_ad(ads) if mt_sub_id == INVALID_SUB_ID: ad_mt.log.warning("Failed to get sub ID at slot %s.", mt_slot) return False mt_slot = "auto" set_incoming_voice_sub_id(ad_mt, mt_sub_id) ad_mt.log.info("Sub ID for incoming call at slot %s: %s", mt_slot, get_incoming_voice_sub_id(ad_mt)) self.log.info("Step 1: Switch DDS.") if dds_slot: if not set_dds_on_slot_1(ads[0]): ads[0].log.warning("Failed to set DDS at eSIM.") return False else: if not set_dds_on_slot_0(ads[0]): ads[0].log.warning("Failed to set DDS at pSIM.") return False self.log.info("Step 2: Check HTTP connection after DDS switch.") if not verify_http_connection(self.log, ads[0], url="https://www.google.com", retry=5, retry_interval=15, expected_state=True): self.log.error("Failed to verify http connection.") return False else: self.log.info("Verify http connection successfully.") if mo_rat[0] == "volte": mo_slot0_phone_setup_func = phone_setup_volte is_mo_slot0_in_call = is_phone_in_call_volte elif mo_rat[0] == "csfb": mo_slot0_phone_setup_func = phone_setup_csfb is_mo_slot0_in_call = is_phone_in_call_csfb elif mo_rat[0] == "3g": mo_slot0_phone_setup_func = phone_setup_voice_3g is_mo_slot0_in_call = is_phone_in_call_3g elif not mo_rat[0] or mo_rat[0] == "general": mo_slot0_phone_setup_func = phone_setup_voice_general is_mo_slot0_in_call = None if mo_rat[1] == "volte": mo_slot1_phone_setup_func = phone_setup_volte is_mo_slot1_in_call = is_phone_in_call_volte elif mo_rat[1] == "csfb": mo_slot1_phone_setup_func = phone_setup_csfb is_mo_slot1_in_call = is_phone_in_call_csfb elif mo_rat[1] == "3g": mo_slot1_phone_setup_func = phone_setup_voice_3g is_mo_slot1_in_call = is_phone_in_call_3g elif not mo_rat[1] or mo_rat[1] == "general": mo_slot1_phone_setup_func = phone_setup_voice_general is_mo_slot1_in_call = None if mt_rat[0] == "volte": mt_slot0_phone_setup_func = phone_setup_volte is_mt_slot0_in_call = is_phone_in_call_volte elif mt_rat[0] == "csfb": mt_slot0_phone_setup_func = phone_setup_csfb is_mt_slot0_in_call = is_phone_in_call_csfb elif mt_rat[0] == "3g": mt_slot0_phone_setup_func = phone_setup_voice_3g is_mt_slot0_in_call = is_phone_in_call_3g elif not mt_rat[0] or mt_rat[0] == "general": mt_slot0_phone_setup_func = phone_setup_voice_general is_mt_slot0_in_call = None if mt_rat[1] == "volte": mt_slot1_phone_setup_func = phone_setup_volte is_mt_slot1_in_call = is_phone_in_call_volte elif mt_rat[1] == "csfb": mt_slot1_phone_setup_func = phone_setup_csfb is_mt_slot1_in_call = is_phone_in_call_csfb elif mt_rat[1] == "3g": mt_slot1_phone_setup_func = phone_setup_voice_3g is_mt_slot1_in_call = is_phone_in_call_3g elif not mt_rat[1] or mt_rat[1] == "general": mt_slot1_phone_setup_func = phone_setup_voice_general is_mt_slot1_in_call = None if mo_slot == 1: mo_phone_setup_func = mo_slot1_phone_setup_func is_mo_in_call = is_mo_slot1_in_call if mo_rat[0] == "volte": phone_setup_volte_for_subscription(self.log, ad_mo, mo_other_sub_id) elif mo_rat[0] == "csfb": phone_setup_csfb_for_subscription(self.log, ad_mo, mo_other_sub_id) elif mo_rat[0] == "3g": phone_setup_voice_3g_for_subscription(self.log, ad_mo, mo_other_sub_id) elif not mo_rat[0] or mo_rat[0] == "general": phone_setup_voice_general_for_subscription( self.log, ad_mo, mo_other_sub_id) elif mo_slot == 0: mo_phone_setup_func = mo_slot0_phone_setup_func is_mo_in_call = is_mo_slot0_in_call if mo_rat[1] == "volte": phone_setup_volte_for_subscription(self.log, ad_mo, mo_other_sub_id) elif mo_rat[1] == "csfb": phone_setup_csfb_for_subscription(self.log, ad_mo, mo_other_sub_id) elif mo_rat[1] == "3g": phone_setup_voice_3g_for_subscription(self.log, ad_mo, mo_other_sub_id) elif not mo_rat[1] or mo_rat[1] == "general": phone_setup_voice_general_for_subscription( self.log, ad_mo, mo_other_sub_id) else: mo_phone_setup_func = phone_setup_voice_general is_mo_in_call = None if mt_slot == 1: mt_phone_setup_func = mt_slot1_phone_setup_func is_mt_in_call = is_mt_slot1_in_call if mt_rat[0] == "volte": phone_setup_volte_for_subscription(self.log, ad_mt, mt_other_sub_id) elif mt_rat[0] == "csfb": phone_setup_csfb_for_subscription(self.log, ad_mt, mt_other_sub_id) elif mt_rat[0] == "3g": phone_setup_voice_3g_for_subscription(self.log, ad_mt, mt_other_sub_id) elif not mt_rat[0] or mt_rat[0] == "general": phone_setup_voice_general_for_subscription( self.log, ad_mt, mt_other_sub_id) elif mt_slot == 0: mt_phone_setup_func = mt_slot0_phone_setup_func is_mt_in_call = is_mt_slot0_in_call if mt_rat[1] == "volte": phone_setup_volte_for_subscription(self.log, ad_mt, mt_other_sub_id) elif mt_rat[1] == "csfb": phone_setup_csfb_for_subscription(self.log, ad_mt, mt_other_sub_id) elif mt_rat[1] == "3g": phone_setup_voice_3g_for_subscription(self.log, ad_mt, mt_other_sub_id) elif not mt_rat[1] or mt_rat[1] == "general": phone_setup_voice_general_for_subscription( self.log, ad_mt, mt_other_sub_id) else: mt_phone_setup_func = phone_setup_voice_general is_mt_in_call = None self.log.info("Step 3: Set up phones in desired RAT.") tasks = [(mo_phone_setup_func, (self.log, ad_mo)), (mt_phone_setup_func, (self.log, ad_mt))] 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."}) self.log.info("Step 4: Make voice call.") result = two_phone_call_msim_for_slot( self.log, ad_mo, get_slot_index_from_subid(self.log, ad_mo, mo_sub_id), None, is_mo_in_call, ad_mt, get_slot_index_from_subid(self.log, ad_mt, mt_sub_id), None, is_mt_in_call) self.tel_logger.set_result(result.result_value) if not result: self.log.error( "Failed to make MO call from %s slot %s to %s slot %s", ad_mo.serial, mo_slot, ad_mt.serial, mt_slot) raise signals.TestFailure( "Failed", extras={"fail_reason": str(result.result_value)})
def _telephony_monitor_test(self): """ Steps - 1. Reboot the phone 2. Start Telephony Monitor using adb/developer options 3. Verify if it is running 4. Phone Call from A to B 5. Answer on B 6. Trigger ModemSSR on B 7. There will be a call drop with Media Timeout/Server Unreachable 8. Parse logcat to confirm that Expected Results: UI Notification is received by User Returns: True is pass, False if fail. """ # Reboot ads = self.android_devices ads[0].adb.shell( "am start -n com.android.settings/.DevelopmentSettings", ignore_status=True) ads[0].log.info("reboot!") ads[0].reboot() ads[0].log.info("wait %d secs for radio up." % WAIT_TIME_AFTER_REBOOT) time.sleep(WAIT_TIME_AFTER_REBOOT) # Ensure apk is running if not ads[0].is_apk_running("com.google.telephonymonitor"): ads[0].log.info("TelephonyMonitor is not running, start it now") ads[0].adb.shell( 'am broadcast -a ' 'com.google.gservices.intent.action.GSERVICES_OVERRIDE -e ' '"ce.telephony_monitor_enable" "true"') # Setup Phone Call caller_number = ads[0].cfg['subscription'][get_outgoing_voice_sub_id( ads[0])]['phone_num'] callee_number = ads[1].cfg['subscription'][get_incoming_voice_sub_id( ads[1])]['phone_num'] 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.") return False if not initiate_call(ads[0].log, ads[0], callee_number): ads[0].log.error("Phone was unable to initate a call") return False if not wait_and_answer_call(self.log, ads[1], caller_number): ads[0].log.error("wait_and_answer_call failed") return False # Modem SSR time.sleep(5) ads[1].log.info("Triggering ModemSSR") ads[1].adb.shell("echo restart > /sys/kernel/debug/msm_subsys/modem", ignore_status=True) time.sleep(60) # Parse logcat for UI notification if ads[0].search_logcat("Bugreport notification title Call Drop:"): ads[0].log.info("User got the Call Drop Notification") else: ads[0].log.error("User didn't get Call Drop Notification in 1 min") return False return True
def test_set_qxdm_log_mask_qc_default(self): """Set the QXDM Log mask to QC_Default.cfg""" tasks = [(set_qxdm_logger_command, [ad, " QC_Default.cfg"]) for ad in self.android_devices] return multithread_func(self.log, tasks)
def test_set_qxdm_log_mask_ims(self): """Set the QXDM Log mask to IMS_DS_CNE_LnX_Golden.cfg""" tasks = [(set_qxdm_logger_command, [ad, "IMS_DS_CNE_LnX_Golden.cfg"]) for ad in self.android_devices] return multithread_func(self.log, tasks)
def teardown_class(self): tasks = [(self._teardown_device, [ad]) for ad in self.android_devices] multithread_func(self.log, tasks) return True