コード例 #1
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)

        return Global.SUCCESS, "No errors"
コード例 #2
0
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """

        # Call LabMobility3gsmBase Init function
        LabMobility3gsmBase.__init__(self, tc_name, global_config)

        self._check_data_transfer_state_timeout = 10

        # Read ftp DIRECTION from testcase xml parameters
        self._direction = self._tc_parameters.get_param_value("DIRECTION")

        # Get FTP server parameters
        self._server = global_config.benchConfig.get_parameters("LAB_SERVER")
        self._server_ip_address = self._server.get_param_value("IP")
        self._server_username = self._server.get_param_value("username")
        self._server_password = self._server.get_param_value("password")
        if self._server.has_parameter("ftp_path"):
            self._ftp_path = self._server.get_param_value("ftp_path")
        else:
            self._ftp_path = ""

        # Read the UL_FILE value from UseCase xml Parameter
        self._ulfilename = os.path.join(self._ftp_path, "put100M")
        # Read the DL_FILE value from UseCase xml Parameter
        self._dlfilename = os.path.join(self._ftp_path, "get500M")
コード例 #3
0
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """

        # Call LabMobility3gsmBase Init function
        LabMobility3gsmBase.__init__(self, tc_name, global_config)

        # Initialize variables
        self._ho_ns1_limit_power = None
        self._ho_ns2_limit_power = None
        self._wait_before_voice_call_release = None
        self._wanted_reg_state = None

        # Read PHONE_NUMBER from testcase xml parameters
        self._phone_number = \
            str(self._tc_parameters.get_param_value("PHONE_NUMBER"))
        if self._phone_number.upper() == "[PHONE_NUMBER]":
            self._phone_number = str(self._device.get_phone_number())

        # Read NS1_CELL_POWER from testcase xml parameters
        self._ns1_cell_power = \
            float(self._tc_parameters.get_param_value("NS1_CELL_POWER"))

        # Read NS1_CELL_SERVICE from testcase xml parameters
        self._ns1_cell_service = \
            str(self._tc_parameters.get_param_value("NS1_CELL_SERVICE"))

        # Read NS2_CELL_POWER from testcase xml parameters
        self._ns2_cell_power = \
            float(self._tc_parameters.get_param_value("NS2_CELL_POWER"))

        # Read CRESEL_LIMIT_POWER from testcase xml parameters
        self._cresel_limit_power = \
            float(self._tc_parameters.get_param_value("CRESEL_LIMIT_POWER"))

        # Read DECREMENTATION_STEP_POWER from testcase xml parameters
        self._decrementation_step_power = \
            float(self._tc_parameters.get_param_value("DECREMENTATION_STEP_POWER"))

        # Set INCREMENTATION_STEP_POWER
        self._incrementation_step_power = \
            float(self._tc_parameters.get_param_value("INCREMENTATION_STEP_POWER"))

        # Read DECREMENTATION_STEP_TIMER from testcase xml parameters
        self._decrementation_step_timer = \
            float(self._tc_parameters.get_param_value("DECREMENTATION_STEP_TIMER"))

        # Sets INCREMENTATION_STEP_TIMER
        self._incrementation_step_timer = \
            float(self._tc_parameters.get_param_value("INCREMENTATION_STEP_TIMER"))
コード例 #4
0
    def run_test(self):
        """
        Execute the test
        """

        # Call LabMobility3gsmBase Run function
        LabMobility3gsmBase.run_test(self)

        # Go out of coverage then switch to other cell
        if self._cell_in_use == 1:
            self._cell_in_use = 2
            cell_parms = self._1_to_2_cell_parms
        else:
            self._cell_in_use = 1
            cell_parms = self._2_to_1_cell_parms

        self._logger.info("Go out of coverage then switch to cell %d",
                          self._cell_in_use)
        self.go_out_of_coverage_and_cresel(*cell_parms)

        return Global.SUCCESS, "No errors"
