def test_apm_wfc_cellular_preferred_to_wifi_preferred(self):
        """Test for WiFi Calling settings:
        APM + WiFi Connected + Cellular Preferred, change WFC to WiFi Preferred

        Steps:
        1. Setup DUT Idle, airplane mode.
        2. Make sure DUT WiFi connected, WFC is set to Cellular Preferred.
            Verify DUT WFC not available.
        3. Change WFC setting to WiFi Preferred.
        4. Verify DUT report WFC available.

        Expected Results:
        2. DUT WiFi Calling feature bit return True, network rat is iwlan.
        4. DUT WiFI Calling feature bit return True, network rat is iwlan.
        """
        if WFC_MODE_WIFI_PREFERRED not in self.dut_wfc_modes:
            raise signals.TestSkip("WFC_MODE_WIFI_PREFERRED is not supported")
        if WFC_MODE_CELLULAR_PREFERRED not in self.dut_wfc_modes:
            raise signals.TestSkip(
                "WFC_MODE_CELLULAR_PREFERRED is not supported")
        if not self.change_ims_setting(True, True, True, True,
                                       WFC_MODE_CELLULAR_PREFERRED):
            return False
        return self.change_ims_setting(True, True, True, True,
                                       WFC_MODE_WIFI_PREFERRED)
    def test_fake_emergency_call_by_emergency_dialer_wfc_apm_off(self):
        """Test emergency call with emergency dialer in user account.

        Configure DUT in WFC APM off.
        Add system emergency number list with fake emergency number.
        Use the emergency dialer to call fake emergency number.
        Verify DUT has in call activity.
        Bring DUT to normal state and make regular call.

        Returns:
            True if success.
            False if failed.
        """
        if CAPABILITY_WFC not in operator_capabilities.get(
                self.dut_operator, operator_capabilities["default"]):
            raise signals.TestSkip("WFC is not supported for carrier %s" %
                                   self.dut_operator)
        if self.dut_operator != "tmo":
            raise signals.TestSkip(
                "WFC in non-APM is not supported for carrier %s" %
                self.dut_operator)
        if not phone_setup_iwlan(
                self.log, self.dut, False, WFC_MODE_WIFI_PREFERRED,
                self.wifi_network_ssid, self.wifi_network_pass):
            self.dut.log.error("Failed to setup WFC.")
            return False
        self.set_ims_first("false")
        return self.fake_emergency_call_test() and self.check_normal_call()
