def __init__(self, tc_name, global_config):
        """
        Constructor
        """
        # Call LAB_LTE_BASE Init function
        # All the base config will be set for CELL A
        LabLteBase.__init__(self, tc_name, global_config)
        if self._cell_id == "A":
            self._alt_cell_id = "B"
        else:
            self._alt_cell_id = "A"
        # Read PHYSICAL_CELL_B_ID from test case xml file
        self._physical_cell_b_id = \
            str(self._tc_parameters.get_param_value("PHYSICAL_CELL_B_ID"))

        # Read SCENARIO_PATH for cell B from test case xml file
        self._scenario_path_b = \
            str(self._tc_parameters.get_param_value("SCENARIO_PATH_B"))

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

        self._rrc_state = self._tc_parameters.get_param_value(
            "RRC_STATE", "RRC_CONNECTED")
        if self._rrc_state == "RRC_CONNECTED":
            self._connection_state = "CON"
        else:
            self._connection_state = "IDLE"
        self._alt_cell_4g = self._ns.get_alt_cell_4g()
        self._alt_data_4g = self._alt_cell_4g.get_data()
Example #2
0
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """
        # Call LAB_LTE_BASE Init function
        LabLteBase.__init__(self, tc_name, global_config)

        # Read mode from test case xml file (str)
        self._switch_mode = self._tc_parameters.get_param_value(
            "SWITCH_MODE", "hardshutdown")

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

        self._camp_timeout = self._registration_timeout

        # Instantiate Phone On/OFF utilities
        self.phoneonoff_util = PhoneOnOff(self._networking_api, self._device,
                                          self._logger)
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """
        # Call LAB_LTE_BASE Init function
        LabLteBase.__init__(self, tc_name, global_config)

        # Read mode from test case xml file
        self._switch_mode = self._tc_parameters.get_param_value("SWITCH_MODE")
        # Read the IP version from test case xml file
        self._ip_version = self._tc_parameters.get_param_value(
            "IP_VERSION", "IPV4")

        # Read the IP version from test case xml file
        self._retry_different_ip_version = str_to_bool(
            self._tc_parameters.get_param_value("RETRY_ALTERNATIVE_VERSION",
                                                "False"))

        if self._retry_different_ip_version:
            if self._ip_version == "IPV4":
                self._alternate_ip_version = "IPV6"
                self._logger.info("The alternative IP version is V6 ")
            elif self._ip_version == "IPV6":
                self._alternate_ip_version = "IPV4"
                self._logger.info("the alternative IP version is V4")
            else:
                self._logger.error(
                    "Alternate only if IP version is V4 or V6 and not in DUAL MODE"
                )

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

        # Read the network registration timeout
        self._network_reg_timeout = self._tc_parameters.get_param_value(
            "NETWORK_REG_TIMEOUT", 0, int)
        if self._network_reg_timeout == 0:
            self._network_reg_timeout = self._registration_timeout

        # Instantiate Phone On/OFF utilities
        self.phoneonoff_util = PhoneOnOff(self._networking_api, self._device,
                                          self._logger)

        # Instantiate the IP version
        self._nw_ip_version = ""
Example #4
0
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """
        # Call LAB_LTE_BASE Init function
        LabLteBase.__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"))

        self._rrc_state = self._tc_parameters.get_param_value("RRC_STATE", "RRC_CONNECTED")
Example #5
0
 def __init__(self, tc_name, global_config):
     """
     Constructor
     """
     # Call LAB_LTE_BASE Init function
     LabLteBase.__init__(self, tc_name, global_config)
Example #6
0
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """
        # Call LAB_LTE_BASE Init function
        LabLteBase.__init__(self, tc_name, global_config)
        # Read the the direction file name from UseCase xml Parameter
        self._direction = self._tc_parameters.get_param_value("DIRECTION")
        # 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", ""))
            self._ftp_filename = self._ftp_filename.replace('\\', '/')
            self._dl_ftp_filename = None
        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", ""))
            self._ftp_filename = self._ftp_filename.replace('\\', '/')
            self._dl_ftp_filename = None
        elif self._direction == "BOTH":
            self._dl_ftp_filename = os.path.join(
                self._ftp_path,
                self._tc_parameters.get_param_value("DL_FILENAME", ""))
            self._dl_ftp_filename = self._dl_ftp_filename.replace('\\', '/')
            # 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", ""))
            self._ftp_filename = self._ftp_filename.replace('\\', '/')
        # 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._rrc_state = self._tc_parameters.get_param_value(
            "RRC_STATE", "RRC_CONNECTED")

        # Initializing the variable which will contain the IP address to use.
        self._ip_address = None

        self._phone_system = self._device.get_uecmd("PhoneSystem")

        ######################################################
        #             LTE THROUGHPUT SETTINGS                #
        ######################################################
        self._set_lte_throughput_settings()

        # LTE FTP Test are FUTE by default
        if self._failure_targets == "":
            self._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 LTE category
        self._logger.info(throughput_targets_string(self._throughput_targets))
        self._ftp_api = self._device.get_uecmd("Ftp")
Example #7
0
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """
        # Call LAB_LTE_BASE Init function
        LabLteBase.__init__(self, tc_name, global_config)
        # Get the IP of the Iperf LTE server
        self._server = \
            global_config.benchConfig.get_parameters("LAB_LTE_SERVER")
        self._server_ip_address = self._server.get_param_value("IP")
        # 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", "120"))
        # Read direction (Upload/Download/BOTH)
        self._direction = self._tc_parameters.get_param_value(
            "DIRECTION", "UL")

        self._rrc_state = self._tc_parameters.get_param_value(
            "RRC_STATE", "RRC_CONNECTED")

        ######################################################
        #                   IPERF SETTINGS                   #
        ######################################################

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

        self._iperf_bandwidth = \
            str(self._tc_parameters.get_param_value("IPERF_BANDWIDTH", None)).upper()

        self._computer = None
        if self._ns_model == "AGILENT_E6621A":
            # Get computer type
            self._computer = \
                self._tc_parameters.get_param_value("COMPUTER",
                                                    "IPERF_SERVER")
            self._computer_type = \
                global_config.benchConfig.get_parameters("IPERF_SERVER")

        # Get TCP window size and number of iperf client threads to run concurrently
        # TCP Window size shall be greater than:
        # - Expected throughput * LTE_RTT (round trip time)
        # Max LTE throughput is 150Mbps and LTE_RTT < 20ms
        # 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)

        self._buffer_length = \
            int(self._tc_parameters.get_param_value("BUFFER_LENGTH", 0))
        self._dut_ip_address = None

        # Detect if it is a KPI test or not
        self._kpi_test = self._tc_parameters.get_param_value(
            "KPI_TEST", False, "str_to_bool")
        if self._kpi_test:
            self._logger.info("It is a KPI test")
            self._kpi_data = None
            self._current_iteration = 0

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

        # Detect if a BLER measurement is needed. It performs BLER measurement the following way:
        # Wait a quarter of IPERF duration then perform BLER measurement during half of IPERF duration
        self._perform_bler = self._tc_parameters.get_param_value(
            "BLER", False, "str_to_bool")

        self._iperf_settings = {}

        ######################################################
        #             LTE THROUGHPUT SETTINGS                #
        ######################################################
        self._set_lte_throughput_settings()

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

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