Esempio n. 1
0
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """

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

        # 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._filename = os.path.join(
            self._ftp_path,
            self._tc_parameters.get_param_value("UL_FILENAME", ""))

        # Read the XFER_TIMEOUT from UseCase xml Parameter
        self._xfer_timeout = \
            int(self._tc_parameters.get_param_value("XFER_TIMEOUT"))

        # Get customized failure Targets
        self._failure_targets = \
            str(self._tc_parameters.get_param_value("FAILURE_TARGETS", "FUTE"))

        # Update the failure targets
        self._throughput_targets.set_failure_throughput_from_config(self._dut_config,
                                                                    self._failure_targets)
        # Log Throughput targets for EGPRS
        self._logger.info(throughput_targets_string(self._throughput_targets))

        self._ftp_api = self._device.get_uecmd("Ftp")
Esempio n. 2
0
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """
        # Call LAB_EGPRS_BASE Init function
        LabEgprsBase.__init__(self, tc_name, global_config)

        # Read the ftp file name from UseCase xml Parameter
        if self._direction == "DL":
            self._ftp_filename = os.path.join(
                self._ftp_path,
                self._tc_parameters.get_param_value("DL_FILENAME"))
        elif self._direction == "UL":
            # Read the UL_FILE value from UseCase xml Parameter
            self._ftp_filename = os.path.join(
                self._ftp_path,
                self._tc_parameters.get_param_value("UL_FILENAME"))

        # Read the MEASUREMENT_DURATION from UseCase xml Parameter
        self._measurement_duration = self._tc_parameters.\
            get_param_value("MEASUREMENT_DURATION")
        if self._measurement_duration is not None and \
                str(self._measurement_duration).isdigit():
            self._measurement_duration = int(self._measurement_duration)
        else:
            self._measurement_duration = None

        # Read the XFER_TIMEOUT from UseCase xml Parameter
        self._xfer_timeout = self._tc_parameters.get_param_value(
            "XFER_TIMEOUT")
        if self._xfer_timeout is not None and str(
                self._xfer_timeout).isdigit():
            self._xfer_timeout = int(self._xfer_timeout)
        else:
            self._xfer_timeout = None

        self._failure_throughput_dict = {}

        # Read the FAILURE_OTATX from UseCase xml Parameter

        failure_targets = self._tc_parameters.get_param_value("FAILURE_TARGETS").\
            replace(" ", "").split(",")

        for failure in failure_targets:
            self._failure_throughput_dict.update(
                {str(failure.split(":")[0]): float(failure.split(":")[1])})

        self._wait_time_before_measure = 5
        self._device_logger = None
        self._start_ftp_trigger_msg = ""
        self._ftp_task_id = None
        self._op_code_message = ""
        self._op_code = None
        self._timeout = None
Esempio n. 3
0
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """

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

        # Read the number of pings to do
        self._nb_pings = self._tc_parameters.get_param_value("PACKET_COUNT")

        # Read the data size of a packet
        self._packet_size = self._tc_parameters.get_param_value("PACKET_SIZE")

        # Get target % of received packet for ping
        self._target_ping_packet_loss_rate = \
            float(self._tc_parameters.get_param_value("TARGET_PACKET_LOSS_RATE"))
Esempio n. 4
0
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """

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

        # Set the default number of pings to do
        self._nb_pings = 10

        # Set the default data size of a packet
        self._packet_size = 32

        # Get target % of received packet for ping
        self._target_ping_packet_loss_rate = \
            self._tc_parameters.get_param_value("TARGET_PACKET_LOSS_RATE")

        if isinstance(self._target_ping_packet_loss_rate, (int, float)):
            self._target_ping_packet_loss_rate = \
                float(self._target_ping_packet_loss_rate)
        else:
            # if user doesn't enter the correct value, set the default value 0
            self._target_ping_packet_loss_rate = 0
Esempio n. 5
0
    def __init__(self, tc_name, global_config):

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

        # Read Iperf PORT
        self._port = int(self._tc_parameters.get_param_value("PORT"))

        # Read Iperf measurement duration
        self._duration = \
            int(self._tc_parameters.get_param_value("DURATION"))

        # Read Iperf protocol
        self._iperf_protocol = \
            str(self._tc_parameters.get_param_value("IPERF_PROTOCOL", "TCP"))

        # Read Iperf TUNE OPTIONS
        self._tune_options = self._tc_parameters.\
            get_param_value("IPERF_TUNE_OPTIONS")
        if self._tune_options in (None, "", 1, '1', 'on', 'ON'):
            self._tune_options = 1
        else:
            self._tune_options = 0

        # Get TCP window size and number of iperf client threads to run concurrently
        # window size > tput_to_reach * round_trip_time (700ms for EDGE)
        # Iperf compute automatically the windows size.
        # It is better to not set a window size as result with iperf default size are pretty good
        self._iperf_uldl_parameters = retrieve_parameters_from_tc_params(
            self._tc_parameters)

        # Get customized failure Targets
        self._failure_targets = \
            str(self._tc_parameters.get_param_value("FAILURE_TARGETS", ""))

        self._iperf_settings = \
            {"server_ip_address": self._server_ip_address,
             "port_number": self._port,
             "duration": self._duration,
             "protocol": self._iperf_protocol.lower()}

        # Get computer type
        self._computer = self._tc_parameters.get_param_value("COMPUTER")
        if self._computer == "":
            self._computer = None
        # Load computer equipment
        if self._computer is not None:
            self._computer = self._em.get_computer(self._computer)

        # Update the failure targets
        self._throughput_targets.set_failure_throughput_from_config(
            self._dut_config, self._failure_targets)

        # Log Throughput targets for EGPRS
        self._logger.info(throughput_targets_string(self._throughput_targets))

        # Set Iperf direction
        if self._direction in ("UL", "up", None):
            self._iperf_direction = "up"
        elif self._direction in ("DL", "down"):
            self._iperf_direction = "down"
        else:
            self._iperf_direction = "both"