示例#3
0
    def test_reboot_stress_wfc_nonapm(self):
        """Reboot with WFC in APM Test

        Steps:
            1. Reboot DUT with wfc in apm mode.
            2. Check phone call .
            3. Check crashes.
            4. Repeat Step 1~4 for N times. (before reboot, clear Provisioning
                bit if provisioning is supported)

        Expected Results:
            No crash happens in stress test.

        Returns:
            True is pass, False if fail.
        """
        if CAPABILITY_WFC not in self.dut_capabilities and (
                WFC_MODE_WIFI_PREFERRED not in self.dut_wfc_modes):
            raise signals.TestSkip("WFC_NONAPM is not supported")
        if "_check_wfc_nonapm" not in self.default_testing_func_names:
            raise signals.TestSkip("WFC in non-airplane mode is not working")
        func_names = ["_check_wfc_enabled"]
        if "_check_vt" in self.default_testing_func_names:
            func_names.append("_check_vt_enabled")
        if not self._check_wfc_nonapm():
            self.dut.log.error("WFC test failed before reboot test")
            return False
        return self._reboot_stress_test(*func_names)
    def test_fake_emergency_call_by_emergency_dialer_wfc_apm_off_with_ecbm_call_block(
            self):
        """Test emergency call with emergency dialer in user account.

        Configure DUT in WFC APM off.
        Add system emergency number list with fake emergency number.
        Configure allow_non_emergency_calls_in_ecm_bool false.
        Use the emergency dialer to call fake emergency number and hung up before connect.
        Verify DUT cannot make call in ecbm mode.
        Verify DUT can make call out of ecbm mode.

        Returns:
            True if success.
            False if failed.
        """
        if CAPABILITY_WFC not in operator_capabilities.get(
                self.dut_operator, operator_capabilities["default"]):
            raise signals.TestSkip("WFC is not supported for carrier %s" %
                                   self.dut_operator)
        if self.dut_operator != "tmo":
            raise signals.TestSkip(
                "WFC in non-APM is not supported for carrier %s" %
                self.dut_operator)
        if not phone_setup_iwlan(
                self.log, self.dut, False, WFC_MODE_WIFI_PREFERRED,
                self.wifi_network_ssid, self.wifi_network_pass):
            self.dut.log.error("Failed to setup WFC.")
            return False
        self.set_ims_first("false")
        return self.check_emergency_call_back_mode(
            non_emergency_call_allowed=False)
    def test_3g_wfc_cellular_preferred_to_wifi_preferred(self):
        """Test for WiFi Calling settings:
        3G + WiFi Connected + Cellular Preferred, change WFC to WiFi Preferred

        Steps:
        1. Setup DUT Idle, 3G network type.
        2. Make sure DUT WiFi connected, WFC is set to Cellular Preferred.
            Verify DUT WFC not available.
        3. Change WFC setting to WiFi Preferred.
        4. Verify DUT report WFC available.

        Expected Results:
        2. DUT WiFi Calling feature bit return False, network rat is not iwlan.
        4. DUT WiFI Calling feature bit return True, network rat is iwlan.
        """
        if WFC_MODE_WIFI_PREFERRED not in self.dut_wfc_modes:
            raise signals.TestSkip("WFC_MODE_WIFI_PREFERRED is not supported")
        if WFC_MODE_CELLULAR_PREFERRED not in self.dut_wfc_modes:
            raise signals.TestSkip(
                "WFC_MODE_CELLULAR_PREFERRED is not supported")
        if not phone_setup_voice_3g(self.log, self.dut):
            self.dut.log.error("Failed to setup 3G.")
            return False
        if not self.change_ims_setting(False, True, False, True,
                                       WFC_MODE_CELLULAR_PREFERRED):
            return False
        return self.change_ims_setting(False, True, False, True,
                                       WFC_MODE_WIFI_PREFERRED)
示例#6
0
    def test_fdr_stress_volte(self):
        """FDR with VoLTE Test

        Steps:
            1. Fdr DUT.
            2. Wait for DUT to camp on LTE, Verify Data.
            3. Check VoLTE is enabled by default, check IMS registration.
               Wait for DUT report VoLTE enabled, make VoLTE call.
               And verify VoLTE SMS. (if support VoLTE)
            4. Check crashes.
            5. Repeat Step 1~4 for N times.

        Expected Results:
            No crash happens in stress test.

        Returns:
            True is pass, False if fail.
        """
        if CAPABILITY_VOLTE not in self.dut_capabilities:
            raise signals.TestSkip("VOLTE is not supported")
        if not self._check_volte():
            self.dut.log.error("VoLTE test failed before fdr test")
            return False
        func_names = ["_check_volte_enabled"]
        return self._fdr_stress_test(*func_names)
示例#7
0
    def test_reboot_stress_volte_provisioning_disabled(self):
        """Reboot with VoLTE Test

        Steps:
            1. Reboot DUT with volte provisioning disabled.
            2. Wait for DUT to camp on LTE, Verify Data.
            3. Check VoLTE is disabled after rebooting.
            4. Check crashes.
            5. Repeat Step 1~4 for N times. (before reboot, clear Provisioning
                bit if provisioning is supported)

        Expected Results:
            No crash happens in stress test.

        Returns:
            True is pass, False if fail.
        """
        if CAPABILITY_OMADM not in self.dut_capabilities:
            raise signals.TestSkip("OMADM is not supported")
        self._clear_volte_provisioning()
        if not self._check_csfb():
            self.dut.log.error("CSFB test failed before reboot test")
            return False
        func_names = [
            "_check_volte_provisioning_disabled", "_check_csfb_enabled"
        ]
        return self._reboot_stress_test(*func_names)
