Example #1
0
    def release_csfb_vc(self, time_to_wait_before_3g_idle=5):
        """
        Release Voice Call
        """

        if self.release_csfb_vc_type == "NR":
            # Release previous call from the network
            self._ns_3gsm_vc.voice_call_network_release()
        else:
            # Release previous call from the DUT
            self._voicecall_api.release()

        # If loss coverage of LTE cell is performed,
        # need to check that DUT stays registered on 3GSM cell
        if self._loss_coverage_side == "LTE":

            if self._ns_3gsm_cell_tech == "3G":
                # Check Data Connection State on 3GSM cell => PDP Active before timeout
                # Check that DUT is registered on the good RAT
                RegUtil.check_rat_and_data_connection_state(self._ns_3gsm_data,
                                                            "PDP_ACTIVE",
                                                            self._modem_api,
                                                            self._registration_timeout)
        else:
            # Force transition to CELL IDLE in order to release PDP context on 3G cell
            if self._ns_3gsm_cell_tech == "3G":
                # Wait 5 seconds while VC is ended on 8960
                time.sleep(time_to_wait_before_3g_idle)
                self._ns_3gsm_data.set_rrc_transition("IDLE")
            # Check Data Connection State on LTE cell => CON before timeout
            # Check that DUT is registered on the good RAT
            RegUtil.check_rat_and_data_connection_state(self._ns_lte_data,
                                                        "CON",
                                                        self._modem_api,
                                                        self._registration_timeout)
Example #2
0
    def set_up(self):
        """
        Set up the test configuration
        """
        # Call LabMobility3gsmBase Set_up function
        LabMobility3gsmBase.set_up(self)

        # Set cell on
        self._ns1_cell.set_cell_on()

        # Disable flight mode
        self._networking_api.set_flight_mode("off")

        # Check registration state is connected using
        # registrationTimeout from Device_Catalog.xml
        self._modem_api.check_cdk_registration_bfor_timeout(self._registration_timeout)

        # Set the APN
        time.sleep(self._wait_btwn_cmd)
        self._logger.info("Setting APN " + str(self._apn) + "...")
        self._networking_api.set_apn(self._ssid, self._apn)

        # Activate PDP context
        time.sleep(self._wait_btwn_cmd)
        self._logger.info("Active PDP Context...")
        self._networking_api.activate_pdp_context(self._ssid, check=False)

        # Check Data Connection State => PDP_ACTIVE before timeout
        RegUtil.check_dut_data_connection_state_before_timeout("PDP_ACTIVE",
                                                               self._ns1_cell,
                                                               self._networking_api,
                                                               self._logger,
                                                               self._registration_timeout,
                                                               flightmode_cycle=False,
                                                               blocking=False)

        # Get RAT from Equipment
        network_type = self._ns1_data.get_network_type()

        # Check that DUT is registered on the good RAT
        self._modem_api.check_network_type_before_timeout(network_type, self._registration_timeout)

        # Set NS2 cell on
        self._ns2_cell.set_cell_on()

        # Perform MO voice call on active network simulator
        self._voicecall_api.dial(self._phone_number, True)

        # Check call state "CONNECTED" before callSetupTimeout seconds
        self._ns1_vc.check_call_connected(self._call_setup_time,
                                          blocking=False)

        return Global.SUCCESS, "No errors"
Example #3
0
    def set_up(self):
        """
        Set up the test configuration
        """

        # Call LabMobilityBase Setup function
        LabMobilityBase.set_up(self)

        # Set cell off
        self._ns1_cell.set_cell_off()

        # Set cell off
        self._ns2_cell.set_cell_off()

        # Set EPC off
        self._ns1_data.set_epc_off()
        self._ns2_data.set_epc_off()

        # Call specific configuration functions
        RegUtil.setup_cell_lte(self._ns1, self._ns1_mcc, self._ns1_mnc,
                               self._ns1_ip_dut, self._ns1_signal_mode,
                               self._ns1_cell_id, self._ns1_physical_cell_id,
                               self._ns1_mimo, self._ns1_cell_power_rf1,
                               self._ns1_cell_power_rf2,
                               self._ns1_scenario_path, self._ns1_cell_band,
                               self._ns1_lte_dl_earfcn, self._apn)

        # Call specific configuration functions
        RegUtil.setup_cell_lte(self._ns2, self._ns2_mcc, self._ns2_mnc,
                               self._ns2_ip_dut, self._ns2_signal_mode,
                               self._ns2_cell_id, self._ns2_physical_cell_id,
                               self._ns2_mimo, self._ns2_cell_power_rf1,
                               self._ns2_cell_power_rf2,
                               self._ns2_scenario_path, self._ns2_cell_band,
                               self._ns2_lte_dl_earfcn, self._apn)

        # Set EPC on
        self._ns1_data.set_epc_on()
        self._ns2_data.set_epc_on()

        # Set the APN
        self._logger.info("Setting APN " + str(self._apn) + "...")
        self._networking_api.set_apn(self._ssid, self._apn)

        return Global.SUCCESS, "No errors"
Example #4
0
    def set_up(self):
        """
        Set up the test configuration
        """

        # Call LabMobilityBase set_up function
        LabMobilityBase.set_up(self)

        # Ensure flight mode off so that GSM sim operator info can be retrieved
        self._networking_api.set_flight_mode("off")
        time.sleep(self._wait_btwn_cmd)

        # Determinates the kind of registration state to wait
        # by comparing test case MCC/MNC parameters to sim MCC/MNC
        sim_info = self._modem_api.get_sim_operator_info()
        if sim_info["MCC"] != self._ns_lte_mcc or \
           sim_info["MNC"] != self._ns_lte_mnc:
            self._wanted_reg_state = "roaming"
            self._networking_api.set_roaming_mode("ON")
        else:
            self._wanted_reg_state = "registered"

        # Disable data and PDP context
        self._networking_api.deactivate_pdp_context()

        # Enable flight mode
        self._networking_api.set_flight_mode("on")

        # Set the Network Simulators APIs instances
        self._set_ns_apis_instances()

        # Set the equipment application format depending on ACTIVE_CELL_TECH.
        # If 4G switch to ""LTE FDD""
        self._ns_lte.switch_app_format("LTE FDD")

        # Perform full preset on LTE cell
        self._ns_lte.perform_full_preset()

        # Perform full preset on 3GSM cell
        self._ns_3gsm.perform_full_preset()

        # Set EPC off, not for CMW500 because DAU starting is a long lasting time operation
        self._ns_lte_data.set_epc_off()

        # Set cell off on LTE cell
        self._ns_lte_cell.set_cell_off()

        # Set cell off
        self._ns_3gsm_cell.set_cell_off()

        # Set IP addresses for the 3GSM NS
        self._ns_3gsm.set_ip_addresses(
            self._ns_3gsm_ip_lan1, self._ns_3gsm_ip_lan2,
            self._ns_3gsm_ip_subnet_mask, self._ns_3gsm_ip_default_gateway,
            self._ns_3gsm_ip_dut, self._ns_3gsm_ip_dns1, self._ns_3gsm_ip_dns2)

        # Call specific configuration functions
        # Some parameters are defined by function
        RegUtil.setup_cell(self._ns_number, self._ns_model,
                           self._ns_3gsm_cell_tech, self._ns_3gsm_cell_band,
                           self._ns_3gsm_cell_rel, self._logger)

        # Set Cell Band and ARFCN using 3GSM_CELL_BAND
        # and 3GSM_ARFCN parameters
        # Set cell service using 3GSM_CELL_SERVICE parameter
        # Set Cell Power using 3GSM_CELL_POWER parameter
        # Set Cell LAC using 3GSM_LAC_VALUE parameter
        # Set Cell RAC using 3GSM_RAC_VALUE parameter
        self._ns_3gsm_cell.configure_basic_cell_parameters(
            self._ns_3gsm_cell_service, self._ns_3gsm_cell_band,
            self._ns_3gsm_dl_arfcn, self._ns_3gsm_cell_power,
            self._ns_3gsm_lac, self._ns_3gsm_rac)

        # set mcc and mnc of 3gsm network
        self._ns_3gsm_cell.set_mcc(self._ns_3gsm_mcc)
        self._ns_3gsm_cell.set_mnc(self._ns_3gsm_mnc)
        if self._ns_lte_duplex_type == "FDD":
            # Call specific configuration functions for LTE Cell
            RegUtil.setup_cell_lte(
                self._ns_lte, self._ns_lte_mcc, self._ns_lte_mnc,
                self._ns_lte_ip_dut, self._ns_lte_signal_mode,
                self._ns_lte_cell_id, self._ns_lte_physical_cell_id,
                self._ns_lte_mimo, self._ns_lte_cell_power_rf1,
                self._ns_lte_cell_power_rf2, self._ns_lte_scenario_path,
                self._ns_lte_cell_band, self._ns_lte_dl_earfcn, self._apn)
        elif self._ns_lte_duplex_type == "TDD":
            # Set the DUT IP address
            self._ns_lte_data.set_dut_ip_address(self._ns_dut_ip_Address)
            # Load LTE TDD optimal configuration
            self._ns_lte.load_cell_config("TDD_COMMON", self._ns_number)
            if hasattr(self, "_lte_tdd_config"):
                self._ns_lte.load_cell_config(self._lte_tdd_config,
                                              self._ns_number)
            if self._cell_band is not None:
                self._ns_lte_cell.set_cell_band(self._ns_lte_cell_band)
                self._ns_lte_cell.set_downlink_earfcn(self._ns_lte_dl_earfcn)

            # Set MIMO mode
            self._ns_cell_4g.set_lte_tdd_configuration(self._antennas_number,
                                                       self._mimo)
        # Set EPC on
        self._ns_lte_data.set_epc_on()

        # Deactivate E-DCH Cell and HSDPA Cell capabilities
        # if 3GSM NS cell tech is 3G
        if self._ns_3gsm_cell_tech == "3G":
            self._ns_3gsm_data.set_edch_cell_capability("OFF")
            self._ns_3gsm_data.set_hsdpa_cell_capability("OFF")
        # if 3GSM NS cell tech is 2G
        else:
            # Set the multislot configuration
            self._ns_3gsm_data.set_multislot_config(self._multislot)

        return Global.SUCCESS, "No errors"
    def set_up(self):
        """
        Initialize the test
        """
        # Call the UseCaseBase Setup function
        EmUsecaseBase.set_up(self)

        # set usb charging on
        self.em_api.set_usb_charging("on")

        # Configure CMU
        # Connect to cellular network simulator
        self._ns.init()

        # check that channel is allow for this band
        self._conversion_toolbox.convert_wcdma_channelscript_to_array(
            self._cell_band,
            self._ul_uarfcn)

        # Perform Full Preset
        self._ns.perform_full_preset()

        # Set cell band using CELL_BAND parameter
        self._ns_3g.set_band("BAND" + self._cell_band)

        # Set cell off
        self._ns_3g.set_cell_off()

        # Set Traffic Channel Arfcn using TCH_ARFCN parameter
        self._ns_3g.set_uplink_arfcn(self._ul_uarfcn)

        # Set mobile power using MOBILE_POWER parameter
        self._ns_3g.set_ms_power(self._mobile_power)

        # Set cell power using CELL_POWER parameter
        self._ns_3g.set_cell_power(self._cell_power)

        # init capacity
        msic = self.update_battery_info()

        # get capability targets
        self._em_targets = self._target_file.parse_energy_management_targets(
            "LAB_EM_BATT_OFF_ON_VC_3G", self._tc_parameters.get_params_as_dict(),
            self._device.get_phone_model())

        # load targets in order to measure iteration
        self._em_meas_verdict.load_target(self._em_targets)

        # init verdict value
        if self._em_targets["MSIC_REGISTER_PLUG.BATTERY.CHARGE_NOW"] is not None:
            EMUtil.update_conf(
                self._em_targets["MSIC_REGISTER_PLUG.BATTERY.CHARGE_NOW"],
                "hi_lim", msic["BATTERY"]["CHARGE_FULL_DESIGN"][0], "=")

        # init verdict value
        if self.tc_module is not None:
            if self._em_targets["THERMAL_MSIC_REGISTER_PLUG.BATTERY.TEMP"] is None:
                EMUtil.update_conf(
                    self._em_targets["THERMAL_MSIC_REGISTER_PLUG.BATTERY.TEMP"],
                    ["lo_lim", "hi_lim"], self._tct, "*")

        # Charge battery
        self.em_core_module.monitor_charging(self.em_core_module.batt_max_capacity, self.em_core_module.charge_time,
                              self.__em_meas_tab)

        # set CMU cell phone ON
        self._ns_3g.set_cell_on()

        # register phone
        RegUtil.check_dut_registration_before_timeout(self._ns_3g,
                                                      self.networking_api,
                                                      self._logger,
                                                      None,
                                                      self._registration_timeout)

        # Check registration status on DUT
        self.modem_api.check_cdk_registration_bfor_timeout(
            self._registration_timeout)

        return Global.SUCCESS, "No errors"