コード例 #5
0
    def set_up(self):
        """
        Set up the test configuration
        """
        # Call LabMobilityBase Setup function
        LabMobility3gsmBase.set_up(self)

        # Set camped cell power and neighbor cell power for the first re-selection
        # in case of B2B non-continuous test case.
        self._ns_camped_power = self._ns1_cell_power
        self._ns_neighbour_cell_power = self._ns2_cell_power

        # Set camped cell power and neighbor cell power for the first re-selection
        # in case of B2B non-continuous test case.
        self._ns_camped_power = self._ns1_cell_power
        self._ns_neighbour_cell_power = self._ns2_cell_power

        # Set Cell Band  and ARFCN using NS1CELL_BAND
        # and NS1ARFCN parameters
        # Set cell service using NS1_CELL_SERVICE parameter
        # Set Cell Power using ns1_cell_power parameter
        self._ns1_cell.configure_basic_cell_parameters(self._ns1_cell_service,
                                                       self._ns1_cell_band,
                                                       self._ns1_arfcn,
                                                       self._ns_camped_power)

        # Set Cell Band  and ARFCN using NS2_CELL_BAND
        # and NS2_ARFCN parameters
        # Set cell service using NS2_CELL_SERVICE parameter
        # Set Cell Power using NS2_CELL_POWER parameter
        self._ns2_cell.configure_basic_cell_parameters(
            self._ns2_cell_service, self._ns2_cell_band, self._ns2_arfcn,
            self._ns_neighbour_cell_power)

        # Set NS1_LAC and NS1_RAC parameters
        self._ns1_cell.set_lac(self._ns1_lac)
        self._ns1_cell.set_rac(self._ns1_rac)

        # Set NS2_LAC and NS2_RAC parameters
        self._ns2_cell.set_lac(self._ns2_lac)
        self._ns2_cell.set_rac(self._ns2_rac)

        # Configure Compressed mode if needed
        if self._compress_mode_active:
            if not (self._ns1_cell_tech == "3G"
                    and self._ns2_cell_tech == "2G"):
                msg = "It is an IRAT test with compressed mode test cell1 must be 3G and cell2 2G"
                self._logger.error(msg)
                return (Global.FAILURE, msg)

            # Set compress mode measurement config for InteRAT measurement
            self._ns1_cell.set_compress_mode_measurement_config("ITRRat")
            # Define compress mode parameters with one gap measuring GSM RSSI
            # (equivalent to use CM gap GSM RSSI presets on 8960)
            # see http://wireless.agilent.com/rfcomms/refdocs/wcdma/wcdma_gen_bse_compressed_mode.html
            # table  Compressed Mode Preset Configurations collunm Inter-RAT GSM Meas
            self._ns1_cell.set_compress_mode_gap_config(
                1, "GSMR", 4, 12, 7, 0, 0, 0, 0, 0, 270)

            if "384" in self._ul_rab or "384" not in self._dl_rab:
                self._logger.warning(
                    "The RAB configuration is not correct, compressed mode may not work: \n"
                    + "    it is better to use (ul 64k/dl 384k)")

            # Loads DL Channel code preset configuration for compressed mode when 384k DL DPCH is active (non HSDPA).
            self._ns1_cell.set_compress_mode_channelization_codes_preset_for_384k_dl_dpch(
            )
            # Set 2G cell PS handover state to ON
            self._ns2_cell.set_ps_handover_state(1)

        if (self._ns1_cell_tech == "3G"):
            self._set_gprs_bearer(self._ns1_cell, self._ns1_data, 1)
            self._ns1_cell.set_gsm_cell_reselection_min_rx_level(
                self._gsm_cell_reselection_min_rx_level)
        if (self._ns2_cell_tech == "3G"):
            self._set_gprs_bearer(self._ns2_cell, self._ns2_data, 2)
            self._ns2_cell.set_gsm_cell_reselection_min_rx_level(
                self._gsm_cell_reselection_min_rx_level)

        # Due to HSPA cell power overwritting
        self._reset_cells_power()

        # Set NS1 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)

        return (Global.SUCCESS, "No errors")