示例#8
0
    def test_reboot_stress_volte_enabled(self):
        """Reboot with VoLTE Test

        Steps:
            1. Reboot DUT with volte enabled.
            2. Wait for DUT to camp on LTE, Verify Data.
            3. Check VoLTE is enabled by default, check IMS registration.
               Wait for DUT report VoLTE enabled, make VoLTE call.
               And verify VoLTE SMS. (if support VoLTE)
            4. Check crashes.
            5. Repeat Step 1~4 for N times. (before reboot, clear Provisioning
                bit if provisioning is supported)

        Expected Results:
            No crash happens in stress test.

        Returns:
            True is pass, False if fail.
        """
        if CAPABILITY_VOLTE not in self.dut_capabilities:
            raise signals.TestSkip("VOLTE is not supported")
        if not self._check_volte():
            self.dut.log.error("VoLTE test failed before reboot test")
            return False
        func_names = ["_check_volte_enabled"]
        if "_check_vt" in self.default_testing_func_names:
            func_names.append("_check_vt_enabled")
        return self._reboot_stress_test(*func_names)
 def test_gatt_sr_gar_bi_07_c(self):
     if self.characteristic_attribute_not_found_uuid is None:
         raise signals.TestSkip("Required user params missing:\n{}".format(
             "characteristic_attribute_not_found_uuid"))
     self.dut.setup_gatt_server(
         gatt_test_database.GATT_SERVER_DB_MAPPING.get('LARGE_DB_1'))
     return self.pts.execute_test("GATT/SR/GAR/BI-07-C")
    def test_modem_ssr_rampdump_generation(self):
        """Trigger Modem SSR Crash and Verify if Ramdumps are generated

        1. Empty the rampdump dir
        2. Trigger ModemSSR
        3. Verify if rampdumps are getting generated or not

        """
        if not self.dut.is_apk_installed("com.google.mdstest"):
            raise signals.TestSkip("mdstest is not installed")
        try:
            ad = self.android_devices[0]
            ad.adb.shell("rm -rf /data/vendor/ssrdump/*", ignore_status=True)
            if not trigger_modem_crash_by_modem(ad):
                ad.log.error("Failed to trigger Modem SSR, aborting...")
                return False
            out = ad.adb.shell("ls -l /data/vendor/ssrdump/ramdump_modem_*",
                               ignore_status=True)
            if "No such file" in out or not out:
                ad.log.error("Ramdump Modem File not found post SSR\n %s", out)
                return False
            ad.log.info("Ramdump Modem File found post SSR\n %s", out)
            return True
        except Exception as e:
            ad.log.error(e)
            return False
        finally:
            ad.adb.shell("rm -rf /data/vendor/ssrdump/*", ignore_status=True)
    def interop_base_test(self, ssid, hostname):
        """Base test for all the connect-disconnect interop tests.

        Args:
            ssid: string, SSID of the network to connect to.
            hostname: string, hostname of the AP.

        Steps:
            1. Lock AP in datstore.
            2. Turn on AP on the rpm switch.
            3. Run connect-disconnect in loop.
            4. Turn off AP on the rpm switch.
            5. Unlock AP in datastore.

        """
        network = {}
        network['password'] = '******'
        network['SSID'] = ssid
        release_ap = False
        wutils.reset_wifi(self.dut)

        # Lock AP in datastore.
        self.log.info("Lock AP in datastore")

        ap_info = dutils.show_device(hostname)

        # If AP is locked by a different test admin, then we skip.
        if ap_info['lock_status'] and ap_info['locked_by'] != self.admin:
            raise signals.TestSkip("AP %s is locked, skipping test" % hostname)

        if not dutils.lock_device(hostname, self.admin):
            self.log.warning("Failed to lock %s AP. Unlock AP in datastore"
                             " and try again.")
            raise signals.TestFailure("Failed to lock AP")

        band = SINGLE_BAND
        if ('ssid_2g' in ap_info) and ('ssid_5g' in ap_info):
            band = DUAL_BAND
        if (band == SINGLE_BAND) or (band == DUAL_BAND and '5G' in ssid):
            release_ap = True

        # Get AP RPM attributes and Turn ON AP.
        rpm_ip = ap_info['rpm_ip']
        rpm_port = ap_info['rpm_port']

        rutils.turn_on_ap(self.pcap, ssid, rpm_port, rpm_ip=rpm_ip)
        self.log.info("Finished turning ON AP.")
        # Experimental. Some APs take upto a min to come online.
        time.sleep(60)

        self.get_band_and_chan(ssid)
        self.pcap.configure_monitor_mode(self.band, self.chan)
        self.pcap_procs = wutils.start_pcap(self.pcap, self.band.lower(),
                                            self.test_name)
        self.run_connect_disconnect(network, hostname, rpm_port, rpm_ip,
                                    release_ap)

        # Un-lock only if it's a single band AP or we are running the last band.
        if release_ap:
            self.unlock_and_turn_off_ap(hostname, rpm_port, rpm_ip)