Example #6
0
    def set_up(self):
        """
        Set up the test configuration
        """
        # We won't use LabWcdmaSmsCsBase SetUp, because we don't want PDP active
        # for this CS test case.

        # log in acs logs
        self._logger.info("")
        self._logger.info("%s: Setup", self._name)
        self._logger.info("")

        # Connect to equipment
        self._ns.init()

        # Set the equipment Application Format = "WCDMA"
        self._ns.switch_app_format("WCDMA")

        # Perform full preset
        self._ns.perform_full_preset()

        # Deactivate HSUPA and HSDPA capabilities
        self._ns_data_3g.set_edch_cell_capability("OFF")
        self._ns_data_3g.set_hsdpa_cell_capability("OFF")

        # Set cell off
        self._ns_cell_3g.set_cell_off()

        # Set cell power using CELL_POWER value
        self._ns_cell_3g.set_cell_power(self._cell_power)

        self._ns_cell_3g.set_bch_update_page_state("AUTO")

        self._ns_cell_3g.set_drx_cycle(self._drx_cycle_length_cn)

        self._ns_cell_3g.set_drx_cycle_utran(self._drx_cycle_length_utran)

        self._ns_cell_3g.set_ctch_allocation_period(self._ctch_allocation_period)

        # Set cell on
        self._ns_cell_3g.set_cell_on()

        # Check registration status before time out using
        # registrationTimeout value from Device_Catalog.xml
        time.sleep(self._wait_btwn_cmd)
        dut_imsi = self._modem_api.get_imsi(self._registration_timeout)

        RegUtil.check_dut_registration_before_timeout(self._ns_cell_3g,
                                                      self._networking_api,
                                                      self._logger,
                                                      dut_imsi,
                                                      self._registration_timeout)

        # We should makesure data is disable for this use case
        self._logger.info("Deactivation of the PDP Context")
        self._networking_api.deactivate_pdp_context(self._ssid)

        # Check Data Connection State => PDP Active before timeout
        self._ns_data_3g.check_data_connection_state("ATTACHED",
                                                     self._registration_timeout,
                                                     blocking=False)

        # Check registration state is connected using
        # registrationTimeout from Device_Catalog.xml (Non blocking
        # for this test if function isn't implemented on CDK)
        time.sleep(self._wait_btwn_cmd)
        self._modem_api.check_cdk_registration_bfor_timeout(
            self._registration_timeout)

        # Set sender address using DESTINATION_NUMBER on Network simulator
        self._ns_messaging_3g.set_sms_sender_address(self._destination_number)

        self._ns_messaging_3g.set_cell_broadcast_message_identifier(
            self._cell_broadcast_message_identifier,
            self._cell_broadcast_message)

        self._ns_messaging_3g.set_cell_broadcast_message_repetition_period(
            self._repetition_period)

        self._ns_messaging_3g.select_cell_broadcast_message_content(
            self._content_type,
            self._cell_broadcast_message)

        self._ns_messaging_3g.set_cell_broadcast_message_update_number(
            self._update_number,
            self._cell_broadcast_message)

        if self._content_type == "CTEX":
            self._ns_messaging_3g.set_custom_cell_broadcast_text_message(
                self._custom_cell_broadcast_text_message,
                self._cell_broadcast_message)
        elif self._content_type == "CDAT":
            self._ns_messaging_3g.set_custom_cell_broadcast_data_string(
                self._custom_cell_broadcast_text_message,
                self._cell_broadcast_message)

        return Global.SUCCESS, "No errors"
    def set_up(self):
        """
        Set up the test configuration
        """

        # Call LabMobility3gsmBase Set_up function
        LabMobility3gsmBase.set_up(self)

        # Get the NS1 cell LAC in order
        # to manage possible INTRA_LA test case
        ns1_lac = self._ns1_cell.get_lac()

        # Get the NS2 cell LAC in order
        # to manage possible INTRA_LA test case
        ns2_lac = self._ns2_cell.get_lac()

        # IF NS1 and NS2 cells LAC are equals,
        # don't call the random lac to stay in INTRA_LA mode
        if ns1_lac != ns2_lac:
            # Sets a random LAC excluding NS2 and NS1 LAC
            self._ns1_cell.set_random_lac([ns1_lac, ns2_lac])

        # Set cell on the NS1 cell
        self._ns1_cell.set_cell_on()

        # Disable flight mode
        self._networking_api.set_flight_mode("off")

        # Check registration state is connected using
        # registrationTimeout from Device_Catalog.xml
        self._modem_api.check_cdk_registration_bfor_timeout(
            self._registration_timeout)

        # Set the APN
        time.sleep(self._wait_btwn_cmd)
        self._logger.info("Setting APN " + str(self._apn) + "...")
        self._networking_api.set_apn(self._ssid, self._apn)

        # Activate PDP context
        time.sleep(self._wait_btwn_cmd)
        self._logger.info("Active PDP Context...")
        self._networking_api.activate_pdp_context(self._ssid, check=False)

        # Check Data Connection State => PDP_ACTIVE before timeout
        RegUtil.check_dut_data_connection_state_before_timeout(
            "PDP_ACTIVE",
            self._ns1_cell,
            self._networking_api,
            self._logger,
            self._registration_timeout,
            flightmode_cycle=True,
            blocking=False)

        # Check registration state is connected using
        # registrationTimeout from Device_Catalog.xml
        self._wanted_reg_state = self._modem_api.get_network_registration_status(
        )

        self._modem_api.check_cdk_state_bfor_timeout(
            self._wanted_reg_state, self._registration_timeout)

        return Global.SUCCESS, "No errors"
Example #8
0
    def set_up(self):
        """
        Set up the test configuration
        """

        # Call use case base Setup function
        UseCaseBase.set_up(self)

        # Ensure flight mode off so that GSM sim operator info can be retrieved
        self._networking_api.set_flight_mode("on")
        time.sleep(self._wait_btwn_cmd)

        # Connect to equipment using GPIBAddress and GPIBBoardId
        self._ns.init()

        # Set the equipment Application Format = "WCDMA"
        self._ns.switch_app_format("WCDMA")

        # Perform a full preset
        self._ns.perform_full_preset()

        # Set cell off
        self._ns_cell_3g.set_cell_off()

        # Set Frequency points using frequency list
        # Set Amplitude Offset correction using offset list
        # Turning amplitude offset state to ON
        self._ns.configure_amplitude_offset_table()

        # "Set Cell Service in function of the CELL_SERVICE value :
        # ""CIRCUIT"" : paging service is AMR
        #                PS domain is ABSENT
        # ""PACKET"" : paging service is GPRS
        #                PS domain is PRESENT
        # ""CIRCUIT_PACKET"": paging service is AMR
        #                PS domain is PRESENT
        # ""RBTEST"" : paging service is RBT"
        self._ns_cell_3g.set_cell_service(self._cell_service)

        # Set Cell Band UARFCN (downlink) using Band and DlUarfcn
        self._ns_cell_3g.set_band_and_dl_arfcn("BAND" + str(self._band),
                                               self._dl_uarfcn)

        # Set Cell Band UARFCN (uplink) in auto mode
        self._ns_cell_3g.set_uplink_channel_mode("ON")

        # Set Audio codec using VOICE_CODER_RATE parameter
        self._ns_voice_call_3g.set_audio_codec(self._voice_coder_rate)

        # Set SRB  Configuration Control to auto
        self._ns_cell_3g.set_srb_config_control("ON")

        # Set Cell Power using CELL_POWER parameter
        self._ns_cell_3g.set_cell_power(self._cell_power)

        # Set Cell on
        self._ns_cell_3g.set_cell_on()

        # Ensure flight mode off so that GSM sim operator info can be retrieved
        self._networking_api.set_flight_mode("off")
        time.sleep(self._wait_btwn_cmd)

        # Set the APN
        time.sleep(self._wait_btwn_cmd)
        self._logger.info("Setting APN " + str(self._apn) + "...")
        self._networking_api.set_apn(self._ssid, self._apn)

        # Activate PDP context
        time.sleep(self._wait_btwn_cmd)
        self._logger.info("Active PDP Context...")
        self._networking_api.activate_pdp_context(self._ssid, check=False)

        if self._cell_service not in "CIRCUIT":
            # Adapt attachment procedure to CIRCUIT
            dut_imsi = self._modem_api.get_imsi(self._registration_timeout)

            RegUtil.check_dut_registration_before_timeout(
                self._ns_cell_3g, self._networking_api, self._logger, dut_imsi,
                self._registration_timeout)
            # Get RAT from Equipment
            network_type = self._ns_data_3g.get_network_type()

            # Check that DUT is registered on the good RAT
            self._modem_api.check_network_type_before_timeout(
                network_type, self._registration_timeout)

        # Check registration state is connected using
        # registrationTimeout from Device_Catalog.xml
        self._modem_api.check_cdk_registration_bfor_timeout(
            self._registration_timeout)

        return Global.SUCCESS, "No errors"
    def set_up(self):
        """
        Initialize the test
        """
        UseCaseBase.set_up(self)

        # Clear all data connections
        self._networking_api.clean_all_data_connections()
        time.sleep(self._wait_btwn_cmd)

        # Connect to equipment
        self._ns.init()

        # Set the equipment application format GSM/GPRS
        self._ns.switch_app_format("GSM/GPRS")

        # Perform a full preset
        self._ns.perform_full_preset()

        # Set cell off
        self._ns_cell_2g.set_cell_off()

        # Set serving cell to EGPRS
        self._ns_cell_2g.set_cell_service("EGPRS")

        # Set Frequency points using frequency list
        # Set Amplitude Offset correction using offset list
        # Turning amplitude offset state to ON
        self._ns.configure_amplitude_offset_table()

        # Set the equipment IP address 1
        self._ns.set_ip4_lan_address(self._ns_IP_Lan1)

        # Set the equipment IP_Lan2 to the equipment
        self._ns.set_ip4_lan_address2(self._ns_IP_Lan2)

        # Set the equipment subnet mask
        self._ns.set_ip4_subnet_mask(self._ns_Subnet_Mask)

        # Set the equipment default gateway
        self._ns.set_ip4_default_gateway(self._ns_Default_Gateway)

        # Set the DUT IP address 1
        self._ns_data_2g.set_dut_ip_address(1, self._ns_DUT_IP_Address)

        # Set the DUT DNS1
        self._ns_data_2g.set_dut_primary_dns(self._ns_DNS1)

        # Set the DUT DNS2
        self._ns_data_2g.set_dut_secondary_dns(self._ns_DNS2)

        # Set Cell Power using CELL_POWER parameter
        self._ns_cell_2g.set_cell_power(self._cell_power)

        # Set VOICE_CODER_RATE
        self._ns_voice_call_2g.set_audio_codec(self._voice_coder_rate)

        # Set connection type to auto
        self._ns_data_2g.set_connection_type("AUTO")

        # Set Cell Band  using CELL_BAND parameter
        self._ns_cell_2g.set_band(self._band_name)

        # Set Broadcast Channel Arfcn using BCH_ARFCN parameter
        self._ns_cell_2g.set_bcch_arfcn(self._bch_arfcn)

        # Set PDTCH Arfcn using PDTCH_ARFCN parameter
        self._ns_cell_2g.set_pdtch_arfcn(self._pdtch_arfcn)

        # Set the multislot configuration
        self._ns_data_2g.set_multislot_config(self._multislot)

        # Set the downlink and uplink Modulation Coding Schema
        # (DL_MCS and UL_MCS)
        self._ns_data_2g.set_pdtch_modulation_coding_scheme(
            self._dl_mcs, self._ul_mcs)

        # Set the Puncturing Modulation Coding Schema (PS_MCS)
        self._ns_data_2g.set_pdtch_puncturing_scheme(self._ps_mcs)

        # Set DTM state to ON
        self._ns_cell_2g.set_dtm_state("ON")

        # Set cell on
        self._ns_cell_2g.set_cell_on()

        # Check Data Connection State => ATTACHED before timeout
        RegUtil.check_dut_data_connection_state_before_timeout(
            "ATTACHED", self._ns_cell_2g, self._networking_api, self._logger,
            self._registration_timeout)

        # Check registration state is connected using
        # registrationTimeout from Device_Catalog.xml (Non blocking
        # for this test if function isn't implemented on CDK)
        self._modem_api.check_cdk_registration_bfor_timeout(
            self._registration_timeout)

        # Get RAT from Equipment
        network_type = self._ns_data_2g.get_network_type()

        # Check that DUT is registered on the good RAT
        self._modem_api.check_network_type_before_timeout(
            network_type, self._registration_timeout)

        # Set the APN
        time.sleep(self._wait_btwn_cmd)
        self._logger.info("Setting APN " + str(self._apn) + "...")
        self._networking_api.set_apn(self._ssid, self._apn)

        # Activate PDP context
        time.sleep(self._wait_btwn_cmd)
        self._logger.info("Active PDP Context...")
        self._networking_api.activate_pdp_context(self._ssid)

        # Check Data Connection State => PDP Active before timeout
        self._ns_data_2g.check_data_connection_state(
            "PDP_ACTIVE", self._registration_timeout)

        # Check that operator gave a valid Voice call number
        # Perform MO voice call on active network simulator
        if self._phone_number is None:
            # Raise an error message as no valid phone number has been set by the operator
            self._error.Msg = "Phone number has no valid value"
            self._logger.error(self._error.Msg)
            raise AcsConfigException(AcsConfigException.PROHIBITIVE_BEHAVIOR,
                                     self._error.Msg)

        return Global.SUCCESS, "No errors"
Example #10
0
    def go_out_of_coverage_and_cresel(self,
                                      ns_camped_cell,
                                      ns_neighbour_cell,
                                      ns_neighbour_data,
                                      ns_neighbour_cell_service,
                                      cresel_power,
                                      ns_neighbour_model,
                                      cresel_timeout,
                                      cresel_nocoverage_time):
        """
        Decrease cell power in case of IDLE Cell Reselection

        :type ns_camped_cell: str
        :param ns_camped_cell: "Camped" Network Simulator Cell API
        :type ns_neighbour_cell: str
        :param ns_neighbour_cell: "NEIGHBOUR" Network Simulator Cell API
        :type ns_neighbour_data: str
        :param ns_neighbour_data: "NEIGHBOUR" Network Simulator Data API
        :type cresel_power: float
        :param cresel_power: cell power of the neighbour cell
        :type cresel_timeout: float
        :param cresel_timeout: time to go from no coverage to attach to a new cell
        :type cresel_nocoverage_time: float
        :param cresel_nocoverage_time: time to stay in no coverage
        """

        # Set camped cell power to -115dBm
        ns_camped_cell.set_cell_power(-115)
        self._logger.info("Going to no coverage zone")
        # stay a while unregistered
        time.sleep(cresel_nocoverage_time)
        # if the DUT is not unregistered test is failed
        if self._modem_api.get_network_registration_status() != "unregistered":
            msg = "DUT is not unregistered"
            self._logger.error(msg)
            # Return message and quit the method
            raise DeviceException(DeviceException.OPERATION_FAILED, msg)
        # Set final Neighbour cell power to NS2_CELL_POWER
        ns_neighbour_cell.set_cell_power(cresel_power)

        # the Connection State to check we are using PXT or AGILENT8960
        if ns_neighbour_model == "AGILENT_8960":
            conn_state = "ATTACHED"
        elif ns_neighbour_model == "AGILENT_E6621A":
            conn_state = "CON"

        dut_imsi = self._modem_api.get_imsi(self._registration_timeout)

        if ns_neighbour_cell_service in ("GSM",
                                         "WCDMA",
                                         "PACKET"):
            # Check phone registration on equipment before given CAMP_TIMEOUT
            # (in loop compare every second the IMSI returned by the simulator
            # and IMSI read on CDK until comparison is true or timeout expired)
            if(RegUtil.check_dut_registration_before_timeout(ns_neighbour_cell,
                                                             self._networking_api,
                                                             self._logger,
                                                             dut_imsi,
                                                             cresel_timeout,
                                                             False,
                                                             False)):

                # Log the cell reselection success
                self._logger.info("Cell reselection succeeded")
                # DUT Camped on neighbour cell, break function to quit the loop
            else:
                self.resel_error()

        else:
            # Check Data Connection State => conn_state before timeout
            if(ns_neighbour_data.check_data_connection_state(conn_state,
                                                             cresel_timeout,
                                                             False)):
                # Log the cell reselection success
                self._logger.info("Cell reselection succeeded ")
                # DUT Camped on neighbour cell, break function to quit the loop
            else:
                # Log that Cell Reselection has failed
                self.resel_error()