コード例 #6
0
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """

        # Call LabMobilityBase Init function
        LabMobility3gsmBase.__init__(self, tc_name, global_config)
        # Initialize variables
        self._wanted_reg_state = None

        # Read NS1 parameters from testcase xml parameters
        self._ns_camped_power = \
            float(self._tc_parameters.get_param_value("NS1_CELL_POWER"))

        self._ns1_cell_service = \
            str(self._tc_parameters.get_param_value("NS1_CELL_SERVICE"))

        self._ns1_lac = \
            int(self._tc_parameters.get_param_value("NS1_LAC"))

        self._ns1_rac = \
            int(self._tc_parameters.get_param_value("NS1_RAC"))

        # Read NS2 parameters from testcase xml parameters
        self._ns2_cell_power = \
            float(self._tc_parameters.get_param_value("NS2_CELL_POWER"))

        self._ns2_cell_service = \
            str(self._tc_parameters.get_param_value("NS2_CELL_SERVICE"))

        self._ns2_lac = \
            int(self._tc_parameters.get_param_value("NS2_LAC"))

        self._ns2_rac = \
            int(self._tc_parameters.get_param_value("NS2_RAC"))

        self._cresel_power = \
            float(self._tc_parameters.get_param_value("CRESEL_POWER"))

        # Read CRESEL_TIME_OUT from testcase xml parameters
        self._cresel_timeout = \
            float(self._tc_parameters.get_param_value("CRESEL_TIME_OUT"))

        # Read CRESEL_TIME_OUT from testcase xml parameters
        self._cresel_timeout = \
            float(self._tc_parameters.get_param_value("CRESEL_TIME_OUT"))

        # Read CRESEL_TIME_OUT from testcase xml parameters
        self._cresel_nocoverage_time = \
            float(self._tc_parameters.get_param_value("CRESEL_NO_COVERAGE_TIME"))

        # Read NS1_PSC from testcase xml parameters
        self._ns1_psc = int(self._tc_parameters.get_param_value(
            "NS1_PSC", "1"))

        # Read NS2_PSC from testcase xml parameters
        self._ns2_psc = int(
            self._tc_parameters.get_param_value("NS2_PSC", "15"))

        # Set parameters to go from cell 1 to cell 2
        self._1_to_2_cell_parms = (self._ns1_cell, self._ns2_cell,
                                   self._ns2_data, self._ns2_cell_service,
                                   self._cresel_power, self._ns2_model,
                                   self._cresel_timeout,
                                   self._cresel_nocoverage_time)

        # Set parameters to go from cell 2 to cell 1
        self._2_to_1_cell_parms = (self._ns2_cell, self._ns1_cell,
                                   self._ns1_data, self._ns1_cell_service,
                                   self._cresel_power, self._ns1_model,
                                   self._cresel_timeout,
                                   self._cresel_nocoverage_time)
        # Set primary cell to first cell
        self._cell_in_use = 1
コード例 #7
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")
コード例 #8
0
    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"
コード例 #9
0
    def run_test(self):
        """
        Execute the test
        """

        # Call LabMobility3gsmBase Run function
        LabMobility3gsmBase.run_test(self)

        # Set default variables to witch equipments during several handovers
        ns1_cell = self._ns1_cell
        ns1_vc = self._ns1_vc
        ns1_data = self._ns1_data
        ns2_cell = self._ns2_cell
        ns2_vc = self._ns2_vc
        ns2_data = self._ns2_data

        # 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)

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

        # Perform MO voice call on NS1
        self._voicecall_api.dial(self._phone_number)

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

        # Wait for Voice Call to stay active before HandOver
        time.sleep(5)

        # Simulate that the DUT is moving across cells for Handover
        # Increase NS2 cell power and decrease NS1 cell power

        # Set the ns1_cell_power to NS1 cell power
        # for the first decrementation iteration
        ns1_cell_power = float(-70)
        #  Sets HO_NS1_LIMIT_POWER
        self._ho_ns1_limit_power = float(-90)

        # Set the ns2_cell_power to ns2 cell power
        # for the first incrementation iteration
        ns2_cell_power = float(-110)
        #  Sets HO_NS2_LIMIT_POWER
        self._ho_ns2_limit_power = float(-70)

        # Set cell the NS2 Cell
        self._ns2_cell.set_cell_on()

        # Log the current Cell Reselection iteration
        self._logger.info("Preparing Handover")

        self.decrease_and_increase_cell_power_while_vc(
            ns1_cell, ns1_vc, ns1_cell_power, ns2_cell, ns2_data,
            ns2_cell_power, self._decrementation_step_power,
            self._decrementation_step_timer, self._ho_ns1_limit_power,
            self._incrementation_step_power, self._incrementation_step_timer,
            self._ho_ns2_limit_power)

        # Log the current iteration
        self._logger.info("Performing Handover")

        # Perform handover using 10 seconds timeout
        ns1_cell.execute_external_handover()

        # Wait for HandOver to be done with Voice Call still active
        time.sleep(10)

        # Check call state "CONNECTED" before 5 seconds to validate handover
        ns2_vc.check_call_connected(5, blocking=False)

        # Set the ns1_cell_power (3G cell) to -115 dBm
        # to be sure that DUT stays registered on NS1 2G cell
        ns1_cell_power = float(-115)
        ns1_cell.set_cell_power(ns1_cell_power)

        # Wait 2 or 30 seconds before voice call release
        self._wait_before_voice_call_release = random.randrange(2, 40, 28)
        self._logger.info("Wait %s seconds before voice call release",
                          self._wait_before_voice_call_release)
        time.sleep(self._wait_before_voice_call_release)

        # Release the voice call
        ns2_vc.voice_call_network_release()

        # Get RAT from Equipment
        network_type = ns2_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)

        # END OF HANDOVER

        # Wait 15 seconds after HandOver before performing Reselection
        self._logger.info("Wait 15 seconds before performing cell-reselection")
        time.sleep(15)

        # Log the current iteration
        self._logger.info("Performing cell reselection")

        # Set NS1 cell power to NS1_CELL_POWER
        ns1_cell.set_cell_power(self._ns1_cell_power)

        # Set NS2 cell power to NS2_CELL_POWER
        ns2_cell.set_cell_power(self._ns2_cell_power)

        # 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)

        msg = "Begin to decrease Camped cell power from %.2f dBm "
        msg += "to %.2f dBm each %d seconds by step of %.2f dBm while "
        msg += "cell reselection isn't performed."
        self._logger.info(msg, self._ns2_cell_power, self._cresel_limit_power,
                          self._decrementation_step_timer,
                          self._decrementation_step_power)

        # Decrease cell power on NS2 and wait for DUT to be camped on NS1
        self.decrease_cell_power_while_idle(
            self._ns2_cell, self._ns1_cell_power, self._ns1_cell,
            self._ns1_data, self._ns1_cell_service,
            self._decrementation_step_power, self._decrementation_step_timer,
            self._cresel_limit_power, self._ns2_cell_power, self._ns1_model)

        # Return message and quit the method
        return Global.SUCCESS, "No errors"
コード例 #10
0
    def run_test(self):
        """
        Execute the test
        """
        # Call LabMobility3gsmBase Run function
        LabMobility3gsmBase.run_test(self)

        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()

        # IF DIRECTION is UL starting upload FTP
        #    Start ftp upload of "put100M" file using  following parameters :
        #        DIRECTION, IP, username, password
        if self._direction == "UL":
            ftp_params = \
                [self._uecmd_types.XFER_DIRECTIONS.UL,  # pylint: disable=E1101
                 self._server_ip_address,
                 self._server_username,
                 self._server_password,
                 self._ulfilename,
                 self._device.get_ftpdir_path()]

        # ELIF DIRECTION is DL starting download FTP
        #    Start ftp download of "get500M" file using  following parameters :
        #        DIRECTION, IP, username, password
        elif self._direction == "DL":
            ftp_params = \
                [self._uecmd_types.XFER_DIRECTIONS.DL,  # pylint: disable=E1101
                 self._server_ip_address,
                 self._server_username,
                 self._server_password,
                 self._dlfilename,
                 self._device.get_ftpdir_path()]

        # ELSE raise an error
        # Raise an error in case the direction is not known
        else:
            self._logger.error("Unknown ftp direction (%s)" % self._direction)
            raise AcsConfigException(AcsConfigException.INVALID_PARAMETER,
                                     "Unknown ftp direction.")

        # Start an ftp tranfer
        ftp_task_id = self._networking_api.start_ftp_xfer(*ftp_params)  # pylint: disable=W0142

        # 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 data state "TRANSFERRING" before timeout
        ns1_data.check_data_connection_transferring(
            self._check_data_transfer_state_timeout)

        # Log the current Hard Handover iteration
        self._logger.info("Performing Hard Handover number 1 of 2")

        # Perform handover
        ns1_cell.execute_external_handover()

        self._logger.info("Wait 60 seconds for ensure that" +
                          " external handover is done")
        time.sleep(60)

        # Check data state "TRANSFERRING" on Neighbour NS before timeout
        ns2_data.check_data_connection_transferring(
            self._check_data_transfer_state_timeout, False, blocking=True)
        # Check data state "TRANSFERRING" on DUT
        data_connection_state = self._networking_api.get_ftp_xfer_status()
        self._logger.info("FTP transfer is %s !" % data_connection_state)

        # Raise an exception if data state is not "transferring" on the DUT
        if data_connection_state is not "transferring":
            msg = self._logger.error("FTP connection has been lost !")
            raise DeviceException(DeviceException.CONNECTION_LOST, msg)

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

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

        # Deactivate PDP context
        self._networking_api.deactivate_pdp_context(self._ssid)

        # Log the current Hard Handover iteration
        self._logger.info("Performing Hard Handover number 2 of 2")

        # Perform handover
        ns2_cell.execute_external_handover()

        self._logger.info("Wait 60 seconds for ensure that" +
                          " external handover is done")
        time.sleep(60)

        # Check data state "TRANSFERRING" on Neighbour NS before timeout
        ns1_data.check_data_connection_transferring(
            self._check_data_transfer_state_timeout, False, blocking=True)
        # Check data state "TRANSFERRING" on DUT
        data_connection_state = self._networking_api.get_ftp_xfer_status()
        self._logger.info("FTP transfer is %s !" % data_connection_state)

        # Raise an exception if data state is not "transferring" on the DUT
        if data_connection_state is not "transferring":
            msg = self._logger.error("FTP connection has been lost !")
            raise DeviceException(DeviceException.CONNECTION_LOST, msg)

        # 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)

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

        # Deactivate PDP context
        self._networking_api.deactivate_pdp_context(self._ssid)

        return Global.SUCCESS, "No errors"
コード例 #11
0
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """
        self._ftp_direction = None
        self._ftp_filename = None
        self._is_phone_number_checked = False
        self._ftp_task_id = 0
        self._check_data_transfer_state_timeout = 10
        self._check_voice_call_state_timeout = 10

        # Set a variable for Handover direction
        # If variable is True, Handover is from 3G to 2G
        # If variable is False, Handover is from 2G to 3G
        self._HO_direction = True

        # Call LabMobility3gsmBase Init function
        LabMobility3gsmBase.__init__(self, tc_name, global_config)

        # Read PHONE_NUMBER from testcase xml parameters
        if self._tc_parameters.get_param_value("PHONE_NUMBER") not in (None,
                                                                       ''):
            self._is_phone_number_checked = True
            if str(self._tc_parameters.get_param_value(
                    "PHONE_NUMBER")).isdigit():
                self._phone_number = self._tc_parameters.get_param_value(
                    "PHONE_NUMBER")

            elif self._tc_parameters.get_param_value(
                    "PHONE_NUMBER") == "[PHONE_NUMBER]":
                self._phone_number = str(self._device.get_phone_number())
            else:
                self._phone_number = None
        else:
            self._phone_number = None

        # Read ftp DIRECTION from testcase xml parameters
        self._direction = self._tc_parameters.get_param_value("DIRECTION")

        # Get FTP server parameters
        self._server = global_config.benchConfig.get_parameters("LAB_SERVER")
        self._server_ip_address = self._server.get_param_value("IP")
        self._server_username = self._server.get_param_value("username")
        self._server_password = self._server.get_param_value("password")
        if self._server.has_parameter("ftp_path"):
            self._ftp_path = self._server.get_param_value("ftp_path")
        else:
            self._ftp_path = ""

        # Read the DL_FILE value from UseCase xml Parameter
        self._dlfilename = os.path.join(
            self._ftp_path, self._tc_parameters.get_param_value("DL_FILENAME"))
        # Read the UL_FILE value from UseCase xml Parameter
        self._ulfilename = os.path.join(
            self._ftp_path, self._tc_parameters.get_param_value("UL_FILENAME"))

        # Get Cellular Network configuration from BenchConfig
        self._network = \
            global_config.benchConfig.get_parameters("CELLULAR_NETWORK")
        self._apn = self._network.get_param_value("APN")
        self._ssid = self._network.get_param_value("SSID")