示例#12
0
def phone_setup_iwlan(log,
                      ad,
                      is_airplane_mode,
                      wfc_mode,
                      wifi_ssid=None,
                      wifi_pwd=None):
    """Phone setup function for epdg call test.
    Set WFC mode according to wfc_mode.
    Set airplane mode according to is_airplane_mode.
    Make sure phone connect to WiFi. (If wifi_ssid is not None.)
    Wait for phone to be in iwlan data network type.
    Wait for phone to report wfc enabled flag to be true.

    Args:
        log: Log object.
        ad: Android device object.
        is_airplane_mode: True to turn on airplane mode. False to turn off airplane mode.
        wfc_mode: WFC mode to set to.
        wifi_ssid: WiFi network SSID. This is optional.
            If wifi_ssid is None, then phone_setup_iwlan will not attempt to connect to wifi.
        wifi_pwd: WiFi network password. This is optional.

    Returns:
        True if success. False if fail.
    """
    #TODO: get per sub_id carrier_config for multi-sim purpose
    if CAPABILITY_WFC not in ad.telephony.get("capabilities", []):
        ad.log.error("WFC is not supported, abort test.")
        raise signals.TestSkip("WFC is not supported, abort test.")
    return phone_setup_iwlan_for_subscription(log, ad,
                                              get_outgoing_voice_sub_id(ad),
                                              is_airplane_mode, wfc_mode,
                                              wifi_ssid, wifi_pwd)
 def test_gatt_sr_gar_bi_14_c(self):
     if self.characteristic_read_invalid_handle is None:
         raise signals.TestSkip("Required user params missing:\n{}".format(
             "characteristic_read_invalid_handle"))
     self.dut.setup_gatt_server(
         gatt_test_database.GATT_SERVER_DB_MAPPING.get('LARGE_DB_1'))
     return self.pts.execute_test("GATT/SR/GAR/BI-14-C")
 def setup_volte(self):
     if CAPABILITY_VOLTE not in self.dut_capabilities:
         raise signals.TestSkip("VoLTE is not supported, abort test.")
     if not phone_setup_volte(self.log, self.dut):
         self.dut.log.error("Phone failed to enable VoLTE.")
         raise signals.TestFailure("Failed to enable VoLTE")
     self.dut.log.info("Phone VOLTE is enabled successfully.")
     return True
 def setup_2g(self):
     if self.dut_operator not in ("tmo", "uk_ee"):
         raise signals.TestSkip("2G is not supported, abort test.")
     if not phone_setup_voice_2g(self.log, self.dut):
         self.dut.log.error("Phone failed to setup 2G.")
         raise signals.TestFailure("Failed to setup 2G")
     self.dut.log.info("RAT 2G is enabled successfully.")
     return True
 def test_result_record_skip_with_json_extra(self):
     record = records.TestResultRecord(self.tn)
     record.test_begin()
     s = signals.TestSkip(self.details, self.json_extra)
     record.test_skip(s)
     self.verify_record(record=record,
                        result=records.TestResultEnums.TEST_RESULT_SKIP,
                        details=self.details,
                        extras=self.json_extra)
    def test_toggle_wlan_interface(self):
        """Test toggling the wlan interface if it exists.

        Steps:
        1. Call ListInterfaces FIDL api.
        2. Find the wlan interface.
        3. Disable the interface.
        4. Verify interface attributes in a down state.
        5. Enable the interface.
        6. Verify interface attributes in an up state.

        Expected Result:
        WLAN interface was successfully brought down and up again.

        Returns:
          signals.TestPass if no errors
          signals.TestFailure if there are any errors during the test.

        TAGS: Netstack
        Priority: 1
        """
        interfaces = self.dut.netstack_lib.netstackListInterfaces()
        for item in interfaces.get('result'):
            # Find the WLAN interface
            if "wlan" in item.get('name'):
                identifier = item.get('id')
                # Disable the interface by ID.
                result = self.dut.netstack_lib.disableInterface(identifier)
                if result.get('error') is not None:
                    raise signals.TestFailure(
                        "Unable to disable wlan interface: {}".format(
                            result.get('error')))

                # Check the current state of the interface.
                interface_info_result = self.dut.netstack_lib.getInterfaceInfo(
                    identifier)
                interface_info = interface_info_result.get('result')

                if len(interface_info.get('ipv4_addresses')) > 0:
                    raise signals.TestFailure(
                        "No Ipv4 Address should be present: {}".format(
                            interface_info))

                # TODO (35981): Verify other values when interface down.

                # Re-enable the interface
                result = self.dut.netstack_lib.enableInterface(identifier)
                if result.get('error') is not None:
                    raise signals.TestFailure(
                        "Unable to enable wlan interface: {}".format(
                            result.get('error')))

                # TODO (35981): Verify other values when interface up.

                raise signals.TestPass("Success")

        raise signals.TestSkip("No WLAN interface found.")
 def setup_vt(self):
     if CAPABILITY_VT not in self.dut_capabilities or (
             CAPABILITY_VT not in self.reference_capabilities):
         raise signals.TestSkip("VT is not supported, abort test.")
     for ad in (self.dut, self.ad_reference):
         if not phone_setup_video(self.log, ad):
             ad.log.error("Failed to setup VT.")
             return False
         return True