Example #11
0
    def set_up(self):
        """
        Initialize the test
        """
        UseCaseBase.set_up(self)

        # Clear all data connections
        self._networking_api.clean_all_data_connections()
        time.sleep(self._wait_btwn_cmd)

        # Activate the flight mode.
        self._networking_api.set_flight_mode("on")

        # Connect to equipment
        self._ns.init()

        # Set the equipment application format GSM/GPRS
        self._ns.switch_app_format("GSM/GPRS")
        time.sleep(self._wait_btwn_cmd)
        # Perform a full preset
        self._ns.perform_full_preset()

        # Set cell off
        self._ns_cell_2g.set_cell_off()

        # Set serving cell to EGPRS
        self._ns_cell_2g.set_cell_service("EGPRS")

        # Set Frequency points using frequency list
        # Set Amplitude Offset correction using offset list
        # Turning amplitude offset state to ON
        self._ns.configure_amplitude_offset_table()

        # Set the equipment IP address 1
        self._ns.set_ip4_lan_address(self._ns_IP_Lan1)

        # Set the equipment IP_Lan2 to the equipment
        self._ns.set_ip4_lan_address2(self._ns_IP_Lan2)

        # Set the equipment subnet mask
        self._ns.set_ip4_subnet_mask(self._ns_Subnet_Mask)

        # Set the equipment default gateway
        self._ns.set_ip4_default_gateway(self._ns_Default_Gateway)

        # Set the DUT IP address 1
        self._ns_data_2g.set_dut_ip_address(1, self._ns_DUT_IP_Address)
        # Set the DUT IP address 2 if not empty str.
        if self._ns_DUT_IP_Address2 != "":
            self._ns_data_2g.set_dut_ip_address(2, self._ns_DUT_IP_Address2)

        # Set the DUT DNS1
        self._ns_data_2g.set_dut_primary_dns(self._ns_DNS1)

        # Set the DUT DNS2
        self._ns_data_2g.set_dut_secondary_dns(self._ns_DNS2)

        # Call specific configuration functions
        # Some parameters are defined by function
        RegUtil.setup_cell(self._ns_number, self._ns_model, self.ns_cell_tech,
                           self._band_name, self._ns_cell_rel, self._logger)

        # Set Cell Power using CELL_POWER parameter
        self._ns_cell_2g.set_cell_power(self._cell_power)

        # Set connection type to auto
        self._ns_data_2g.set_connection_type("AUTO")

        # Set the multislot configuration
        self._ns_data_2g.set_multislot_config(self._multislot)

        # Set the downlink and uplink Modulation Coding Schema
        # (DL_MCS and UL_MCS)
        self._ns_data_2g.set_pdtch_modulation_coding_scheme(
            self._dl_mcs, self._ul_mcs)

        # Set the Puncturing Modulation Coding Schema (PS_MCS)
        self._ns_data_2g.set_pdtch_puncturing_scheme(self._ps_mcs)

        # Set cell on
        self._ns_cell_2g.set_cell_on()

        self._modem_api.check_cdk_no_registration_bfor_timeout(
            self._registration_timeout)

        # Deactivate the flight mode.
        self._networking_api.set_flight_mode("off")

        # Check registration state is connected using
        # registrationTimeout from Device_Catalog.xml (Non blocking
        # for this test if function isn't implemented on CDK)
        self._modem_api.check_cdk_registration_bfor_timeout(
            self._registration_timeout)

        # Set the APN
        time.sleep(self._wait_btwn_cmd)
        self._logger.info("Setting APN " + str(self._apn) + "...")
        self._networking_api.set_apn(self._ssid, self._apn)

        # Activate PDP context
        time.sleep(self._wait_btwn_cmd)
        self._logger.info("Active PDP Context...")
        self._networking_api.activate_pdp_context(self._ssid, check=False)

        # Check Data Connection State => PDP Active before timeout
        self._ns_data_2g.check_data_connection_state(
            "PDP_ACTIVE", self._registration_timeout)

        # Get RAT from Equipment
        network_type = self._ns_data_2g.get_network_type()

        # Check that DUT is registered on the good RAT
        self._modem_api.check_network_type_before_timeout(
            network_type, self._registration_timeout)

        return Global.SUCCESS, "No errors"
Example #12
0
    def decrease_cell_power_while_idle(self,
                                       ns_camped_cell,
                                       ns_camped_cell_power,
                                       ns_neighbour_cell,
                                       ns_neighbour_data,
                                       ns_neighbour_cell_service,
                                       decrementation_step_power,
                                       decrementation_step_timer,
                                       cresel_limit_power,
                                       cresel_power,
                                       ns_neighbour_model):
        """
        Decrease cell power in case of IDLE Cell Reselection

        :type ns_camped_cell: str
        :param ns_camped_cell: "Camped" Network Simulator Cell API
        :type ns_camped_cell_power: float
        :param ns_camped_cell_power: "Camped" Network Simulator cell power
        :type ns_neighbour_cell: str
        :param ns_neighbour_cell: "NEIGHBOUR" Network Simulator Cell API
        :type ns_neighbour_data: str
        :param ns_neighbour_data: "NEIGHBOUR" Network Simulator Data API
        :type ns_neighbour_cell_power: float
        :param ns_neighbour_cell_power: cell power of the neighbour cell
        :type decrementation_step_power: float
        :param decrementation_step_power: Decrementation step for
        NS1 cell power in dBm (must be positive, can be decimal value
        like 0,20 or 2,6)
        :type decrementation_step_timer: float
        :param decrementation_step_timer: Decrementation step timer
        in seconds between 2 steps (must be positive, can be
        decimal value like 0,3 or 3,5)
        :type cresel_power: float
        :param cresel_power: cell power of the neighbour cell
        :type cresel_limit_power: float
        :param cresel_limit_power: Limit power to stop the cell
        reselection power if reached
        """
        self._logger.info("Set the neighbour cell power to %.2f dBm ", cresel_power)

        # Set final Neighbour cell power to NS2_CELL_POWER
        ns_neighbour_cell.set_cell_power(cresel_power)

        # the Connection State to check we are using PXT or AGILENT8960
        if ns_neighbour_model == "AGILENT_8960":
            conn_state = "ATTACHED"
        elif ns_neighbour_model == "AGILENT_E6621A":
            conn_state = "CON"

        # WHILE DUT is registered to the "Camped"
        # cell AND ns_camped_cell_power <= cresel_limit_power
        dut_imsi = self._modem_api.get_imsi(self._registration_timeout)
        while True:
            # Decrement active cell power
            ns_camped_cell_power -= decrementation_step_power
            ns_camped_cell.set_cell_power(ns_camped_cell_power)

            # Wait during DECREMENTATION_STEP_TIMER
            time.sleep(decrementation_step_timer)

            if ns_neighbour_cell_service in ("GSM", "CIRCUIT"):
                # Check phone registration on equipment before given CAMP_TIMEOUT
                # (in loop compare every second the IMSI returned by the simulator
                # and IMSI read on CDK until comparison is true or timeout expired)
                if(RegUtil.check_dut_registration_before_timeout(ns_neighbour_cell,
                                                                 self._networking_api,
                                                                 self._logger,
                                                                 dut_imsi,
                                                                 decrementation_step_timer,
                                                                 flightmode_cycle=False,
                                                                 blocking=False)):

                    # Log the cell reselection success
                    self._logger.info(
                        "Cell reselection succeeded at %.2f dBm " +
                        "Camped cell power.",
                        ns_camped_cell_power)
                    # DUT Camped on neighbour cell, break function to quit the loop
                    break

            else:
                # Check Data Connection State => conn_state before timeout
                if ns_neighbour_data.check_data_connection_state(conn_state, decrementation_step_timer, False):
                    # Log the cell reselection success
                    self._logger.info(
                        "Cell reselection succeeded at %.2f dBm " +
                        "Camped cell power.",
                        ns_camped_cell_power)
                    # DUT Camped on neighbour cell, break function to quit the loop
                    break

            # IF ns_camped_cell_power < cresel_limit_power
            if ns_camped_cell_power < cresel_limit_power:

                # Log the cell reselection failure
                msg = self._logger.error("The Power's limit has been reached %.2f dBm, Cell reselection has failed",
                                         cresel_limit_power)

                # Return message and quit the method
                raise DeviceException(DeviceException.OPERATION_FAILED, msg)

        # IF DUT is registered to the Neighbour cell before registration timeout
        # When in GSM there is no data connection but IMSI have already been checked
        if ns_neighbour_cell_service in "GSM":
            # Log that cell reselection is done
            self._logger.info("Cell reselection success.")
            ns_camped_cell.set_cell_power(cresel_limit_power)
        elif ns_neighbour_data.check_data_connection_state(conn_state, decrementation_step_timer, False):
            # Check that DUT is registered on the good RAT
            self._modem_api.check_network_type_before_timeout(ns_neighbour_data.get_network_type(),
                                                              self._registration_timeout)
            # Log that cell reselection is done
            self._logger.info("Cell reselection success.")
            ns_camped_cell.set_cell_power(cresel_limit_power)
        else:
            # Log that Cell Reselection has failed
            msg = self._logger.error("Cell reselection has failed.")
            # Return message and quit the method
            raise DeviceException(DeviceException.OPERATION_FAILED, msg)
Example #13
0
    def decrease_cell_power_while_idle_no_pdp(self,
                                              ns_camped_cell,
                                              ns_camped_cell_power,
                                              ns_neighbour_cell,
                                              ns_neighbour_data,
                                              decrementation_step_power,
                                              decrementation_step_timer,
                                              cresel_limit_power,
                                              cresel_power,
                                              ns_neighbour_model):
        """
        Decrease cell power in case of IDLE Cell Reselection with no PDP context

        :type ns_camped_cell: str
        :param ns_camped_cell: "Camped" Network Simulator Cell API
        :type ns_camped_cell_power: float
        :param ns_camped_cell_power: "Camped" Network Simulator cell power
        :type ns_neighbour_cell: str
        :param ns_neighbour_cell: "NEIGHBOUR" Network Simulator Cell API
        :type ns_neighbour_data: str
        :param ns_neighbour_data: "NEIGHBOUR" Network Simulator Data API
        :type ns_neighbour_cell_power: float
        :param ns_neighbour_cell_power: cell power of the neighbour cell
        :type decrementation_step_power: float
        :param decrementation_step_power: Decrementation step for
        NS1 cell power in dBm (must be positive, can be decimal value
        like 0,20 or 2,6)
        :type decrementation_step_timer: float
        :param decrementation_step_timer: Decrementation step timer
        in seconds between 2 steps (must be positive, can be
        decimal value like 0,3 or 3,5)
        :type cresel_limit_power: float
        :param cresel_limit_power: Limit power to stop the cell
        :type cresel_power: float
        :param cresel_power: cell power of the neighbour cell
        reselection power if reached
        """
        self._logger.info("Set the neighbour cell power to %.2f dBm ", cresel_power)

        # Set final Neighbour cell power to NS2_CELL_POWER
        ns_neighbour_cell.set_cell_power(cresel_power)

        # WHILE DUT is registered to the "Camped"
        # cell AND ns_camped_cell_power <= cresel_limit_power
        dut_imsi = self._modem_api.get_imsi(self._registration_timeout)
        while True:
            # Wake up screen
            self._phone_system_api.wake_screen()

            # Decrement active cell power
            ns_camped_cell_power -= decrementation_step_power
            ns_camped_cell.set_cell_power(ns_camped_cell_power)

            # Wait during DECREMENTATION_STEP_TIMER
            time.sleep(decrementation_step_timer)

            # Check that DUT is registered on the good RAT
            if self._modem_api.check_network_type_before_timeout(ns_neighbour_data.get_network_type(),
                                                                 decrementation_step_timer):
                # Check phone registration on equipment before given CAMP_TIMEOUT
                # (in loop compare every second the IMSI returned by the simulator
                # and IMSI read on CDK until comparison is true or timeout expired)
                if(RegUtil.check_dut_registration_before_timeout(ns_neighbour_cell,
                                                                 self._networking_api,
                                                                 self._logger,
                                                                 dut_imsi,
                                                                 decrementation_step_timer,
                                                                 flightmode_cycle=False,
                                                                 blocking=False)):
                    # Log the cell reselection success
                    self._logger.info(
                        "Cell reselection succeeded at %.2f dBm " +
                        "Camped cell power.",
                        ns_camped_cell_power)
                    # DUT Camped on neighbour cell, break function to quit the loop
                    # Log that cell reselection is done
                    self._logger.info("Cell reselection success.")
                    ns_camped_cell.set_cell_power(cresel_limit_power)
                    break

            # IF ns_camped_cell_power < cresel_limit_power
            if ns_camped_cell_power < cresel_limit_power:

                # Log the cell reselection failure
                msg = self._logger.error("The Power's limit has been reached %.2f dBm, Cell reselection has failed",
                                         cresel_limit_power)

                # Return message and quit the method
                raise DeviceException(DeviceException.OPERATION_FAILED, msg)
