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

        # Get LTE server parameters for ping
        self._server = \
            global_config.benchConfig.get_parameters("LAB_LTE_SERVER")
        self._server_ip_address = self._server.get_param_value("IP")
        self._username = self._server.get_param_value("username")
        self._password = self._server.get_param_value("password")

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

        # init wanted registration parameters to a value that
        self._wanted_reg_state = "None"
        self._ns_lte_cell_service = "None"
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """
        LabMobilityLte3gsmBase.__init__(self, tc_name, global_config)

        # Get LTE server parameters for ping
        self._server = \
            global_config.benchConfig.get_parameters("LAB_LTE_SERVER")
        self._server_ip_address = self._server.get_param_value("IP")
        self._username = self._server.get_param_value("username")
        self._password = self._server.get_param_value("password")

        # Read GSM from testcase xml parameters
        self._back_and_forth = \
            str_to_bool(self._tc_parameters.get_param_value("BACK_AND_FORTH", "FALSE"))

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

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

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

        # 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 SMS_TEXT from testcase xml file
        self._sms_text = self._tc_parameters.get_param_value(
            "SMS_TEXT", "aaaabbbbbcccc")
        # Read PHONE_NUMBER from testcase xml parameters
        self._phone_number = \
            str(self._tc_parameters.get_param_value("PHONE_NUMBER", "0675529935"))
        if self._phone_number.upper() == "[PHONE_NUMBER]":
            self._phone_number = str(self._device.get_phone_number())

        # Instantiate Messaging UECmd for SMS UseCases
        self._messaging_api = self._device.get_uecmd("SmsMessaging")

        # init wanted registration parameters to a value that
        self._wanted_reg_state = "None"
        self._ns_lte_cell_service = "None"
        self._ns_neighbour_power = self._ns_3gsm_cell_power
        self._ns_camped_power = self._ns_lte_cell_power_rf1
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """
        LabMobilityLte3gsmBase.__init__(self, tc_name, global_config)

        # Get LTE server parameters for ping
        self._server = \
            global_config.benchConfig.get_parameters("LAB_LTE_SERVER")
        self._server_ip_address = self._server.get_param_value("IP")
        self._username = self._server.get_param_value("username")
        self._password = self._server.get_param_value("password")

        # Read GSM from testcase xml parameters
        self._back_and_forth = \
            str_to_bool(self._tc_parameters.get_param_value("BACK_AND_FORTH", "FALSE"))

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

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

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

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

        # init wanted registration parameters to a value that
        self._wanted_reg_state = "None"
        self._ns_lte_cell_service = "None"

        self._ns_neighbour_power = self._ns_lte_cell_power_rf1
        self._ns_camped_power = self._ns_3gsm_cell_power