示例#19
0
 def test_wfc_parallel_stress(self):
     """ Wifi calling APM mode off stress test"""
     if CAPABILITY_WFC not in self.dut_capabilities:
         raise signals.TestSkipClass("WFC is not supported")
     if WFC_MODE_WIFI_PREFERRED not in self.dut_wfc_modes:
         raise signals.TestSkip("WFC_MODE_WIFI_PREFERRED is not supported")
     return self.parallel_tests(
         setup_func=self._setup_wfc,
         call_verification_func=is_phone_in_call_iwlan)
 def test_gatt_sr_gar_bi_06_c(self):
     if (self.characteristic_read_not_permitted_uuid is None
             or self.characteristic_read_not_permitted_handle is None):
         raise signals.TestSkip(
             "Required user params missing:\n{}\n{}".format(
                 "characteristic_read_not_permitted_uuid",
                 "characteristic_read_not_permitted_handle"))
     self.dut.setup_gatt_server(
         gatt_test_database.GATT_SERVER_DB_MAPPING.get('LARGE_DB_1'))
     return self.pts.execute_test("GATT/SR/GAR/BI-06-C")
 def setup_wfc_apm(self):
     if CAPABILITY_WFC not in self.dut_capabilities:
         raise signals.TestSkip("WFC is not supported, abort test.")
     if not phone_setup_iwlan(self.log, self.dut, True,
                              self.dut_wfc_modes[0], self.wifi_network_ssid,
                              self.wifi_network_pass):
         self.dut.log.error("Failed to setup WFC.")
         raise signals.TestFailure("Failed to setup WFC in APM")
     self.dut.log.info("Phone is in WFC enabled state.")
     return True
 def setup_wfc_non_apm(self):
     if CAPABILITY_WFC not in self.dut_capabilities and (
             WFC_MODE_WIFI_PREFERRED not in self.dut_wfc_modes):
         raise signals.TestSkip(
             "WFC in non-APM is not supported, abort test.")
     if not phone_setup_iwlan(
             self.log, self.dut, False, WFC_MODE_WIFI_PREFERRED,
             self.wifi_network_ssid, self.wifi_network_pass):
         self.dut.log.error("Failed to setup WFC.")
         raise signals.TestFailure("Failed to setup WFC in non-APM")
     self.dut.log.info("Phone is in WFC enabled state.")
     return True