Example #14
0
    def set_up(self):
        """
        Initialize the test
        """
        UseCaseBase.set_up(self)

        # Clear all data connections
        self._networking_api.clean_all_data_connections()
        time.sleep(self._wait_btwn_cmd)

        # Activate the flight mode.
        self._networking_api.set_flight_mode("on")

        # Connect to equipment
        self._ns.init()

        # Set the equipment application format WCDMA
        self._ns.switch_app_format("WCDMA")

        time.sleep(self._wait_btwn_cmd)
        # Perform a full preset
        self._ns.perform_full_preset()

        # Set cell off
        self._ns_cell_3g.set_cell_off()

        # Set IP addresses for the 3GSM NS
        self._ns.set_ip_addresses(self._ns_IP_Lan1, self._ns_IP_Lan2,
                                  self._ns_Subnet_Mask,
                                  self._ns_Default_Gateway,
                                  self._ns_DUT_IP_Address, self._ns_DNS1,
                                  self._ns_DNS2)

        if self._ip_version == "IPV6":
            # Setting the version of the first DUT IP to IPV6
            self._ns_data_3g.set_dut_ip_version(1, "IP6")
            # Setting the IPv6 Prefix and IID
            self._ns_data_3g.set_ip6_network_parameters(
                self._server_ip_v6_address)
            # Setting the DUT IPv6 Prefix and IID
            self._ns_data_3g.set_dut_ip6_network_parameters(
                self._server_ip_v6_address)
            # Setting the Agilent to IPV6 router mode.
            self._ns.set_ipv6_router_mode("ON")

        elif self._ip_version == "IPV4V6":
            # Setting the version of the first DUT IP to IPV6
            self._ns_data_3g.set_dut_ip_version(1, "DUAL")
            # Setting the IPv6 Prefix and IID
            self._ns_data_3g.set_ip6_network_parameters(
                self._server_ip_v6_address)
            # Setting the DUT IPv6 Prefix and IID
            self._ns_data_3g.set_dut_ip6_network_parameters(
                self._server_ip_v6_address)
            # Setting the Agilent to IPV6 router mode.
            self._ns.set_ipv6_router_mode("ON")

        else:
            # Setting the version of the first DUT IP to IPV4
            self._ns_data_3g.set_dut_ip_version(1, "IP4")
            # Setting the Agilent to IPV6 router mode.
            self._ns.set_ipv6_router_mode("OFF")

        # Set the DUT IP address 2 if not empty str.
        if self._ns_DUT_IP_Address2 != "":
            self._ns_data_3g.set_dut_ip_address(2, self._ns_DUT_IP_Address2)

        # 3G default cell setup
        RegUtil.setup_cell(self._ns_number, self._ns_model, "3G", self._band,
                           self._ns_cell_rel, self._logger)

        # Set Cell Band and ARFCN using 3GSM_CELL_BAND
        # and 3GSM_ARFCN parameters
        # Set cell service using 3GSM_CELL_SERVICE parameter
        # Set Cell Power using 3GSM_CELL_POWER parameter
        # Set Cell LAC using 3GSM_LAC_VALUE parameter
        # Set Cell RAC using 3GSM_RAC_VALUE parameter
        self._ns_cell_3g.configure_basic_cell_parameters(
            self._cell_service, self._band, self._dl_uarfcn, self._cell_power)

        # Set BCH update page state to AUTO
        self._ns_cell_3g.set_bch_update_page_state("AUTO")

        # Set Frequency points using frequency list
        # Set Amplitude Offset correction using offset list
        # Turning amplitude offset state to ON
        self._ns.configure_amplitude_offset_table()

        # If the fast dormancy parameter is set to disable do nothing to
        # avoid regressions.
        if self._ns_fast_dormancy.lower() == "enable":
            # Setting fast dormancy support according to the parameter
            # present in the bench config.
            self._ns_data_3g.\
                set_fast_dormancy_support("enable", self._rrc_inactivity_timer)

        # Set Uplink channel mode control to auto
        self._ns_cell_3g.set_uplink_channel_mode("ON")

        # Active SRB  Configuration Control to AUTO
        self._ns_cell_3g.set_srb_config_control("ON")

        # Set the initial PS Data RRC State to DCH
        self._ns_data_3g.set_initial_ps_data_rrc_state("DCH")

        # Sets the GPRS Radio Access Bearer
        if self._ul_rab.find("HSUPA_CAT") != -1:
            self._ns_data_3g.set_gprs_radio_access_bearer("HSUPA", "HSDPA")
        else:
            self._ns_data_3g.set_gprs_radio_access_bearer(
                self._ul_rab, "HSDPA")

        # Set the category configuration to AUTO
        self._ns_data_3g.set_category_control_mode("ON")

        # Set channel type, the default value is "HSPA"
        self._ns_cell_3g.set_rbt_channel_type(self._rbt_channel_type)

        # Call specific configuration functions
        self._setup_high_categories(self._ns_number)

        # configure HS-DSCH config type (FIXED, REPORTED, USER_DEFINED)
        self._ns_data_3g.set_ps_data_configuration_type(self._cqi_scheme)

        if self._cqi_scheme == "FIXED":
            self._ns_data_3g.set_cqi_value(self._cqi)

        # Set the TTI value
        if self._tti:
            self._ns_data_3g.set_hsupa_tti(self._tti)

        # Call specific configuration functions
        self._setup_cpc_feature(self._ns_number)
        # Set Ps Data E-RGCH Information state to off
        # Only if this param is overridden in the UC
        # The default value is ON to transmit an E-RGCH from test set
        if self._ps_data_ergch_information_state == "OFF":
            self._ns_cell_3g.set_ps_data_ergch_information_state(
                self._ps_data_ergch_information_state)

        # Set PS Data HS-DSCH MAC-d PDU Size
        self._ns_data_3g.set_macd_pdu_size(self._mac_d_pdu_size)

        # Phone has to see the cell off!
        self._modem_api.check_cdk_no_registration_bfor_timeout(
            self._registration_timeout)

        # Set cell on
        self._ns_cell_3g.set_cell_on()

        # Deactivate the flight mode.
        self._networking_api.set_flight_mode("off")

        # Check Data Connection State => ATTACHED before timeout
        self._ns_data_3g.check_data_connection_state(
            "ATTACHED", self._registration_timeout)

        # Check registration state is connected using
        # registrationTimeout from Device_Catalog.xml (Non blocking
        # for this test if function isn't implemented on CDK)
        self._modem_api.check_cdk_registration_bfor_timeout(
            self._registration_timeout)

        # Set the APN
        time.sleep(self._wait_btwn_cmd)
        # Increase cell power if needed
        check_and_set_minimal_cell_power(self._ns_cell_3g, self._modem_api,
                                         self._dut_config, self._cell_power)

        if self._ip_version == "IPV6":
            self._logger.info("Setting APN " + str(self._apn) + " on " +
                              str(self._ip_version))
            self._networking_api.set_apn(self._ssid, self._apn, None, None,
                                         self._ip_version)
        elif self._ip_version == "IPV4V6":
            self._logger.info("Setting APN " + str(self._apn) + " on " +
                              str(self._ip_version))
            self._networking_api.set_apn(self._ssid, self._apn, None, None,
                                         self._ip_version)
        else:
            self._logger.info("Setting APN " + str(self._apn) + " on IPV4 ")
            self._networking_api.set_apn(self._ssid, self._apn)

        RegUtil.configure_ims_for_8960(self._ns_data_3g, self._networking_api,
                                       self._logger)

        if self._pdp_activation.lower() == "true":

            # Activate PDP context
            time.sleep(self._wait_btwn_cmd)
            self._logger.info("Active PDP Context...")
            self._networking_api.activate_pdp_context(self._ssid, False)

            # Force screen on to avoid end of PDP context due to fast dormancy
            self._phone_system.wake_screen()
            self._phone_system.set_phone_screen_lock_on(1)
            # Check Data Connection State => PDP Active before timeout
            self._ns_data_3g.check_data_connection_state(
                "PDP_ACTIVE", self._registration_timeout, blocking=False)

            # Get RAT from Equipment
            network_type = self._ns_data_3g.get_network_type()

            # Check that DUT is registered on the good RAT
            self._modem_api.check_network_type_before_timeout(
                network_type, self._registration_timeout)
            # Force screen on to avoid end of PDP context due to fast dormancy
            self._phone_system.wake_screen()
            self._phone_system.set_phone_screen_lock_on(1)
            if self._ns_data_3g.get_data_connection_status() != "PDP_ACTIVE":
                self._networking_api.reactivate_pdp_context(self._ssid, False)
                self._ns_data_3g.check_data_connection_state(
                    "PDP_ACTIVE", self._registration_timeout, blocking=False)
            # Check IP protocol if needed (not needed for KPI test)
            if not self._kpi_test:
                self._networking_api.check_ip_protocol(self._ip_version)

        return Global.SUCCESS, "No errors"
Example #15
0
    def set_up(self):
        """
        Set up the test configuration
        """

        # Call use case base Setup function
        UseCaseBase.set_up(self)

        # Ensure flight mode off so that GSM sim operator info can be retrieved
        self._networking_api.set_flight_mode("off")
        time.sleep(self._wait_btwn_cmd)

        # Determinates the kind of registration state to wait
        # by comparing test case MCC/MNC parameters to sim MCC/MNC
        sim_info = self._modem_api.get_sim_operator_info()
        if sim_info["MCC"] != self._mcc or\
                sim_info["MNC"] != self._mnc:
            self._wanted_reg_state = "roaming"
        else:
            self._wanted_reg_state = "registered"

        # Clear all data connections
        self._networking_api.clean_all_data_connections()
        time.sleep(self._wait_btwn_cmd)

        # Enable flight mode
        self._networking_api.set_flight_mode("on")

        # Connect to equipment using GPIBAddress and GPIBBoardId
        self._ns.init()

        # Set the equipment application format GSM/GPRS
        self._ns.switch_app_format("GSM/GPRS")

        # Perform a full preset
        self._ns.perform_full_preset()

        # Set cell off
        self._ns_cell_2g.set_cell_off()

        # Set Frequency points using frequency list
        # Set Amplitude Offset correction using offset list
        # Turning amplitude offset state to ON
        self._ns.configure_amplitude_offset_table()

        # Set Cell Band  using CELL_BAND parameter
        self._ns_cell_2g.set_band(self._band_name)

        # Set Broadcast Channel Arfcn using BCH_ARFCN parameter
        self._ns_cell_2g.set_bcch_arfcn(self._bch_arfcn)

        # Set Traffic Channel Arfcn using TCH_ARFCN parameter
        self._ns_cell_2g.set_tch_arfcn(self._tch_arfcn)

        # Set Mobile Country Code (MCC)
        self._ns_cell_2g.set_mcc(self._mcc)

        # Set Mobile Network Code (MNC)
        self._ns_cell_2g.set_mnc(self._mnc)

        # Set cell service using CELL_SERVICE parameter
        self._ns_cell_2g.set_cell_service(self._cell_service)

        # Set Cell Power using CELL_POWER parameter
        self._ns_cell_2g.set_cell_power(self._cell_power)

        # Set VOICE_CODER_RATE
        self._ns_voice_call_2g.set_audio_codec(self._voice_coder_rate)

        # Set DTM OFF
        self._logger.info("Setting DTM OFF")
        self._ns_cell_2g.set_dtm_state("OFF")

        # Set cell on
        self._ns_cell_2g.set_cell_on()

        # Disable airplane mode
        self._networking_api.set_flight_mode("off")

        # Adapt attachment procedure to CIRCUIT or PACKET
        if "GSM" not in self._cell_service:
            # Set the APN
            time.sleep(self._wait_btwn_cmd)
            self._logger.info("Setting APN " + str(self._apn) + "...")
            self._networking_api.set_apn(self._ssid, self._apn)

            # Activate PDP context
            time.sleep(self._wait_btwn_cmd)
            self._logger.info("Active PDP Context...")
            self._networking_api.activate_pdp_context(self._ssid, check=False)

            # Check Data Connection State => PDP_ACTIVE before timeout
            RegUtil.check_dut_data_connection_state_before_timeout("PDP_ACTIVE",
                                                                   self._ns_cell_2g,
                                                                   self._networking_api,
                                                                   self._logger,
                                                                   self._registration_timeout,
                                                                   flightmode_cycle=True,
                                                                   blocking=False)

        # Check registration state is connected using
        # registrationTimeout from Device_Catalog.xml
        self._logger.info("Check network registration status is %s on DUT" %
                          self._wanted_reg_state)
        if self._wanted_reg_state == "roaming":
            self._modem_api.check_cdk_state_bfor_timeout(
                self._wanted_reg_state,
                self._registration_timeout)
        else:
            self._modem_api.check_cdk_registration_bfor_timeout(self._registration_timeout)

        # Get RAT from Equipment
        network_type = self._ns_data_2g.get_network_type()

        # Check that DUT is registered on the good RAT
        self._modem_api.check_network_type_before_timeout(network_type,
                                                          self._registration_timeout)

        return Global.SUCCESS, "No errors"