Esempio n. 4
0
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """
        LabMobilityLte3gsmBase.__init__(self, tc_name, global_config)

        # 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 SMS_TEXT from testcase xml file
        self._sms_text = self._tc_parameters.get_param_value("SMS_TEXT")

        # Read SMS_DIRECTION from testcase xml file
        self._sms_direction = str(
            self._tc_parameters.get_param_value("SMS_DIRECTION"))

        # Read SMS_TRANSFER_TIMOUT from testcase xml file
        self._sms_transfer_timeout = \
            int(self._tc_parameters.get_param_value("SMS_TRANSFER_TIMEOUT"))

        # Read DATA_CODING_SCHEME from xml UseCase parameter file
        self._data_coding_sheme = \
            self._tc_parameters.get_param_value("DATA_CODING_SCHEME")

        dcs = DataCodingScheme(self._data_coding_sheme)
        dcs.decode()

        # Get number of bits per character setted in DCS
        self._nb_bits_per_char = dcs.compute_character_size()

        character_set = dcs.get_character_set()

        if character_set == "7BITS":
            self._content_type = "CTEX"
        else:
            self._content_type = "CDAT"

        # Instantiate Messaging UECmd for SMS UseCases
        self._messaging_api = self._device.get_uecmd("SmsMessaging")

        self._sms = SmsMessage(self._sms_text, self._phone_number, "LCSD",
                               self._ns_3gsm_messaging, self._messaging_api,
                               self._data_coding_sheme, self._nb_bits_per_char,
                               self._sms_transfer_timeout, self._content_type,
                               self._sms_direction)
    def __init__(self, tc_name, global_config):
        """
        Constructor
        """
        # Call LabMobilityLte3gsmBase Init function
        LabMobilityLte3gsmBase.__init__(self, tc_name, global_config)

        # Get FTP server parameters
        self._server = \
            global_config.benchConfig.get_parameters("LAB_LTE_SERVER")
        self._server_ip_address = self._server.get_param_value("IP")
        self._username = self._server.get_param_value("username")
        self._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 = ""

        # Define PING parameters
        self._packet_size = 32
        self._nb_pings = 10

        # Read the the direction file name from UseCase xml Parameter
        self._direction = self._tc_parameters.get_param_value("DIRECTION")

        # Checking if the entered direction is correct.
        if self._direction not in ("UL", "DL", "BOTH"):
            self._error.Msg = "%s is not a known xfer direction" % \
                self._direction
            raise AcsConfigException(AcsConfigException.INVALID_PARAMETER,
                                     self._error.Msg)

        # 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('\\', '/')
        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('\\', '/')
        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._ul_ftp_filename = os.path.join(
                self._ftp_path,
                self._tc_parameters.get_param_value("UL_FILENAME"))
            self._ul_ftp_filename = self._ul_ftp_filename.replace('\\', '/')

        # Read CH_BANDWIDTH from test case xml file
        self._bandwidth = \
            self._tc_parameters.get_param_value("CELL_CHANNEL_BANDWIDTH", "20")

        # Read ANTENNAS NUMBER from test case xml file
        self._antennas_number = \
            self._tc_parameters.get_param_value("ANTENNAS_NUMBER", '1')

        # Read TRANSMISSION_MODE from test case xml file
        self._transmission_mode = \
            self._tc_parameters.get_param_value("TRANSMISSION_MODE","TM1")
        # Read BANDWIDTH from test case xml file
        self._type0_bitmap = \
            str(self._tc_parameters.get_param_value("TYPE0_BITMAP","63"))
        # Read DL_RB_SIZE from test case xml file
        self._dl_nb_rb = \
            self._tc_parameters.get_param_value("DL_RB_SIZE","50")
        # Read UL_RB_SIZE from test case xml file
        self._ul_nb_rb = \
            self._tc_parameters.get_param_value("UL_RB_SIZE","10")
        # Read I_MCS from test case xml file
        self._dl_i_mcs = \
            self._tc_parameters.get_param_value("DL_I_MCS","23")
        # Read I_MCS from test case xml file
        self._ul_i_mcs = \
            self._tc_parameters.get_param_value("UL_I_MCS","3")
        # Read UL Grant Mode from test case xml file
        self._ul_grant_mode = \
            self._tc_parameters.get_param_value("UL_GRANT_MODE", "FIXEDMAC")

        # Read the the ip _version file name from UseCase xml Parameter
        self._ip_version = self._tc_parameters.get_param_value(
            "IP_VERSION", "IPV4")

        # Get the server ipv6 address from the BenchConfig, if the key
        # is present in the file.
        if self._server.has_parameter("IPV6"):
            self._server_ip_v6_address = self._server.get_param_value("IPV6")

        # 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

        if self._xfer_timeout is None:
            raise AcsConfigException(AcsConfigException.INVALID_PARAMETER,
                                     "XFER_TIMEOUT should be int")

        self._two_eps_bearers = self._tc_parameters.get_param_value(
            "TWO_EPS_BEARER")
        self._two_eps_bearers = \
            str_to_bool(self._two_eps_bearers)

        # In case of 2 PDPs, define the APN and IP address for the 2nd one
        if self._two_eps_bearers is True:
            self._second_apn = "agilent2"
            self._second_dut_ip_version = "IPV4"
            self._second_dut_ip_address = "10.102.243.25"

        # Read Inter-Rat redirection type
        self._irat_type = self._tc_parameters.get_param_value("I-RAT_TYPE")
        if self._irat_type is None:
            self._irat_type = "NORMAL"
        elif self._irat_type not in ("NORMAL", "BLIND"):
            raise AcsConfigException(
                AcsConfigException.INVALID_PARAMETER,
                "I-RAT_TYP should be 'NORMAL' or 'BLIND'")

        # Default timeout for DUT camping
        self._camp_timeout = 180

        # Define timeout for AT command
        self._command_timeout = 10

        # Define AT PROXY launch mode
        self._launch_mode = 2

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

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

        # if 2 EPS bearers were requested
        if self._two_eps_bearers == True:
            # Instantiate the modem UE commands
            self._modem_flashing_api = self._device.get_uecmd("ModemFlashing")

            # Get Serial Handler instance
            self._serial_handler = SerialHandler()

            # Win COM port to be used
            self.at_proxy_com_port = None

            # Store the AT proxy connection availability
            self.modem_available = False