示例#23
0
def skip(reason, extras=None):
    """Skip a test case.

    Args:
        reason: The reason this test is skipped.
        extras: An optional field for extra information to be included in
                test result.

    Raises:
        signals.TestSkip is raised to mark a test case as skipped.
    """
    raise signals.TestSkip(reason, extras)
示例#24
0
 def test_is_all_pass(self):
     s = signals.TestPass(self.details, self.float_extra)
     record1 = records.TestResultRecord(self.tn)
     record1.test_begin()
     record1.test_pass(s)
     s = signals.TestSkip(self.details, self.float_extra)
     record2 = records.TestResultRecord(self.tn)
     record2.test_begin()
     record2.test_skip(s)
     tr = records.TestResult()
     tr.add_record(record1)
     tr.add_record(record2)
     tr.add_record(record1)
     self.assertEqual(len(tr.passed), 2)
     self.assertTrue(tr.is_all_pass)
示例#25
0
    def run_test_class(self, test_cls_name, test_cases=None):
        """Instantiates and executes a test class.

        If test_cases is None, the test cases listed by self.tests will be
        executed instead. If self.tests is empty as well, no test case in this
        test class will be executed.

        Args:
            test_cls_name: Name of the test class to execute.
            test_cases: List of test case names to execute within the class.

        Raises:
            ValueError is raised if the requested test class could not be found
            in the test_paths directories.
        """
        matches = fnmatch.filter(self.test_classes.keys(), test_cls_name)
        if not matches:
            self.log.info(
                "Cannot find test class %s or classes matching pattern, "
                "skipping for now." % test_cls_name)
            record = records.TestResultRecord("*all*", test_cls_name)
            record.test_skip(signals.TestSkip("Test class does not exist."))
            self.results.add_record(record)
            return
        if matches != [test_cls_name]:
            self.log.info("Found classes matching pattern %s: %s",
                          test_cls_name, matches)

        for test_cls_name_match in matches:
            test_cls = self.test_classes[test_cls_name_match]
            if self.test_configs.get(keys.Config.key_random.value) or (
                    "Preflight"
                    in test_cls_name_match) or ("Postflight"
                                                in test_cls_name_match):
                test_case_iterations = 1
            else:
                test_case_iterations = self.test_configs.get(
                    keys.Config.key_test_case_iterations.value, 1)

            with test_cls(self.test_run_info) as test_cls_instance:
                try:
                    cls_result = test_cls_instance.run(test_cases,
                                                       test_case_iterations)
                    self.results += cls_result
                    self._write_results_json_str()
                except signals.TestAbortAll as e:
                    self.results += e.results
                    raise e
示例#26
0
    def test_usb_tethering_iperf_super_speed(self):
        """Enable usb tethering then executing iperf test.

        Steps:
        1. Stop SL4A service.
        2. Enable usb tethering.
        3. Restart SL4A service.
        4. Skip test if device not support super-speed.
        5. Execute iperf test for usb tethering and get the throughput result.
        6. Check the iperf throughput result.
        """
        if (self.get_usb_speed()[0] != 'super-speed'):
            raise signals.TestSkip(
                'USB 3 not available for the device, skip super-speed performance test.'
            )
        self.run_iperf_tx_rx('usb_3', self.iperf_usb_3_criteria)