Example #16
0
    def set_up(self):
        """
        Initialize the test
        """
        UseCaseBase.set_up(self)

        # Ensure flight mode off so that GSM sim operator info can be retrieved
        self._networking_api.set_flight_mode("off")
        time.sleep(self._wait_btwn_cmd)

        # Determinates the kind of registration state to wait
        # by comparing test case MCC/MNC parameters to sim MCC/MNC
        sim_info = self._modem_api.get_sim_operator_info()
        if sim_info["MCC"] != self._mcc or\
                sim_info["MNC"] != self._mnc:
            self._wanted_reg_state = "roaming"
            self._networking_api.set_roaming_mode("ON")
        else:
            self._wanted_reg_state = "registered"

        # Clear all data connections
        self._networking_api.clean_all_data_connections()
        time.sleep(self._wait_btwn_cmd)
        # Activate the flight mode.
        self._networking_api.set_flight_mode("on")

        # Connect to equipment using GPIBAddress and GPIBBoardId
        self._ns.init()

        # Set the equipment application format WCDMA
        self._ns.switch_app_format("WCDMA")
        time.sleep(self._wait_btwn_cmd)
        # Perform a full preset
        self._ns.perform_full_preset()

        # Set cell off
        self._ns_cell_3g.set_cell_off()

        # Set IP addresses for the 3GSM NS
        self._ns.set_ip_addresses(self._ns_IP_Lan1, self._ns_IP_Lan2,
                                  self._ns_Subnet_Mask,
                                  self._ns_Default_Gateway,
                                  self._ns_DUT_IP_Address, self._ns_DNS1,
                                  self._ns_DNS2)

        if self._ip_version == "IPV6":
            # Setting the version of the first DUT IP to IPV6
            self._ns_data_3g.set_dut_ip_version(1, "IP6")
            # Setting the IPv6 Prefix and IID
            self._ns_data_3g.set_ip6_network_parameters(
                self._server_ip_v6_address)
            # Setting the DUT IPv6 Prefix and IID
            self._ns_data_3g.set_dut_ip6_network_parameters(
                self._server_ip_v6_address)
            # Setting the Agilent to IPV6 router mode.
            self._ns.set_ipv6_router_mode("ON")
        elif self._ip_version == "IPV4V6":
            # Setting the version of the first DUT IP to IPV6
            self._ns_data_3g.set_dut_ip_version(1, "DUAL")
            # Setting the IPv6 Prefix and IID
            self._ns_data_3g.set_ip6_network_parameters(
                self._server_ip_v6_address)
            # Setting the DUT IPv6 Prefix and IID
            self._ns_data_3g.set_dut_ip6_network_parameters(
                self._server_ip_v6_address)
            # Setting the Agilent to IPV6 router mode.
            self._ns.set_ipv6_router_mode("ON")

        # Set the DUT IP address 2 if not empty str.
        if self._ns_DUT_IP_Address2 != "":
            self._ns_data_3g.set_dut_ip_address(2, self._ns_DUT_IP_Address2)

        # 3G default cell setup
        RegUtil.setup_cell(self._ns_number, self._ns_model, "3G", self._band,
                           self._ns_cell_rel, self._logger)

        # Set Cell Band and ARFCN using 3GSM_CELL_BAND
        # and 3GSM_ARFCN parameters
        # Set cell service using 3GSM_CELL_SERVICE parameter
        # Set Cell Power using 3GSM_CELL_POWER parameter
        # Set Cell LAC using 3GSM_LAC_VALUE parameter
        # Set Cell RAC using 3GSM_RAC_VALUE parameter
        self._ns_cell_3g.configure_basic_cell_parameters(
            self._cell_service, self._band, self._dl_uarfcn, self._cell_power,
            1, 1, self._mcc, self._mnc)

        message = "Expected network registration state to be %s while " \
            "HPMLN coverage is %s, MCCODE is %s and MNCODE is %s" % (
                str(self._wanted_reg_state),
                str(self._hplmn_coverage),
                str(self._mcc),
                str(self._mnc))
        self._logger.info(message)

        # Set BCH update page state to AUTO
        self._ns_cell_3g.set_bch_update_page_state("AUTO")

        # Set Frequency points using frequency list
        # Set Amplitude Offset correction using offset list
        # Turning amplitude offset state to ON
        self._ns.configure_amplitude_offset_table()

        # If the fast dormancy parameter is set to disable do nothing to
        # avoid regressions.
        if self._ns_fast_dormancy.lower() == "enable":
            # Setting fast dormancy support according to the parameter
            # present in the bench config.
            self._ns_data_3g.\
                set_fast_dormancy_support("enable")

        # Set Uplink channel mode control to auto
        self._ns_cell_3g.set_uplink_channel_mode("ON")

        # Active SRB  Configuration Control to AUTO
        self._ns_cell_3g.set_srb_config_control("ON")

        # Set the initial PS Data RRC State to DCH
        self._ns_data_3g.set_initial_ps_data_rrc_state("DCH")

        # Sets the GPRS Radio Access Bearer
        self._ns_data_3g.set_gprs_radio_access_bearer(self._ul_rab,
                                                      self._dl_rab)

        # Deactivate HSUPA and HSDPA capabilities
        self._ns_data_3g.set_edch_cell_capability("OFF")
        self._ns_data_3g.set_hsdpa_cell_capability("OFF")

        # Phone has to see the cell off!
        self._modem_api.check_cdk_no_registration_bfor_timeout(
            self._registration_timeout)

        # Set cell on
        self._ns_cell_3g.set_cell_on()

        # Deactivate the flight mode.
        self._networking_api.set_flight_mode("off")

        # Check Data Connection State => ATTACHED before timeout
        self._ns_data_3g.check_data_connection_state(
            "ATTACHED", self._registration_timeout)

        # Check registration state is connected using
        # registrationTimeout from Device_Catalog.xml (Non blocking
        # for this test if function isn't implemented on CDK)
        self._modem_api.check_cdk_state_bfor_timeout(
            self._wanted_reg_state, self._registration_timeout)

        # Set the APN
        time.sleep(self._wait_btwn_cmd)

        if self._ip_version == "IPV6":
            self._logger.info("Setting APN " + str(self._apn) + " on " +
                              str(self._ip_version) + "...")
            self._networking_api.set_apn(self._ssid, self._apn, None, None,
                                         self._ip_version)
        elif self._ip_version == "IPV4V6":
            self._logger.info("Setting APN " + str(self._apn) + " on " +
                              str(self._ip_version) + "...")
            self._networking_api.set_apn(self._ssid, self._apn, None, None,
                                         self._ip_version)
        else:
            self._logger.info("Setting APN " + str(self._apn) + " on IPV4 ")
            self._networking_api.set_apn(self._ssid, self._apn)

        if self._wanted_reg_state == "registered":
            # Activate PDP context
            time.sleep(self._wait_btwn_cmd)
            self._logger.info("Active PDP Context...")
            self._networking_api.activate_pdp_context(self._ssid)

            # Check Data Connection State => PDP Active before timeout
            self._ns_data_3g.check_data_connection_state(
                "PDP_ACTIVE", self._registration_timeout, blocking=False)

            # Get RAT from Equipment
            network_type = self._ns_data_3g.get_network_type()

            # Check that DUT is registered on the good RAT
            self._modem_api.check_network_type_before_timeout(
                network_type, self._registration_timeout)

        return Global.SUCCESS, "No errors"
    def set_up(self):
        """
        Set up the test configuration
        """

        # Call use case base Setup function
        UseCaseBase.set_up(self)

        # Clear all data connections
        self._networking_api.clean_all_data_connections()
        time.sleep(self._wait_btwn_cmd)

        # Connect to equipment
        self._ns.init()

        # Set the equipment Application Format = "GSM/GPRS"
        self._ns.switch_app_format("GSM/GPRS")

        # Perform full preset
        self._ns.perform_full_preset()

        # Set cell off
        self._ns_cell_2g.set_cell_off()

        # Set Frequency points using frequency list
        # Set Amplitude Offset correction using offset list
        # Turning amplitude offset state to ON
        self._ns.configure_amplitude_offset_table()

        # Set serving cell to EGPRS
        self._ns_cell_2g.set_cell_service("EGPRS")

        # Set cell power using CELL_POWER value
        self._ns_cell_2g.set_cell_power(self._cell_power)

        # Select the band
        self._ns_cell_2g.set_band(self._band_name)

        # Set broadcast channel ARFCN using BCH_ARFCN value
        self._ns_cell_2g.set_bcch_arfcn(self._bch_arfcn)

        # Set packet data channel ARFCN using PDTCH_ARFCN value
        self._ns_cell_2g.set_pdtch_arfcn(self._pdtch_arfcn)

        # Set cell on
        self._ns_cell_2g.set_cell_on()

        # Check Data Connection State => ATTACHED before timeout
        RegUtil.check_dut_data_connection_state_before_timeout("ATTACHED",
                                                               self._ns_cell_2g,
                                                               self._networking_api,
                                                               self._logger,
                                                               self._registration_timeout,
                                                               flightmode_cycle=True,
                                                               blocking=False)

        # Check registration state is connected using
        # registrationTimeout from Device_Catalog.xml
        self._modem_api.check_cdk_registration_bfor_timeout(
            self._registration_timeout)

        # Set the APN
        time.sleep(self._wait_btwn_cmd)
        self._logger.info("Setting APN " + str(self._apn) + "...")
        self._networking_api.set_apn(self._ssid, self._apn)

        # Activate PDP context
        time.sleep(self._wait_btwn_cmd)
        self._logger.info("Active PDP Context...")
        self._networking_api.activate_pdp_context(self._ssid)

        # Check Data Connection State => PDP Active before timeout
        self._ns_data_2g.check_data_connection_state("PDP_ACTIVE",
                                                     self._registration_timeout,
                                                     blocking=False)

        # Get RAT from Equipment
        network_type = self._ns_data_2g.get_network_type()

        # Check that DUT is registered on the good RAT
        self._modem_api.check_network_type_before_timeout(network_type,
                                                          self._registration_timeout)

        return Global.SUCCESS, "No errors"
Example #18
0
    def set_up(self):
        """
        Initialize the test
        """

        # Call UseCase base set_up function
        UseCaseBase.set_up(self)

        # get original audio output
        self._origianl_audio_output = \
            self._phonesystem_api.get_audio_output()

        # get original silent mode and vibrate mode
        self._original_silent_vibrate = \
            self._phonesystem_api.get_silent_vibrate()

        # Connect to equipment using GPIBBoardId and GPIBAddress parameters
        self._ns.init()

        # Set the equipment application format WCDMA
        self._ns.switch_app_format("WCDMA")

        # Perform a full preset
        self._ns.perform_full_preset()

        # Set Cell off
        self._ns_cell_3g.set_cell_off()

        # Set Frequency points using frequency list
        # Set Amplitude Offset correction using offset list
        # Turning amplitude offset state to ON
        self._ns.configure_amplitude_offset_table()

        # "Set Cell Service in function of the CELL_SERVICE value :
        # ""CIRCUIT"" : paging service is AMR
        #                 PS domain is ABSENT
        # ""PACKET"" : paging service is GPRS
        #                PS domain is PRESENT
        # ""CIRCUIT_PACKET"": paging service is AMR
        #                              PS domain is PRESENT
        # ""RBTEST"" : paging service is RBT"
        self._ns_cell_3g.set_cell_service(self._cell_service)

        # Set Cell Band UARFCN (downlink) using Band and DlUarfcn
        self._ns_cell_3g.set_band_and_dl_arfcn(
            "BAND" + str(self._band), self._dl_uarfcn)

        # Set Cell Band UARFCN (uplink) in auto mode
        self._ns_cell_3g.set_uplink_channel_mode("ON")

        # Set Audio codec using VOICE_CODER_RATE parameter
        self._ns_voice_call_3g.set_audio_codec(self._voice_coder_rate)

        # Set SRB  Configuration Control to auto
        self._ns_cell_3g.set_srb_config_control("ON")

        # Set Cell Power using CELL_POWER parameter
        self._ns_cell_3g.set_cell_power(self._cell_power)

        # Set Cell on
        self._ns_cell_3g.set_cell_on()

        # Set ringtone time using RT_TIME parameter, no command in 8960 for
        # this setting right now
        # self._ns._voice_call_3g.set_mt_originate_call_timeout(self._rt_time)

        # Adapt attachment procedure to CIRCUIT or PACKET
        if self._cell_service == "CIRCUIT":
            # Check phone registration on equipment before given CAMP_TIMEOUT
            # (in loop compare every second the IMSI returned by the simulator
            # and IMSI read on CDK until comparison is true or timeout expired)
            dut_imsi = self._modem_api.get_imsi(self._registration_timeout)

            RegUtil.check_dut_registration_before_timeout(self._ns_cell_3g,
                                                          self._networking_api,
                                                          self._logger,
                                                          dut_imsi,
                                                          self._registration_timeout)
        else:
            # Check Data Connection State => ATTACHED before timeout
            RegUtil.check_dut_data_connection_state_before_timeout("ATTACHED",
                                                                   self._ns_cell_3g,
                                                                   self._networking_api,
                                                                   self._logger,
                                                                   self._registration_timeout,
                                                                   flightmode_cycle=True,
                                                                   blocking=False)

        # Check registration state is connected using
        # registrationTimeout from Device_Catalog.xml
        self._modem_api.check_cdk_registration_bfor_timeout(
            self._registration_timeout)

        # Get RAT from Equipment
        network_type = self._ns_data_3g.get_network_type()

        # Check that DUT is registered on the good RAT
        self._modem_api.check_network_type_before_timeout(network_type,
                                                          self._registration_timeout)

        return Global.SUCCESS, "No errors"
    def set_up(self):
        """
        Set up the test configuration
        """

        # Call UseCaseBase Setup function
        UseCaseBase.set_up(self)

        # Connect to cellular network simulator
        self._ns.init()

        # Set the equipment application format WCDMA
        self._ns.switch_app_format("WCDMA")

        if self._audio_analyzer_node.get_param_value("Model") in "RS_UPV":
            # Connect to audio analyzer
            self._audio_analyzer.init()

            if self._aa_ref_file_path:
                # Copy audio test file to UPV
                self._audio_analyzer.copy_to_upv(self._host_ref_file_path,
                                                 self._aa_ref_file_path)

            # Load setup on UPV
            self._audio_analyzer.load_configuration(
                self._name,
                str(self._ns_node.get_param_value("Model")),
                self._aa_ref_file_path,
                self._codec_type,
                self._option)

            if not os.path.exists(os.path.join(self._aa_conf_path, "UPV_traces")):
                os.mkdir(os.path.join(self._aa_conf_path, "UPV_traces"))

        elif self._audio_analyzer_node.get_param_value("Model") in "AUDIO_FRAMEWORK":
            AudioFramework.initialize_fwk(self._audio_framework)

        # Perform Full Preset
        self._ns.perform_full_preset()

        # Set paging service to AMR VOICE
        self._ns.get_cell_3g().set_cell_service(self._cell_service)

        # Set cell off
        self._ns_3g.set_cell_off()

        # Set Cell Band UARFCN (downlink) using Band and DlUarfcn
        self._ns.get_cell_3g().set_band_and_dl_arfcn(str(self._band), self._dl_uarfcn)

        # Set voice call output
        self._vc_3g.set_speech_configuration(self._ns_speech_source)

        # Set cell on
        self._ns_3g.set_cell_on()

        # Adapt attachment procedure to CIRCUIT or PACKET
        if self._cell_service == "CIRCUIT":
            # Check phone registration on equipment before given CAMP_TIMEOUT
            # (in loop compare every second the IMSI returned by the simulator
            # and IMSI read on CDK until comparison is true or timeout expired)
            dut_imsi = \
                self._modem_api.get_imsi(self._registration_timeout)

            RegUtil.check_dut_registration_before_timeout(self._ns.get_cell_3g(),
                                                          self._networking_api,
                                                          self._logger,
                                                          dut_imsi,
                                                          self._registration_timeout)
            self._networking_api.deactivate_pdp_context()

        else:
            # Set the APN
            time.sleep(self._wait_btwn_cmd)
            self._logger.info("Setting APN " + str(self._apn) + "...")
            self._networking_api.set_apn(self._ssid, self._apn)

            # Activate PDP context
            time.sleep(self._wait_btwn_cmd)
            self._logger.info("Active PDP Context...")
            self._networking_api.activate_pdp_context(self._ssid, check=False)

            # Check Data Connection State => ATTACHED before timeout
            RegUtil.check_dut_data_connection_state_before_timeout("PDP_ACTIVE",
                                                                   self._ns.get_cell_3g(),
                                                                   self._networking_api,
                                                                   self._logger,
                                                                   self._registration_timeout,
                                                                   flightmode_cycle=True,
                                                                   blocking=False)

        # Check registration status before registrationTimeout (CDK)
        self._modem_api.check_cdk_registration_bfor_timeout(self._registration_timeout)

        # Release any previous call (Robustness)
        self._voicecall_api.release()

        # Set voice codec using CODEC parameter
        self._vc_3g.set_audio_codec(self._codec)

        return Global.SUCCESS, "No errors"
Example #20
0
    def set_up(self):
        """
        Initialize the test
        """
        UseCaseBase.set_up(self)

        # Ensure flight mode off so that GSM sim operator info can be retrieved
        self._networking_api.set_flight_mode("off")
        time.sleep(self._wait_btwn_cmd)

        # Determinates the kind of registration state to wait
        # by comparing test case MCC/MNC parameters to sim MCC/MNC
        sim_info = self._modem_api.get_sim_operator_info()
        if sim_info["MCC"] != self._mcc or\
                sim_info["MNC"] != self._mnc:
            self._wanted_reg_state = "roaming"
            self._networking_api.set_roaming_mode("ON")
        else:
            self._wanted_reg_state = "registered"

        # Clear all data connections
        self._networking_api.clean_all_data_connections()
        time.sleep(self._wait_btwn_cmd)

        # Flight mode activation
        self._networking_api.set_flight_mode("on")

        # Phone has to see the cell off!
        self._modem_api.check_cdk_no_registration_bfor_timeout(
            self._registration_timeout)

        # Connect to equipment
        self._ns.init()

        # Perform a full preset
        self._ns.perform_full_preset()

        # Wait a while for the full preset
        time.sleep(self._wait_btwn_cmd)

        # Set EPC off, not for CMW500 because DAU starting is a long lasting time operation
        if self._ns_model == "AGILENT_E6621A":
            self._ns_data_4g.set_epc_off()

        # Set cell off
        self._ns_cell_4g.set_cell_off()

        self._ns.configure_amplitude_offset_table()

        self._check_ip_version()

        if self._ip_version in ["IPV4V6", "IPV6"]:
            self._ns_dut_ip_Address = self._ns_dut_ipv6_Address

        # Perform setup for a FDD cell
        if self._duplex_type == "FDD":
            # Load Cell Configuration
            self._ns.load_cell_config("COMMON_LTE", self._ns_number)
            self._ns.load_cell_config(self._cell_band, self._ns_number)
            if self._carrier_aggregation:
                self._ns.load_cell_config("CAT6", self._ns_number)
            if self._ims == "on":
                self._ns.load_cell_config("COMMON_IMS", self._ns_number)
                if self._ip_version != "IPV4":
                    self._ns_data_4g.set_ims_ip_version(self._ip_version)

            # Call specific configuration functions
            RegUtil.setup_cell_lte(self._ns, self._mcc, self._mnc,
                                   self._ns_dut_ip_Address, self._signal_mode,
                                   self._cell_id, self._physical_cell_id,
                                   self._mimo, self._cell_power_rf1,
                                   self._cell_power_rf2, self._scenario_path,
                                   self._cell_band, self._dl_earfcn, self._apn)

            # Set EPC on for Agilent PXT or DAU for RCW500
            self._ns_data_4g.set_epc_on()

            if self._ims == "on":
                self._ns_cell_4g.set_ims_on()

            time.sleep(self._wait_btwn_cmd)

            # stop scenario to set cell parameters
            self._ns.stop_scenario()
            # set configuration for LTE
            self._ns_cell_4g.set_lte_configuration(
                self._antennas_number, self._bandwidth,
                self._transmission_mode, self._type0_bitmap,
                self._ul_grant_mode, self._dl_nb_rb, self._dl_i_mcs,
                self._ul_nb_rb, self._ul_i_mcs, self._mimo,
                self._carrier_aggregation)

            # Set configugation on Secondary Component Carrier
            if self._carrier_aggregation:
                self._ns_cell_4g.set_secondary_carrier_configuration(
                    self._scc_band, self._scc_earfcn, self._scc_bandwidth,
                    self._cell_power_rf1, self._scc_dl_nb_rb,
                    self._scc_dl_i_mcs)
            # Start the scenario
            self._ns.start_scenario()
        elif self._duplex_type == "TDD":
            if self._ip_version in ["IPV4V6", "IPV6"]:
                # Setting the IPv6 Prefix and IID on the CallBox
                self._ns_data_4g.set_ip6_network_parameters(
                    self._server_ip_v6_address)
            # Set the DUT IP address
            self._ns_data_4g.set_dut_ip_address(self._ns_dut_ip_Address)
            # Load LTE TDD optimal configuration
            self._ns.load_cell_config("TDD_COMMON", self._ns_number)
            if hasattr(self, "_lte_tdd_config"):
                self._ns.load_cell_config(self._lte_tdd_config,
                                          self._ns_number)
            if self._cell_band is not None and not self._switch_tdd_fdd:
                self._ns_cell_4g.set_cell_band(self._cell_band)
                self._ns_cell_4g.set_downlink_earfcn(self._dl_earfcn)

            # Set MIMO mode
            self._ns_cell_4g.set_lte_tdd_configuration(self._antennas_number,
                                                       self._mimo)
        else:
            return Global.FAILURE, "Wrong duplex type for LTE: %s it must be FDD or TDD" % self._duplex_type

        return Global.SUCCESS, "No errors"
    def set_up(self):
        """
        Set up the test configuration
        """
        # Call LabMobilityLte3gsmBase set_up function
        LabMobilityLte3gsmBase.set_up(self)

        # Setting the EPC OFF on PXT
        self._ns_lte_data.set_epc_off()

        # Set Network Simulator 3GSM cell on
        self._ns_3gsm_cell.set_cell_on()

        # Set the LTE cell on
        self._ns_lte_cell.set_cell_on(self._ns_lte_mimo)

        # Set entries in the equivalent PLMN list
        self._ns_3gsm_cell.set_equivalent_plmn_list_points(
            self._ns_lte_mcc, self._ns_lte_mnc)

        # Disconnect from external EPC
        self._ns_3gsm.disconnect_from_external_epc()

        #  Set External EPC connection
        self._ns_3gsm_cell.set_external_epc_connection(self._ns_lte_ip_lan1,
                                                       self._ns_lte_dl_earfcn)

        # Set EPC on
        self._ns_lte_data.set_epc_on()

        # STOP the scenario for PXT for allowing the DUT to camp on 3G/2G cell before
        self._ns_lte.stop_scenario()

        # Flight mode deactivation
        self._networking_api.set_flight_mode("off")

        # Set primary cell to first cell
        self._cell_in_use = 1

        self._logger.info("Check if DUT is attached to cell %d (DUT check)",
                          self._cell_in_use)
        self._modem_api.check_cdk_registration_bfor_timeout(
            self._registration_timeout)

        # Check Data Connection State => ATTACHED before timeout
        self._logger.info("Check if DUT is attached to cell %d (NW check)",
                          self._cell_in_use)
        self._ns_3gsm_data.check_data_connection_state(
            "ATTACHED", self._registration_timeout, blocking=False)

        # Activate PDP context
        time.sleep(self._wait_btwn_cmd)
        self._logger.info("Active PDP Context...")
        self._networking_api.activate_pdp_context(self._ssid, False)

        # Check Data Connection State => PDP_ACTIVE before timeout
        wait_pdp_active_state_timeout = 100
        regutil.check_dut_data_connection_state_before_timeout(
            "PDP_ACTIVE",
            self._ns_3gsm_cell,
            self._networking_api,
            self._logger,
            wait_pdp_active_state_timeout,
            flightmode_cycle=False,
            blocking=False)
        # Check that DUT is registered on the good RAT
        self._logger.info(
            "Check if DUT is attached to cell %d with the good RAT",
            self._cell_in_use)
        self._modem_api.check_network_type_before_timeout(
            self._ns_3gsm_data.get_network_type(), self._registration_timeout)

        # Because the DUT is normally 4G preferred, run the scenario on PXT only after the DUT
        # is already registered on UTRAN cell
        self._ns_lte.start_scenario()

        return Global.SUCCESS, "No errors"
Example #22
0
    def set_up(self):
        """
        Set up the test configuration
        """
        # Call LabMobilityBase Setup function
        LabMobilityBase.set_up(self)

        if self._ns1_cell_tech == "2G":
            # Set the equipment application format depending on NS1_CELL_TECH.
            # If 2G switch to ""GSM/GPRS""
            self._ns1.switch_app_format("GSM/GPRS")
        elif self._ns1_cell_tech == "3G":
            # Set the equipment application format depending on NS1_CELL_TECH.
            # If 3G switch to ""WCDMA""
            self._ns1.switch_app_format("WCDMA")

        if self._ns2_cell_tech == "2G":
            # Set the equipment application format depending on NS2_CELL_TECH.
            # If 2G switch to ""GSM/GPRS""
            self._ns2.switch_app_format("GSM/GPRS")
        elif self._ns2_cell_tech == "3G":
            # Set the equipment application format depending on NS2_CELL_TECH.
            # If 3G switch to ""WCDMA""
            self._ns2.switch_app_format("WCDMA")

        # Ensure flight mode off so that GSM sim operator info can be retrieved
        self._networking_api.set_flight_mode("off")
        time.sleep(self._wait_btwn_cmd)

        if self._category != "GSM":
            # Read maxDlWcdmaRab, maxUlWcdmaRab, maxDlHspaRab, maxUlHspaRab from DeviceCatalog.xml
            if self._category == "WCDMA":
                max_dl_rab = str(self._dut_config.get("maxDlWcdmaRab"))
                max_ul_rab = str(self._dut_config.get("maxUlWcdmaRab"))
            elif self._category == "HSPA":
                max_dl_rab = str(self._dut_config.get("maxDlHspaRab"))
                max_ul_rab = str(self._dut_config.get("maxUlHspaRab"))

            # Read the UL_RAB value from UseCase xml Parameter
            # Check if this value is set to MAX or not
            ul_rab_config = self._tc_parameters.get_param_value("UL_RAB", "MAX")

            # Read the DL_RAB value from UseCase xml Parameter
            # Check if this value is set to MAX or not
            dl_rab_config = self._tc_parameters.get_param_value("DL_RAB", "MAX")

            if ul_rab_config == "MAX":
                self._ul_rab = max_ul_rab
            else:
                self._ul_rab = ul_rab_config

            if dl_rab_config == "MAX":
                self._dl_rab = max_dl_rab
            else:
                self._dl_rab = dl_rab_config

            if self._category == "HSPA":
                # Get the HSDPA category (only if user
                # wants to use HSDPA.
                if(self._dl_rab is not None) and self._category:
                    # Retrieve all after "HSDPA_CAT"
                    self._hsdpa_cat = self._dl_rab[9:]
                else:
                    self._logger.debug("HSDPA Cat parameter not found "
                                       "on TC parameters, retrieve from DeviceModel")
                    self._hsdpa_cat = \
                        int(self._dut_config.get("maxDlHspaRab"))

                self._logger.debug("HSDPA CAT: " + str(self._hsdpa_cat))
                # Get the HSUPA category (only if user
                # wants to use HSUPA.
                if self._ul_rab.find("HSUPA_CAT") != -1:
                    # Retrieve all after "HSUPA_CAT"
                    self._hsupa_cat = self._ul_rab[9:]
                    self._logger.debug("HSUPA CAT: " + str(self._hsupa_cat))
                else:
                    self._hsupa_cat = None

                # Initialize further parameters
                self._rbt_channel_type = "HSPA"

        # Disable data and PDP context
        self._networking_api.deactivate_pdp_context()

        # Enable flight mode
        self._networking_api.set_flight_mode("on")

        # Perform full preset on NS1 cell
        self._ns1.perform_full_preset()

        # Perform full preset on NS2 cell
        self._ns2.perform_full_preset()

        # Set cell off for the 2 network simulators
        self._ns1_cell.set_cell_off()
        self._ns2_cell.set_cell_off()

        # Set IP addresses for the 2 network simulators
        self._ns1.set_ip_addresses(self._ns1_ip_lan1,
                                   self._ns1_ip_lan2,
                                   self._ns1_ip_subnet_mask,
                                   self._ns1_ip_default_gateway,
                                   self._ns1_ip_dut,
                                   self._ns1_ip_dns1,
                                   self._ns1_ip_dns2)

        self._ns2.set_ip_addresses(self._ns2_ip_lan1,
                                   self._ns2_ip_lan2,
                                   self._ns2_ip_subnet_mask,
                                   self._ns2_ip_default_gateway,
                                   self._ns2_ip_dut,
                                   self._ns2_ip_dns1,
                                   self._ns2_ip_dns2)

        self.set_external_connection(self._ns1,
                                     self._ns2,
                                     self._ns1_ip_lan2,
                                     self._ns2_ip_lan2)

        # Set Frequency points using frequency list
        # Set Amplitude Offset correction using offset list
        # Turning amplitude offset state to ON
        self._ns1.configure_amplitude_offset_table()

        # Set Frequency points using frequency list
        # Set Amplitude Offset correction using offset list
        # Turning amplitude offset state to ON
        self._ns2.configure_amplitude_offset_table()

        # If the fast dormancy parameter is set to disable do nothing to
        # avoid regressions.
        if self._ns1_fast_dormancy.lower() == "enable" and (self._ns1_cell_tech == "3G"):
            # Setting fast dormancy support according to the parameter
            # present in the bench config.
            self._ns1_data.\
                set_fast_dormancy_support("enable")
        if self._ns2_fast_dormancy.lower() == "enable" and (self._ns2_cell_tech == "3G"):
            # Setting fast dormancy support according to the parameter
            # present in the bench config.
            self._ns2_data.\
                set_fast_dormancy_support("enable")

        # Call specific configuration functions
        RegUtil.setup_cell(1,
                           self._ns1_model,
                           self._ns1_cell_tech,
                           self._ns1_cell_band,
                           self._ns1_cell_rel,
                           self._logger)
        RegUtil.setup_cell(2,
                           self._ns2_model,
                           self._ns2_cell_tech,
                           self._ns2_cell_band,
                           self._ns2_cell_rel,
                           self._logger)

        # Deactivate E-DCH Cell and HSDPA Cell capabilities
        # if cell tech is 3G
        if self._ns1_cell_tech == "3G":
            self._ns1_data.set_edch_cell_capability("OFF")
            self._ns1_data.set_hsdpa_cell_capability("OFF")
        # if cell tech is 2G
        else:
            # Set the multislot configuration
            self._ns1_data.set_multislot_config(self._multislot)

        if self._ns2_cell_tech == "3G":
            self._ns2_data.set_edch_cell_capability("OFF")
            self._ns2_data.set_hsdpa_cell_capability("OFF")
        # if cell tech is 2G
        else:
            # Set the multislot configuration
            self._ns2_data.set_multislot_config(self._multislot)

        return Global.SUCCESS, "No errors"