示例#27
0
def phone_setup_volte(log, ad):
    """Setup VoLTE enable.

    Args:
        log: log object
        ad: android device object.

    Returns:
        True: if VoLTE is enabled successfully.
        False: for errors
    """
    #TODO: get per sub_id carrier_config for multi-sim purpose
    if CAPABILITY_VOLTE not in ad.telephony.get("capabilities", []):
        ad.log.error("VoLTE is not supported, abort test.")
        raise signals.TestSkip("VoLTE is not supported, abort test.")
    return phone_setup_volte_for_subscription(log, ad,
                                              get_outgoing_voice_sub_id(ad))
    def test_firmware_crash_concurrent_reconnect_stress(self):
        """Firmware crash stress test for concurrent mode

        1. Turn on dut's Wi-Fi and connect to access point
        2. Turn on dut's hotspot and connected by dut client
        3. Trigger firmware crash
        4. Check ssr happened
        5. Check dut can connect to access point
        6. Check the connectivity of hotspot's client
        7. Repeat step 3~6
        """
        if self.dut.model not in self.dbs_supported_models:
            raise signals.TestSkip("%s does not support dual interfaces" %
                                   self.dut.model)

        # Connect DUT to Network
        wutils.wifi_toggle_state(self.dut, True)
        wutils.connect_to_wifi_network(self.dut, self.network)
        # Setup Soft AP
        sap_config = wutils.create_softap_config()
        wutils.start_wifi_tethering(self.dut,
                                    sap_config[wutils.WifiEnums.SSID_KEY],
                                    sap_config[wutils.WifiEnums.PWD_KEY],
                                    wutils.WifiEnums.WIFI_CONFIG_APBAND_2G)
        config = {
            "SSID": sap_config[wutils.WifiEnums.SSID_KEY],
            "password": sap_config[wutils.WifiEnums.PWD_KEY]
        }
        # Client connects to Softap
        wutils.wifi_toggle_state(self.dut_client, True)
        wutils.connect_to_wifi_network(self.dut_client, config)
        for count in range(self.stress_count):
            self.log.info(
                "%s: %d/%d" %
                (self.current_test_name, count + 1, self.stress_count))
            wutils.reset_wifi(self.dut_client)
            wutils.reset_wifi(self.dut)
            # Trigger firmware crash
            self.trigger_wifi_firmware_crash(self.dut)
            wutils.connect_to_wifi_network(self.dut, self.network)
            wutils.connect_to_wifi_network(self.dut_client, config)
        wutils.stop_wifi_tethering(self.dut)
示例#29
0
    def test_sim_slot_power_cycle(self):
        """SIM slot power cycle Test

        Steps:
            1. Power cycle SIM slot to simulate SIM resit
            2. Post power cycle SIM, verify Voice, Data, SMS, VoLTE, VT

        Expected Results:
            No crash happens in functional test, features work fine.

        Returns:
            True is pass, False if fail.
        """
        if self.dut.adb.getprop("ro.build.version.release")[0] in (
                "8", "O", "7", "N") or self.dut.model in ("angler", "bullhead",
                                                          "marlin",
                                                          "sailfish"):
            raise signals.TestSkip("Power off SIM is not supported")
        return self._crash_recovery_test("sim",
                                         *self.default_testing_func_names)
    def test_fake_emergency_call_by_emergency_dialer_2g_ecbm(self):
        """Test emergency call with emergency dialer in user account.

        Configure DUT in 2G
        Add system emergency number list with fake emergency number.
        Turn off emergency call IMS first.
        Configure allow_non_emergency_calls_in_ecm_bool false.
        Use the emergency dialer to call fake emergency number and hung up before connect.
        Verify DUT voice and data in ecbm mode.

        Returns:
            True if success.
            False if failed.
        """
        if self.dut_operator != "tmo":
            raise signals.TestSkip("2G is not supported for carrier %s" %
                                   self.dut_operator)
        if not phone_setup_voice_2g(self.log, self.dut):
            return False
        self.set_ims_first("false")
        return self.check_emergency_call_back_mode()