Example #23
0
    def set_up(self):
        """
        Initialize the test
        """

        # Call UseCase base set_up function
        UseCaseBase.set_up(self)

        # Ensure flight mode off so that GSM sim operator info can be retrieved
        self._networking_api.set_flight_mode("on")
        time.sleep(self._wait_btwn_cmd)

        # Connect to equipment using GPIBBoardId and GPIBAddress parameters
        self._ns.init()

        # Set the equipment application format WCDMA
        self._ns.switch_app_format("WCDMA")

        # Perform a full preset
        self._ns.perform_full_preset()

        # Set Cell off
        self._ns_cell_3g.set_cell_off()

        # 3G default cell setup
        RegUtil.setup_cell(self._ns_number, self._ns_model, "3G", self._band,
                           self._ns_cell_rel, self._logger)

        # Set Cell Band and ARFCN using 3GSM_CELL_BAND
        # and 3GSM_ARFCN parameters
        # Set cell service using 3GSM_CELL_SERVICE parameter
        # Set Cell Power using 3GSM_CELL_POWER parameter
        # Set Cell LAC using 3GSM_LAC_VALUE parameter
        # Set Cell RAC using 3GSM_RAC_VALUE parameter
        self._ns_cell_3g.configure_basic_cell_parameters(
            self._cell_service, self._band, self._dl_uarfcn, self._cell_power,
            1, 1, self._mcc, self._mnc)

        # Set Frequency points using frequency list
        # Set Amplitude Offset correction using offset list
        # Turning amplitude offset state to ON
        self._ns.configure_amplitude_offset_table()

        # Set Cell Band UARFCN (uplink) in auto mode
        self._ns_cell_3g.set_uplink_channel_mode("ON")

        # Set Audio codec using VOICE_CODER_RATE parameter
        self._ns_voice_call_3g.set_audio_codec(self._voice_coder_rate)

        # Set SRB  Configuration Control to auto
        self._ns_cell_3g.set_srb_config_control("ON")

        # Set Cell Power using CELL_POWER parameter
        self._ns_cell_3g.set_cell_power(self._cell_power)

        # Deactivate HSUPA and HSDPA capabilities
        self._ns_data_3g.set_edch_cell_capability("OFF")
        self._ns_data_3g.set_hsdpa_cell_capability("OFF")

        # Set Cell on
        self._ns_cell_3g.set_cell_on()

        # Ensure flight mode off so that GSM sim operator info can be retrieved
        self._networking_api.set_flight_mode("off")

        # Check registration state is connected using
        # registrationTimeout from Device_Catalog.xml
        self._modem_api.check_cdk_registration_bfor_timeout(
            self._registration_timeout)

        # Adapt attachment procedure to CIRCUIT or PACKET
        if "CIRCUIT" not in self._cell_service:
            # Set the APN
            time.sleep(self._wait_btwn_cmd)
            self._logger.info("Setting APN " + str(self._apn) + "...")
            self._networking_api.set_apn(self._ssid, self._apn)

            # Activate PDP context
            time.sleep(self._wait_btwn_cmd)
            self._logger.info("Active PDP Context...")
            self._networking_api.activate_pdp_context(self._ssid, check=False)

            # Check Data Connection State => PDP_ACTIVE before timeout
            RegUtil.check_dut_data_connection_state_before_timeout(
                "PDP_ACTIVE",
                self._ns_cell_3g,
                self._networking_api,
                self._logger,
                self._registration_timeout,
                flightmode_cycle=True,
                blocking=False)
        # Get RAT from Equipment
        network_type = self._ns_data_3g.get_network_type()

        # Check that DUT is registered on the good RAT
        self._modem_api.check_network_type_before_timeout(
            network_type, self._registration_timeout)

        return Global.SUCCESS, "No errors"
Example #24
0
    def set_up(self):
        """
        Set up the test configuration
        """
        # We won't use LabWcdmaSmsCsBase SetUp, because we don't want PDP active
        # for this CS test case.

        # log in acs logs
        self._logger.info("")
        self._logger.info("%s: Setup", self._name)
        self._logger.info("")

        # Connect to equipment
        self._ns.init()

        # Set the equipment Application Format = "WCDMA"
        self._ns.switch_app_format("WCDMA")

        # Perform full preset
        self._ns.perform_full_preset()

        # Deactivate HSUPA and HSDPA capabilities
        self._ns_data_3g.set_edch_cell_capability("OFF")
        self._ns_data_3g.set_hsdpa_cell_capability("OFF")

        # Set cell off
        self._ns_cell_3g.set_cell_off()

        # Set cell power using CELL_POWER value
        self._ns_cell_3g.set_cell_power(self._cell_power)

        self._ns_cell_3g.set_bch_update_page_state("AUTO")

        self._ns_cell_3g.set_drx_cycle(self._drx_cycle_length_cn)

        self._ns_cell_3g.set_drx_cycle_utran(self._drx_cycle_length_utran)

        self._ns_cell_3g.set_ctch_allocation_period(
            self._ctch_allocation_period)

        # Set cell on
        self._ns_cell_3g.set_cell_on()

        # Check registration status before time out using
        # registrationTimeout value from Device_Catalog.xml
        time.sleep(self._wait_btwn_cmd)
        dut_imsi = self._modem_api.get_imsi(self._registration_timeout)

        RegUtil.check_dut_registration_before_timeout(
            self._ns_cell_3g, self._networking_api, self._logger, dut_imsi,
            self._registration_timeout)

        # We should makesure data is disable for this use case
        self._logger.info("Deactivation of the PDP Context")
        self._networking_api.deactivate_pdp_context(self._ssid)

        # Check Data Connection State => PDP Active before timeout
        self._ns_data_3g.check_data_connection_state(
            "ATTACHED", self._registration_timeout, blocking=False)

        # Check registration state is connected using
        # registrationTimeout from Device_Catalog.xml (Non blocking
        # for this test if function isn't implemented on CDK)
        time.sleep(self._wait_btwn_cmd)
        self._modem_api.check_cdk_registration_bfor_timeout(
            self._registration_timeout)

        # Set sender address using DESTINATION_NUMBER on Network simulator
        self._ns_messaging_3g.set_sms_sender_address(
            self._sms_cb_destination_number)

        self._ns_messaging_3g.set_cell_broadcast_message_identifier(
            self._cell_broadcast_message_identifier,
            self._cell_broadcast_message)

        self._ns_messaging_3g.set_cell_broadcast_message_repetition_period(
            self._repetition_period)

        self._ns_messaging_3g.select_cell_broadcast_message_content(
            self._content_type, self._cell_broadcast_message)

        self._ns_messaging_3g.set_cell_broadcast_message_update_number(
            self._update_number, self._cell_broadcast_message)

        if self._content_type == "CTEX":
            self._ns_messaging_3g.set_custom_cell_broadcast_text_message(
                self._custom_cell_broadcast_text_message,
                self._cell_broadcast_message)
        elif self._content_type == "CDAT":
            self._ns_messaging_3g.set_custom_cell_broadcast_data_string(
                self._custom_cell_broadcast_text_message,
                self._cell_broadcast_message)

        if self._vc_type not in ("MO", "MT"):
            raise AcsConfigException(AcsConfigException.INVALID_BENCH_CONFIG,
                                     "Invalid voice call type")

        # Release any previous call (Robustness)
        self._voicecall_api.release()

        # Establish voice call
        if self._vc_type == "MO":

            # Dial using a dummy hard-coded phone number
            self._logger.info("Calling distant party...")
            self._voicecall_api.dial(self._distant_number)

        elif self._vc_type == "MT":
            # Initiate VoiceCall to CDK
            self._vc_3g.mt_originate_call()
            # pylint: disable=E1101
            # Check call status is incoming before callSetupTimeout
            self._voicecall_api.wait_for_state(
                self._uecmd_types.VOICE_CALL_STATE.INCOMING,
                self._call_setup_time)
            # Answer incoming call
            self._voicecall_api.answer()

        # Check call status before callSetupTimeout (NS)
        self._vc_3g.check_call_connected(self._call_setup_time)

        # Check call status before callSetupTimeout (CDK)
        self._voicecall_api.wait_for_state(
            self._uecmd_types.VOICE_CALL_STATE.ACTIVE,  # pylint: disable=E1101
            self._call_setup_time)

        return Global.SUCCESS, "No errors"
Example #25
0
    def run_test(self):
        """
        Execute the test
        """
        # Call LabMobility3gsmBase Run function
        LabMobility3gsmBase.run_test(self)

        # Initialize local variables used for Handovers
        ns1_vc = self._ns1_vc
        ns2_vc = self._ns2_vc
        nb_success_hand = 0
        ns1_cell = self._ns1_cell
        ns1_data = self._ns1_data
        ns2_cell = self._ns2_cell
        ns2_data = self._ns2_data

        # Check Data Connection State => PDP_ACTIVE before timeout
        RegUtil.check_dut_data_connection_state_before_timeout(
            "PDP_ACTIVE",
            ns1_cell,
            self._networking_api,
            self._logger,
            self._registration_timeout,
            flightmode_cycle=True,
            blocking=False)

        # Check registration state is connected using
        # registrationTimeout from Device_Catalog.xml
        self._modem_api.check_cdk_registration_bfor_timeout(
            self._registration_timeout)

        # Check that DUT is registered on the good RAT
        self._modem_api.check_network_type_before_timeout(
            ns1_data.get_network_type(), self._registration_timeout)

        # Set cell on
        ns2_cell.set_cell_on()

        # Perform try catch in order to catch errors during the for iteration.
        # If this try catch isn't done here and a crash appears during the for
        # iteration, the Tear Down will be called without recording Use Case
        # verdict and maybe 1 or more succeeded handovers.
        try:
            # For iteration 0 to HANDOVER_NUMBER:
            while nb_success_hand != self._jump_num:

                # Start an ftp tranfer
                self._ftp_task_id = \
                    self._networking_api.start_ftp_xfer(
                        self._ftp_direction,
                        self._server_ip_address,
                        self._server_username,
                        self._server_password,
                        self._ftp_filename,
                        self._device.get_ftpdir_path())

                # wait 20 seconds for ensure that transfer is established
                self._logger.info(
                    "Wait 20 seconds for ensure that transfer is established")
                time.sleep(20)

                # Check that operator gave a valid Voice call number
                # Perform MO voice call on NS1
                if self._is_phone_number_checked:
                    if self._phone_number is None:
                        self._logger.warning(
                            "Operator Phone Number cannot be used to perform a voice call \
                                     due to invalid test parameter value (Phone Number %s)"
                            % (str(
                                self._tc_parameters.get_param_value(
                                    "PHONE_NUMBER"))))

                    else:
                        self._voicecall_api.dial(self._phone_number)

                else:
                    # Raise an error message as no valid phone number has been set by the operator
                    self._error.Msg = "Phone number has no valid value (%s) so voice call can not be performed" % \
                                      self._phone_number
                    self._logger.error(self._error.Msg)
                    raise AcsConfigException(
                        AcsConfigException.INVALID_PARAMETER, self._error.Msg)

                # Check call state "CONNECTED" before callSetupTimeout seconds
                ns1_vc.check_call_connected(self._call_setup_time,
                                            blocking=False)

                # Check data state "TRANSFERRING" before timeout
                ns1_data.check_data_connection_transferring(
                    self._check_data_transfer_state_timeout)

                # Perform handover using 60 seconds timeout
                ns1_cell.execute_external_handover()
                self._logger.info("Wait 60 seconds for ensure that" +
                                  " external handover is done")
                time.sleep(60)

                # Switch NS1 and NS2 network simulators
                # (when the handover finishes, the roles are reversed)
                tmp_cell = ns1_cell
                tmp_data = ns1_data
                ns1_cell = ns2_cell
                ns1_data = ns2_data
                ns2_cell = tmp_cell
                ns2_data = tmp_data
                tmp_vc = ns1_vc
                ns1_vc = ns2_vc
                ns2_vc = tmp_vc

                # Check data state "TRANSFERRING" before timeout
                ns1_data.check_data_connection_transferring(
                    self._check_data_transfer_state_timeout,
                    False,
                    blocking=False)

                # Check call state "CONNECTED" before timeout to validate handover
                ns1_vc.check_call_connected(
                    self._check_voice_call_state_timeout, blocking=False)

                # Get RAT from Equipment
                network_type = ns1_data.get_network_type()

                # Check that DUT is registered on the good RAT
                self._modem_api.check_network_type_before_timeout(
                    network_type, self._registration_timeout)

                # Increment number of succeeded handovers
                nb_success_hand += 1

                # Stop ftp transfer
                self._networking_api.stop_ftp_xfer(self._ftp_task_id)

                # Release the voice call
                ns1_vc.voice_call_network_release()

            # End For

        # Catch a possible exception
        except TestEquipmentException as ex:
            msg = "The handover number %d failed " % (nb_success_hand + 1)
            msg += "(%d succeeded handovers on %d)." \
                % (nb_success_hand, self._jump_num)

            self._logger.error(msg)
            raise TestEquipmentException(
                TestEquipmentException.PROHIBITIVE_BEHAVIOR,
                "Exception during handover process: %s (%s)" %
                (ex.get_error_message(), msg))

        except AcsBaseException as ex:
            # if nb_success_hand < self._jump_num
            # raise an exception
            # else only log the error
            if nb_success_hand < self._jump_num:
                msg = "The handover number %d failed " % (nb_success_hand + 1)
                msg += "(%d succeeded handovers on %d)." \
                    % (nb_success_hand, self._jump_num)
                self._logger.error(msg)
                raise DeviceException(
                    DeviceException.PROHIBITIVE_BEHAVIOR,
                    "Exception during handover due to board: %s (%s)" %
                    (ex.get_error_message(), msg))
            else:
                # log error as a warning, but no Usecase exception
                # is raised because the purpose of the Usecase has been reached
                self._logger.warning(ex.get_error_message())
        finally:
            # Stop ftp tranfer if an error occurs
            self._networking_api.stop_ftp_xfer(self._ftp_task_id)

        # Compute final verdict
        msg = "%d handovers done." % nb_success_hand
        return Global.SUCCESS, msg
Example #26
0
    def set_up(self):
        """
        Set up the test configuration
        """

        # Call LabMobility3gsmBase Setup function
        LabMobility3gsmBase.set_up(self)

        # Set default variables to switch equipments
        # during several cell reselections
        # Set cell service using ns1_CELL_SERVICE parameter
        # Set Cell Power using ns1_CELL_POWER parameter
        self._ns1_cell.set_cell_service(self._ns1_cell_service)
        self._ns1_cell.set_cell_power(self._ns_camped_power)

        # Set cell service using TARGET_CELL_SERVICE parameter
        # Set Cell Power using TARGET_CELL_POWER parameter
        self._ns2_cell.set_cell_service(self._ns2_cell_service)
        self._ns2_cell.set_cell_power(self._ns2_cell_power)

        # Set ns1_LAC and ns2_LAC parameters
        self._ns1_cell.set_lac(self._ns1_lac)
        self._ns2_cell.set_lac(self._ns2_lac)

        # Set ns1_RAC and ns2_RAC parameters
        self._ns1_cell.set_rac(self._ns1_rac)
        self._ns2_cell.set_rac(self._ns2_rac)

        # Set scrambling code for 3G cells
        if self._ns1_cell_tech == "3G":
            self._ns1_cell.set_scrambling_code(self._ns1_psc)
        if self._ns2_cell_tech == "3G":
            self._ns2_cell.set_scrambling_code(self._ns2_psc)

        # Set cell on
        self._ns1_cell.set_cell_on()
        self._ns2_cell.set_cell_on()

        # Disable flight mode
        self._networking_api.set_flight_mode("off")

        # Check registration state is connected using
        # registrationTimeout from Device_Catalog.xml
        self._logger.info("Check if DUT is attached to cell %d (DUT check)",
                          self._cell_in_use)
        self._modem_api.check_cdk_registration_bfor_timeout(
            self._registration_timeout)

        # Set primary cell to first cell
        self._cell_in_use = 1

        # Check Data Connection State => ATTACHED before timeout
        self._logger.info("Check if DUT is attached to cell %d (NW check)",
                          self._cell_in_use)
        self._ns1_data.check_data_connection_state("ATTACHED",
                                                   self._cresel_timeout,
                                                   blocking=False)

        # Set the APN
        time.sleep(self._wait_btwn_cmd)
        self._logger.info("Setting APN " + str(self._apn) + "...")
        self._networking_api.set_apn(self._ssid, self._apn)

        # Activate PDP context
        time.sleep(self._wait_btwn_cmd)
        self._logger.info("Active PDP Context...")
        self._networking_api.activate_pdp_context(self._ssid, check=False)

        # Check Data Connection State => PDP_ACTIVE before timeout
        RegUtil.check_dut_data_connection_state_before_timeout(
            "PDP_ACTIVE",
            self._ns1_cell,
            self._networking_api,
            self._logger,
            self._registration_timeout,
            flightmode_cycle=False,
            blocking=False)

        # Check that DUT is registered on the good RAT
        self._logger.info(
            "Check if DUT is attached to cell %d with the good RAT",
            self._cell_in_use)
        self._modem_api.check_network_type_before_timeout(
            self._ns1_data.get_network_type(), self._registration_timeout)

        return (Global.SUCCESS, "No errors")
Example #27
0
    def set_up(self):
        """
        Set up the test configuration
        """

        # Call UseCase base Setup function
        UseCaseBase.set_up(self)

        # Ensure flight mode off so that GSM sim operator info can be retrieved
        self._networking_api.set_flight_mode("off")
        time.sleep(self._wait_btwn_cmd)

        # Determinates the kind of registration state to wait
        # by comparing test case MCC/MNC parameters to sim MCC/MNC
        sim_info = self._modem_api.get_sim_operator_info()
        if sim_info["MCC"] != self._mcc or\
                sim_info["MNC"] != self._mnc:
            self._wanted_reg_state = "roaming"
        else:
            self._wanted_reg_state = "registered"

        # Clear all data connections
        self._networking_api.clean_all_data_connections()
        time.sleep(self._wait_btwn_cmd)

        if self._switch_mode == "airplane":
            # Switch off according to the mode chosen
            self.phoneonoff_util.switch_off(self._switch_mode)

        # Initialize cellular network simulator
        self._ns.init()

        # Set the equipment application format WCDMA
        self._ns.switch_app_format("WCDMA")

        # Perform a full preset
        self._ns.perform_full_preset()

        # Set Cell off
        self._ns_cell_3g.set_cell_off()

        # 3G default cell setup
        RegUtil.setup_cell(self._ns_number, self._ns_model, "3G", self._band,
                           self._ns_cell_rel, self._logger)

        # Set Cell Band and ARFCN using 3GSM_CELL_BAND
        # and 3GSM_ARFCN parameters
        # Set cell service using 3GSM_CELL_SERVICE parameter
        # Set Cell Power using 3GSM_CELL_POWER parameter
        # Set Cell LAC using 3GSM_LAC_VALUE parameter
        # Set Cell RAC using 3GSM_RAC_VALUE parameter
        self._ns_cell_3g.configure_basic_cell_parameters(
            self._cell_service, self._band, self._dl_uarfcn, self._cell_power,
            1, 1, self._mcc, self._mnc)

        # Set Frequency points using frequency list
        # Set Amplitude Offset correction using offset list
        # Turning amplitude offset state to ON
        self._ns.configure_amplitude_offset_table()

        # Set Cell Band UARFCN (uplink) in auto mode
        self._ns_cell_3g.set_uplink_channel_mode("ON")

        # Set SRB  Configuration Control to auto
        self._ns_cell_3g.set_srb_config_control("ON")

        # Deactivate HSUPA and HSDPA capabilities
        self._ns_data_3g.set_edch_cell_capability("OFF")
        self._ns_data_3g.set_hsdpa_cell_capability("OFF")

        self._modem_api.check_cdk_no_registration_bfor_timeout(
            self._registration_timeout)
        # Set Cell on
        self._ns_cell_3g.set_cell_on()

        return Global.SUCCESS, "No errors"
Example #28
0
    def set_up(self):
        """
        Set up the test configuration
        """

        # Call use case base Setup function
        UseCaseBase.set_up(self)

        # get original audio output
        self._origianl_audio_output = \
            self._phonesystem_api.get_audio_output()

        # get original silent mode and vibrate mode
        self._original_silent_vibrate = \
            self._phonesystem_api.get_silent_vibrate()

        # Connect to equipment using GPIBAddress and GPIBBoardId
        self._ns.init()

        # Set the equipment application format GSM/GPRS
        self._ns.switch_app_format("GSM/GPRS")

        # Perform a full preset
        self._ns.perform_full_preset()

        # Set cell off
        self._ns_cell_2g.set_cell_off()

        # Set Frequency points using frequency list
        # Set Amplitude Offset correction using offset list
        # Turning amplitude offset state to ON
        self._ns.configure_amplitude_offset_table()

        # Set Cell Band  using CELL_BAND parameter
        self._ns_cell_2g.set_band(self._band_name)

        # Set Broadcast Channel Arfcn using BCH_ARFCN parameter
        self._ns_cell_2g.set_bcch_arfcn(self._bch_arfcn)

        # Set Traffic Channel Arfcn using TCH_ARFCN parameter
        self._ns_cell_2g.set_tch_arfcn(self._tch_arfcn)

        # Set cell service using CELL_SERVICE parameter
        self._ns_cell_2g.set_cell_service(self._cell_service)

        # Set Cell Power using CELL_POWER parameter
        self._ns_cell_2g.set_cell_power(self._cell_power)

        # Set VOICE_CODER_RATE
        self._ns_voice_call_2g.set_audio_codec(self._voice_coder_rate)

        # Set ringtone time using RT_TIME parameter
        self._ns_voice_call_2g.set_mt_originate_call_timeout(self._rt_time)

        # Set cell on
        self._ns_cell_2g.set_cell_on()

        # Adapt attachment procedure to CIRCUIT or PACKET
        if self._cell_service == "GSM":
            # Check phone registration on equipment before given CAMP_TIMEOUT
            # (in loop compare every second the IMSI returned by the simulator
            # and IMSI read on CDK until comparison is true or timeout expired)
            dut_imsi = self._modem_api.get_imsi(self._registration_timeout)

            RegUtil.check_dut_registration_before_timeout(
                self._ns_cell_2g, self._networking_api, self._logger, dut_imsi,
                self._registration_timeout)
        else:
            # Check Data Connection State => ATTACHED before timeout
            RegUtil.check_dut_data_connection_state_before_timeout(
                "ATTACHED",
                self._ns_cell_2g,
                self._networking_api,
                self._logger,
                self._registration_timeout,
                flightmode_cycle=True,
                blocking=False)

        # Check registration state is connected using
        # registrationTimeout from Device_Catalog.xml
        self._modem_api.check_cdk_registration_bfor_timeout(
            self._registration_timeout)

        # Get RAT from Equipment
        network_type = self._ns_data_2g.get_network_type()

        # Check that DUT is registered on the good RAT
        self._modem_api.check_network_type_before_timeout(
            network_type, self._registration_timeout)

        return Global.SUCCESS, "No errors"
Example #29
0
    def run_test(self):
        """
        Execute the test
        """
        # Call UseCase base run_test function
        UseCaseBase.run_test(self)

        if self._switch_mode == "airplane":
            # Switch on according to the mode chosen
            self.phoneonoff_util.switch_on(self._switch_mode)

        elif self._switch_mode in ("hardshutdown", "softshutdown"):
            # Reboot according to the mode chosen
            self.phoneonoff_util.reboot(self._switch_mode)
        else:
            self._logger.info("No actions required to do a switch On/Off")

        # save initial time
        init_time = time.time()

        # Check registration state is connected using
        # registrationTimeout from Device_Catalog.xml
        self._logger.info("Check network registration status is %s on DUT" %
                          self._wanted_reg_state)
        self._modem_api.check_cdk_state_bfor_timeout(
            self._wanted_reg_state, self._registration_timeout)

        # time needed to reach registered state
        reg_time = time.time() - init_time
        self._logger.info("DUT registered in less than %3.2f seconds!",
                          reg_time)

        # Adapt attachment procedure to CIRCUIT or PACKET
        if self._cell_service != "GSM":
            if self._pdp_activation:
                # Set the APN
                time.sleep(self._wait_btwn_cmd)
                self._logger.info("Setting APN " + str(self._apn) + "...")
                self._networking_api.set_apn(self._ssid, self._apn)
                # Activate PDP context
                time.sleep(self._wait_btwn_cmd)
                self._logger.info("Active PDP Context...")
                self._networking_api.activate_pdp_context(self._ssid,
                                                          check=False)

                # Check Data Connection State => PDP_ACTIVE before timeout
                RegUtil.check_dut_data_connection_state_before_timeout(
                    "PDP_ACTIVE",
                    self._ns_cell_2g,
                    self._networking_api,
                    self._logger,
                    self._registration_timeout,
                    flightmode_cycle=False,
                    blocking=False)

            else:
                # Check Data Connection State => ATTACHED before timeout
                RegUtil.check_dut_data_connection_state_before_timeout(
                    "ATTACHED",
                    self._ns_cell_2g,
                    self._networking_api,
                    self._logger,
                    self._registration_timeout,
                    flightmode_cycle=False,
                    blocking=False)

                # time needed to reach attach state after registration
                attach_time = time.time() - init_time
                self._logger.info("DUT attached in less than %3.2f seconds!",
                                  attach_time)

        # Get RAT from Equipment
        network_type = self._ns_data_2g.get_network_type()

        # Check that DUT is registered on the good RAT
        self._modem_api.check_network_type_before_timeout(
            network_type, self._registration_timeout)

        if self._switch_mode == "airplane":
            # Switch off according to the switch mode chosen
            self.phoneonoff_util.switch_off(self._switch_mode)
            # Check that DUT is no longer camped on Network
            self._modem_api.check_cdk_no_registration_bfor_timeout(
                self._registration_timeout)

        return Global.SUCCESS, "No errors"
Example #30
0
    def set_up(self):
        """
        Set up the test configuration
        """

        # Call use case base Setup function
        UseCaseBase.set_up(self)

        # Clear all data connections
        self._networking_api.clean_all_data_connections()
        time.sleep(self._wait_btwn_cmd)

        # Connect to equipment
        self._ns.init()

        # Set the equipment Application Format = "WCDMA"
        self._ns.switch_app_format("WCDMA")

        # Perform full preset
        self._ns.perform_full_preset()

        # Deactivate HSUPA and HSDPA capabilities
        self._ns_data_3g.set_edch_cell_capability("OFF")
        self._ns_data_3g.set_hsdpa_cell_capability("OFF")

        # Set cell off
        self._ns_cell_3g.set_cell_off()

        # 3G default cell setup
        RegUtil.setup_cell(self._ns_number,
                           self._ns_model,
                           "3G",
                           self._band,
                           self._ns_cell_rel,
                           self._logger)

        # Set Frequency points using frequency list
        self._ns.configure_amplitude_offset_table()

        # Set cell power using CELL_POWER value
        self._ns_cell_3g.set_cell_power(self._cell_power)

        # Set serving cell to PACKET
        self._ns_cell_3g.set_cell_service("PACKET")

        # Set downlink UARFCN using DL_UARFCN value
        self._ns_cell_3g.set_band_and_dl_arfcn(
            "BAND" + str(self._band), self._dl_uarfcn)

        # Set cell on
        self._ns_cell_3g.set_cell_on()

        # Check Data Connection State => ATTACHED before timeout
        RegUtil.check_dut_data_connection_state_before_timeout("ATTACHED",
                                                               self._ns_cell_3g,
                                                               self._networking_api,
                                                               self._logger,
                                                               self._registration_timeout,
                                                               flightmode_cycle=True,
                                                               blocking=False)
        # Check registration state is connected using
        # registrationTimeout from Device_Catalog.xml
        self._modem_api.check_cdk_registration_bfor_timeout(
            self._registration_timeout)

        # Set the APN
        time.sleep(self._wait_btwn_cmd)
        self._logger.info("Setting APN " + str(self._apn) + "...")
        self._networking_api.set_apn(self._ssid, self._apn)

        # Activate PDP context
        time.sleep(self._wait_btwn_cmd)
        self._logger.info("Active PDP Context...")
        self._networking_api.activate_pdp_context(self._ssid)

        # Check Data Connection State => PDP Active before timeout
        self._ns_data_3g.check_data_connection_state("PDP_ACTIVE",
                                                     self._registration_timeout,
                                                     blocking=False)

        # Get RAT from Equipment
        network_type = self._ns_data_3g.get_network_type()

        # Check that DUT is registered on the good RAT
        self._modem_api.check_network_type_before_timeout(network_type,
                                                          self._registration_timeout)

        return Global.SUCCESS, "No errors"