def __init__(self, tc_name, global_config): """ Constructor """ # Call UseCase base Init function UseCaseBase.__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", "softshutdown") # Read registrationTimeout from Device_Catalog.xml self._registration_timeout = \ int(self._dut_config.get("registrationTimeout")) # Read CELLULAR_NETWORK parameters from BenchConfig.xml 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") # Retrieve valid bench name for 2G capability self._bench_name = get_nw_sim_bench_name("2G", global_config, self._logger) # Read NETWORK_SIMULATOR from BenchConfig.xml self._ns_node = \ global_config.benchConfig.get_parameters(self._bench_name) # Read Band from test case xml file (str) self._band = self._tc_parameters.get_param_value("CELL_BAND") # Read BCH_ARFCN from test case xml file self._bch_arfcn = int(self._tc_parameters.get_param_value("BCH_ARFCN")) # Read CELL_SERVICE from test case xml file self._cell_service = \ str(self._tc_parameters.get_param_value("CELL_SERVICE")) # Read CELL_POWER from test case xml file self._cell_power = \ int(self._tc_parameters.get_param_value("CELL_POWER")) # Read Mobile Country Code (MCC) from test case xml file self._mcc = \ int(self._tc_parameters.get_param_value("MCC")) # Read Mobile Network Code (MNC) from test case xml file self._mnc = \ int(self._tc_parameters.get_param_value("MNC")) # Read PDP Activation from test case xml file self._pdp_activation = str_to_bool( self._tc_parameters.get_param_value("PDP_ACTIVATION")) # Instantiate the network simulator eqt_man = EM() self._ns = eqt_man.get_cellular_network_simulator(self._bench_name) self._ns_cell_2g = self._ns.get_cell_2g() self._ns_data_2g = self._ns_cell_2g.get_data() # Instantiate generic UECmd for camp self._modem_api = self._device.get_uecmd("Modem") # Instantiate generic UECmd for camp self._networking_api = self._device.get_uecmd("Networking") # retrieve SIM card UE commands self.sim_card_api = self._device.get_uecmd("SimCard") self._sim_states = self.sim_card_api.POSSIBLE_SIM_STATES # Instantiate Phone On/OFF utilities self.phoneonoff_util = PhoneOnOff(self._networking_api, self._device, self._logger) # init wanted registration parameters to a value that # will make the uecmd that used it to raise an error self._wanted_reg_state = "None"
def __init__(self, tc_name, global_config): """ Constructor """ # Call LabMobilityBase Init function UseCaseBase.__init__(self, tc_name, global_config) # Read CELLULAR_NETWORK parameters from BenchConfig.xml 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") # Retrieve valid bench name for 2G capability self._bench_name = get_nw_sim_bench_name("2G", global_config, self._logger) # Read NETWORK_SIMULATOR from BenchConfig.xml self._ns_node = \ global_config.benchConfig.get_parameters(self._bench_name) self._ns_IP_Lan1 = self._ns_node.get_param_value("IP_Lan1") self._ns_IP_Lan2 = \ self._ns_node.get_param_value("IP_Lan2") self._ns_DUT_IP_Address = \ self._ns_node.get_param_value("DUT_IP_Address") self._ns_DNS1 = self._ns_node.get_param_value("DNS1") self._ns_DNS2 = self._ns_node.get_param_value("DNS2") self._ns_Subnet_Mask = \ self._ns_node.get_param_value("Subnet_Mask") self._ns_Default_Gateway = \ self._ns_node.get_param_value("Default_Gateway") # Read the xml Template self._band_name = self._tc_parameters.get_param_value("CELL_BAND") self._bch_arfcn = int(self._tc_parameters.get_param_value("BCH_ARFCN")) self._pdtch_arfcn = \ int(self._tc_parameters.get_param_value("PDTCH_ARFCN")) self._cell_power = \ int(self._tc_parameters.get_param_value("CELL_POWER")) self._multislot = \ self._tc_parameters.get_param_value("MULTISLOT_CONFIG") self._ul_mcs = self._tc_parameters.get_param_value("UL_MCS") self._dl_mcs = self._tc_parameters.get_param_value("DL_MCS") self._ps_mcs = self._tc_parameters.get_param_value("PS_MCS") # Get UECmdLayer for Data and Voice call Use Cases self._networking_api = self._device.get_uecmd("Networking") self._modem_api = self._device.get_uecmd("Modem") self._voicecall_api = self._device.get_uecmd("VoiceCall") # set VOICE CODER RATE to FR_AMR_NB_1220 self._voice_coder_rate = "FR_AMR_NB_1220" # Create cellular network simulator and retrieve 2G data interface self._ns = self._em.get_cellular_network_simulator(self._bench_name) # Shortcut to get Cell 2G parameters self._ns_cell_2g = self._ns.get_cell_2g() self._ns_data_2g = self._ns_cell_2g.get_data() self._ns_voice_call_2g = self._ns_cell_2g.get_voice_call() # Read PHONE_NUMBER from testcase xml parameters self._phone_number = self._tc_parameters.get_param_value( "PHONE_NUMBER") if self._phone_number not in (None, ''): if str(self._phone_number).isdigit(): pass elif self._phone_number == "[PHONE_NUMBER]": self._phone_number = str(self._device.get_phone_number()) else: self._phone_number = None else: self._phone_number = None self._timeout = int(self._tc_parameters.get_param_value("TIMEOUT")) self._call_setup_timeout = int( self._tc_parameters.get_param_value("CALL_SETUP_TIMEOUT")) self._browser_type = self._tc_parameters.\ get_param_value("BROWSER_TYPE").lower() self._web_page = self._tc_parameters.get_param_value("WEBSITE_URL") if self._web_page in [None, '']: self._web_page = "http://" + str(self._ns_IP_Lan1) # Read registrationTimeout from DeviceCatalog.xml self._registration_timeout = \ int(self._dut_config.get("registrationTimeout"))
def __init__(self, tc_name, global_config): """ Constructor """ # Call UseCase base Init function UseCaseBase.__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", "softshutdown") # Read registrationTimeout from Device_Catalog.xml self._registration_timeout = \ int(self._dut_config.get("registrationTimeout")) # Read CELLULAR_NETWORK parameters from BenchConfig.xml 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") # Retrieve valid bench name for 3G capability self._bench_name = get_nw_sim_bench_name("3G", global_config, self._logger) # bench_name should be either NETWORK_SIMULATOR1 or NETWORK_SIMULATOR2 # In both cases, we need to retrieve the NS number (position in the bench config, either 1 or 2) self._ns_number = int(self._bench_name[-1]) # Read NETWORK_SIMULATOR from BenchConfig.xml self._ns_node = \ global_config.benchConfig.get_parameters(self._bench_name) # Retrieve the model of the equipment self._ns_model = self._ns_node.get_param_value("Model") # Read Band from test case xml file (str) self._band = self._tc_parameters.get_param_value("CELL_BAND") # NS_CELL_REL self._ns_cell_rel = 7 # Read BCH_ARFCN from test case xml file self._dl_uarfcn = int(self._tc_parameters.get_param_value("DL_UARFCN")) # Read CELL_SERVICE from test case xml file self._cell_service = \ str(self._tc_parameters.get_param_value("CELL_SERVICE")) # Read CELL_POWER from test case xml file self._cell_power = \ int(self._tc_parameters.get_param_value("CELL_POWER")) # Read Mobile Country Code (MCC) from test case xml file self._mcc = \ int(self._tc_parameters.get_param_value("MCC")) # Read Mobile Network Code (MNC) from test case xml file self._mnc = \ int(self._tc_parameters.get_param_value("MNC")) # Read PDP Activation from test case xml file self._pdp_activation = str_to_bool( self._tc_parameters.get_param_value("PDP_ACTIVATION")) # Instantiate the network simulator eqt_man = EM() self._ns = eqt_man.get_cellular_network_simulator(self._bench_name) self._ns_cell_3g = self._ns.get_cell_3g() self._ns_data_3g = self._ns_cell_3g.get_data() # Instantiate generic UECmd for camp self._modem_api = self._device.get_uecmd("Modem") # Instantiate generic UECmd for camp self._networking_api = self._device.get_uecmd("Networking") # Instantiate Phone On/OFF utilities self.phoneonoff_util = PhoneOnOff(self._networking_api, self._device, self._logger) # init wanted registration parameters to a value that # will make the uecmd that used it to raise an error self._wanted_reg_state = "None"
def __init__(self, tc_name, global_config): """ Constructor """ # Call UseCase base Init function UseCaseBase.__init__(self, tc_name, global_config) # Read registrationTimeout from Device_Catalog.xml self._registration_timeout = \ int(self._dut_config.get("registrationTimeout")) # Read CELLULAR_NETWORK parameters from BenchConfig.xml 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") # Read callSetupTimeout from Device_Catalog.xml self._call_setup_time = \ int(self._dut_config.get("callSetupTimeout")) # Retrieve valid bench name for 3G capability self._bench_name = get_nw_sim_bench_name("3G", global_config, self._logger) # Read NETWORK_SIMULATOR from BenchConfig.xml self._ns_node = \ global_config.benchConfig.get_parameters(self._bench_name) # Read CELL_BAND from test case xml file self._band = int(self._tc_parameters.get_param_value("CELL_BAND")) # Read DL_UARFCN from test case xml file self._dl_uarfcn = int(self._tc_parameters.get_param_value("DL_UARFCN")) # Read CELL_SERVICE from test case xml file self._cell_service = self._tc_parameters.get_param_value( "CELL_SERVICE", "CIRCUIT") # Set CELL POWER to -60 dBm self._cell_power = int(-60) # set VOICE CODER RATE to FR_AMR_NB_1220 self._voice_coder_rate = "FR_AMR_NB_1220" # Read SMS_TEXT from xml UseCase parameter file self._sms_text = self._tc_parameters.get_param_value("SMS_TEXT") # Set data coding sheme self._data_coding_sheme = str(00) # Read SMS_TRANSFER_TIMEOUT from xml UseCase parameter file self._sms_transfer_timeout = \ int(self._tc_parameters.get_param_value("SMS_TRANSFER_TIMEOUT")) dcs = DataCodingScheme(self._data_coding_sheme) dcs.decode() # Create cellular network simulator and retrieve 3G voice call interface self._ns = self._em.get_cellular_network_simulator(self._bench_name) # Shortcut to get Cell 3G parameters self._ns_cell_3g = self._ns.get_cell_3g() self._ns_voice_call_3g = self._ns_cell_3g.get_voice_call() self._ns_data_3g = self._ns_cell_3g.get_data() # retrieve 3g messaging interface self._messaging_3g = self._ns_cell_3g.get_messaging() # 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 self._messaging_api = self._device.get_uecmd("SmsMessaging") # Instantiate Modem UECmd for checking phone registration self._modem_api = self._device.get_uecmd("Modem") # Instantiate generic UECmd for voiceCall self._voicecall_api = self._device.get_uecmd("VoiceCall") # Instantiate generic UECmd for camp self._networking_api = self._device.get_uecmd("Networking")
def __init__(self, tc_name, global_config): """ Constructor """ # Call UseCase base init function UseCaseBase.__init__(self, tc_name, global_config) # Read registrationTimeout from Device_Catalog.xml self._registration_timeout = \ int(self._dut_config.get("registrationTimeout")) # Read CELLULAR_NETWORK parameters from BenchConfig.xml 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") # Read callSetupTimeout from Device_Catalog.xml self._call_setup_time = \ int(self._dut_config.get("callSetupTimeout")) # Retrieve valid bench name for 3G capability self._bench_name = get_nw_sim_bench_name("3G", global_config, self._logger) # bench_name should be either NETWORK_SIMULATOR1 or NETWORK_SIMULATOR2 # In both cases, we need to retrieve the NS number (position in the bench config, either 1 or 2) self._ns_number = int(self._bench_name[-1]) # Read NETWORK_SIMULATOR from BenchConfig.xml self._ns_node = \ global_config.benchConfig.get_parameters(self._bench_name) # Retrieve the model of the equipment self._ns_model = self._ns_node.get_param_value("Model") # Read CELL_BAND from test case xml file self._band = int(self._tc_parameters.get_param_value("CELL_BAND")) # NS_CELL_REL self._ns_cell_rel = 7 # Read DL_UARFCN from test case xml file self._dl_uarfcn = int(self._tc_parameters.get_param_value("DL_UARFCN")) # Read CELL_SERVICE from test case xml file self._cell_service = self._tc_parameters.get_param_value( "CELL_SERVICE") # Read CELL_POWER from test case xml file self._cell_power = \ int(self._tc_parameters.get_param_value("CELL_POWER")) # Read VOICE_CODER_RATE from test case xml file self._voice_coder_rate = \ self._tc_parameters.get_param_value("VOICE_CODER_RATE") # Read CALL_DURATION from test case xml file self._call_duration = \ int(self._tc_parameters.get_param_value("CALL_DURATION")) # Read Mobile Country Code (MCC) from test case xml file self._mcc = \ self._tc_parameters.get_param_value("MCC", 1, int) # Read Mobile Network Code (MNC) from test case xml file self._mnc = \ self._tc_parameters.get_param_value("MNC", 1, int) # Create cellular network simulator and retrieve 2G voice call interface self._ns = self._em.get_cellular_network_simulator(self._bench_name) self._ns_cell_3g = self._ns.get_cell_3g() self._ns_voice_call_3g = self._ns_cell_3g.get_voice_call() self._ns_data_3g = self._ns_cell_3g.get_data() # Instantiate generic UECmd for all use cases self._modem_api = self._device.get_uecmd("Modem") self._voice_call_api = self._device.get_uecmd("VoiceCall") self._networking_api = self._device.get_uecmd("Networking")
def __init__(self, tc_name, global_config): """ Constructor """ # Call UseCase base Init function UseCaseBase.__init__(self, tc_name, global_config) # Read registrationTimeout from Device_Catalog.xml self._registration_timeout = \ int(self._dut_config.get("registrationTimeout")) # Read CELLULAR_NETWORK parameters from BenchConfig.xml 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") # Retrieve valid bench name for 2G capability self._bench_name = get_nw_sim_bench_name("2G", global_config, self._logger) # Read NETWORK_SIMULATOR from BenchConfig.xml self._ns_node = \ global_config.benchConfig.get_parameters(self._bench_name) # Read the CELL_BAND value from UseCase xml Parameter self._band_name = self._tc_parameters.get_param_value("CELL_BAND") # Read the CELL_POWER value from UseCase xml Parameter self._cell_power = \ int(self._tc_parameters.get_param_value("CELL_POWER")) # Read the BCH_ARFCN value from UseCase xml Parameter self._bch_arfcn = \ int(self._tc_parameters.get_param_value("BCH_ARFCN")) # Read the PDTCH_ARFCN value from UseCase xml Parameter self._pdtch_arfcn = \ int(self._tc_parameters.get_param_value("PDTCH_ARFCN")) # Read the DATA_CODING_SCHEME from UseCase xml Parameter self._data_coding_sheme = \ str(self._tc_parameters.get_param_value("DATA_CODING_SCHEME")) # Read the SMS_TEXT from UseCase xml Parameter self._sms_text = self._tc_parameters.get_param_value("SMS_TEXT") # Read the SMS_TRANSFER_TIMEOUT from UseCase xml Parameter self._sms_transfer_timeout = \ int(self._tc_parameters.get_param_value("SMS_TRANSFER_TIMEOUT")) # Get number of bits per character set dcs = DataCodingScheme(self._data_coding_sheme) dcs.decode() 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") # Instantiate Modem UECmd for checking phone registration self._modem_api = self._device.get_uecmd("Modem") # Create cellular network simulator eqt_man = EM() self._ns = eqt_man.get_cellular_network_simulator(self._bench_name) self._ns_cell_2g = self._ns.get_cell_2g() self._ns_messaging_2g = self._ns_cell_2g.get_messaging() self._ns_data_2g = self._ns_cell_2g.get_data() # Instantiate generic UECmd for camp self._networking_api = self._device.get_uecmd("Networking")
def __init__(self, tc_name, global_config): """ Constructor """ UseCaseBase.__init__(self, tc_name, global_config) # Read registrationTimeout from DeviceCatalog.xml self._registration_timeout = \ int(self._dut_config.get("registrationTimeout")) # Read maxDlMultislotConfig from DeviceCatalog.xml max_dl_multislot_config = \ str(self._dut_config.get("maxDlMultislotConfig")) # Read maxUlMultislotConfig from DeviceCatalog.xml max_ul_multislot_config = \ str(self._dut_config.get("maxUlMultislotConfig")) # Read the LAB_SERVER parameters from BenchConfig.xml self._server = \ global_config.benchConfig.get_parameters("LAB_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 = "" # Read CELLULAR_NETWORK parameters from BenchConfig.xml 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") # Cell Tech is 2G self.ns_cell_tech = "2G" # Retrieve valid bench name for 2G capability self._bench_name = get_nw_sim_bench_name(self.ns_cell_tech, global_config, self._logger) # bench_name should be either NETWORK_SIMULATOR1 or NETWORK_SIMULATOR2 # In both cases, we need to retrieve the NS number (position in the bench config, either 1 or 2) self._ns_number = int(self._bench_name[-1]) # Read NETWORK_SIMULATOR from BenchConfig.xml self._ns_node = \ global_config.benchConfig.get_parameters(self._bench_name) # Read the Model of the NETWORK_SIMULATOR self._ns_model = self._ns_node.get_param_value("Model") self._ns_IP_Lan1 = self._ns_node.get_param_value("IP_Lan1") self._ns_IP_Lan2 = \ self._ns_node.get_param_value("IP_Lan2") self._ns_DUT_IP_Address = \ self._ns_node.get_param_value("DUT_IP_Address") self._ns_DUT_IP_Address2 = \ self._ns_node.get_param_value("DUT_IP_Address2", "") self._ns_DNS1 = self._ns_node.get_param_value("DNS1") self._ns_DNS2 = self._ns_node.get_param_value("DNS2") self._ns_Subnet_Mask = \ self._ns_node.get_param_value("Subnet_Mask") self._ns_Default_Gateway = \ self._ns_node.get_param_value("Default_Gateway") # Read the xml Template self._band_name = self._tc_parameters.get_param_value("CELL_BAND") # NS_CELL_REL self._ns_cell_rel = 7 self._cell_power = \ int(self._tc_parameters.get_param_value("CELL_POWER")) # Read the DIRECTION value from UseCase xml Parameter self._direction = self._tc_parameters.get_param_value("DIRECTION") # Read the Multislot Configuration value from UseCase xml Parameter # Check if this value is set to MAX or not multislot_config = \ str(self._tc_parameters.get_param_value("MULTISLOT_CONFIG", "MAX")) if multislot_config != "" or multislot_config != "None": if multislot_config == "MAX" and self._direction == "DL": self._multislot = max_dl_multislot_config elif multislot_config == "MAX" and self._direction == "UL": self._multislot = max_ul_multislot_config elif multislot_config == "MAX" and (self._direction == "" or self._direction is None): self._multislot = "D3U2" elif multislot_config != "MAX": self._multislot = multislot_config else: self._logger.info( "Unknown Multislot Configuration %s has been chosen" % multislot_config) self._ul_mcs = self._tc_parameters.get_param_value("UL_MCS", "MCS9") self._dl_mcs = self._tc_parameters.get_param_value("DL_MCS", "MCS9") self._ps_mcs = self._tc_parameters.get_param_value("PS_MCS", "PS1") # Read the DIRECTION value from UseCase xml Parameter self._direction = self._tc_parameters.get_param_value("DIRECTION") # Get UECmdLayer for Data Use Cases self._networking_api = self._device.get_uecmd("Networking") self._modem_api = self._device.get_uecmd("Modem") # Create cellular network simulator and retrieve 2G data interface self._ns = self._em.get_cellular_network_simulator(self._bench_name) self._ns_cell_2g = self._ns.get_cell_2g() self._ns_data_2g = self._ns_cell_2g.get_data() # Read the throughput targets self._throughput_targets = TelephonyConfigsParser("Throughput_Targets").\ parse_gprs_egprs_theoretical_targets("EGPRS", self._multislot, self._dl_mcs, self._ul_mcs)
def __init__(self, tc_name, global_config): """ Constructor """ UseCaseBase.__init__(self, tc_name, global_config) # Boot mode selected is MOS self._boot_mode_selected = "MOS" # Get TC parameters self._registration_timeout = \ int(self._dut_config.get("registrationTimeout")) # Wait 15 seconds before UE detach self._wait_before_ue_detach = 15 # 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 = "" # Read 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") # Get the apn_ip_version from UseCase xml Parameter self._apn_ip_version = self._tc_parameters.get_param_value( "APN_IP_VERSION") if self._apn_ip_version is None: self._apn_ip_version = self._ip_version # Get Network configuration 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") # Retrieve valid bench name for 4G capability self._bench_name = get_nw_sim_bench_name("4G", global_config, self._logger) # bench_name should be either NETWORK_SIMULATOR1 or NETWORK_SIMULATOR2 # In both cases, we need to retrieve the NS number (position in the bench config, either 1 or 2) self._ns_number = int(self._bench_name[-1]) # Read NETWORK_SIMULATOR from BenchConfig.xml self._ns_node = \ global_config.benchConfig.get_parameters(self._bench_name) self._ns_dut_ip_Address = \ self._ns_node.get_param_value("DUT_IP_Address") # It is not mandatory to have a IPV6 address for a LTE test if self._ns_node.has_parameter("DUT_IPV6_Address"): self._ns_dut_ipv6_Address = \ self._ns_node.get_param_value("DUT_IPV6_Address") else: self._ns_dut_ipv6_Address = None self._ns_model = self._ns_node.get_param_value("Model") # Read the xml Template # Read MIMO from test case xml file self._mimo_temp = self._tc_parameters.get_param_value("MIMO", '') if self._mimo_temp not in (None, ''): self._mimo = (str(self._mimo_temp).lower() == "true") else: self._mimo = self._mimo_temp # Read CARRIER_AGGREGATION self._carrier_aggregation = self._tc_parameters.get_param_value( 'CARRIER_AGGREGATION', 'False', 'str_to_bool') # Read SIGNAL_MODE from test case xml file self._signal_mode = \ str(self._tc_parameters.get_param_value("SIGNAL_MODE")) # Read PHYSICAL_CELL_ID from test case xml file self._physical_cell_id = \ str(self._tc_parameters.get_param_value("PHYSICAL_CELL_ID")) # Read CELL_ID from test case xml file self._cell_id = \ str(self._tc_parameters.get_param_value("CELL_ID", "A")) # Read CELL_POWER_RFO1 from test case xml file self._cell_power_rf1 = \ str(self._tc_parameters.get_param_value("CELL_POWER_RFO1", "-40")) # Read CELL_POWER_RFO2 from test case xml file self._cell_power_rf2 = \ str(self._tc_parameters.get_param_value("CELL_POWER_RFO2")) # Read ANTENNAS NUMBER from test case xml file self._antennas_number = \ self._tc_parameters.get_param_value("ANTENNAS_NUMBER", '') # Read CH_BANDWIDTH from test case xml file self._bandwidth = \ self._tc_parameters.get_param_value("CELL_CHANNEL_BANDWIDTH", '') # Read TRANSMISSION_MODE from test case xml file self._transmission_mode = \ self._tc_parameters.get_param_value("TRANSMISSION_MODE") # 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") # Read UL_RB_SIZE from test case xml file self._ul_nb_rb = \ self._tc_parameters.get_param_value("UL_RB_SIZE") # Read I_MCS from test case xml file self._dl_i_mcs = \ self._tc_parameters.get_param_value("DL_I_MCS") # Read I_MCS from test case xml file self._ul_i_mcs = \ self._tc_parameters.get_param_value("UL_I_MCS") # Read UL Grant Mode from test case xml file self._ul_grant_mode = \ self._tc_parameters.get_param_value("UL_GRANT_MODE", "FIXEDMAC") # Read Home Public Land Mobile Network (HPLMN) Coverage # from test case xml file and accept all the different # written for True and False values self._hplmn_coverage = \ self._tc_parameters.get_param_value("HPLMN_COVERAGE") # Read Mobile Country Code (MCC) from test case xml file self._mcc = \ int(self._tc_parameters.get_param_value("MCC", 1)) # Read Mobile Network Code (MNC) from test case xml file self._mnc = \ int(self._tc_parameters.get_param_value("MNC", 1)) # Read Duplex type (Frequency Division Duplex (FDD) or Time Division Duplex (TDD)) from test case xml file self._duplex_type = \ self._tc_parameters.get_param_value("DUPLEX_TYPE", "FDD") if self._duplex_type == "FDD": # Read CELL_BAND from test case xml file self._cell_band = \ int(self._tc_parameters.get_param_value("CELL_BAND", 1)) else: # Read CELL_BAND from test case xml file self._cell_band = \ self._tc_parameters.get_param_value("CELL_BAND", None) if self._cell_band in [None, "None"]: self._cell_band = None else: self._cell_band = int(self._cell_band) # Read DL_EARFCN from test case xml file self._dl_earfcn = \ int(self._tc_parameters.get_param_value("DL_EARFCN", 300)) if self._carrier_aggregation: # Read SCC_BAND from test case xml file self._scc_band = int( self._tc_parameters.get_param_value("SCC_BAND")) # Read SCC_EARFCN from test case xml file self._scc_earfcn = int( self._tc_parameters.get_param_value("SCC_EARFCN")) # Read SCC_BANDWIDTH from test case xml file self._scc_bandwidth = self._tc_parameters.get_param_value( "SCC_BANDWIDTH") # Read SCC_DL_RB_SIZE from test case xml file self._scc_dl_nb_rb = \ self._tc_parameters.get_param_value("SCC_DL_RB_SIZE") # Read SCC_I_MCS from test case xml file self._scc_dl_i_mcs = \ self._tc_parameters.get_param_value("SCC_DL_I_MCS") # Read SCENARIO_PATH from test case xml file self._scenario_path = \ str(self._tc_parameters.get_param_value("SCENARIO_PATH")) # Read IMS from test case xml file to know if IMS service should be enabled or not self._ims = \ str(self._tc_parameters.get_param_value("IMS", "off")).lower() # Get UECmdLayer for Data Use Cases self._networking_api = self._device.get_uecmd("Networking") self._modem_api = self._device.get_uecmd("Modem") # Read if we need to switch configuration between TDD/FDD at the end of an iteration self._switch_tdd_fdd = self._tc_parameters.get_param_value( "SWITCH_TDD_FDD", "False", "str_to_bool") # Create cellular network simulator self._ns = self._em.get_cellular_network_simulator(self._bench_name) self._ns_cell_4g = self._ns.get_cell_4g() self._ns_data_4g = self._ns.get_cell_4g().get_data() # init wanted registration parameters to a value that # will make the uecmd that used it to raise an error self._wanted_reg_state = "None"
def __init__(self, tc_name, global_config): """ Constructor """ # Call LiveMuMBase base Init function LiveMuMBase.__init__(self, tc_name, global_config) # Read registrationTimeout from Device_Catalog.xml self._registration_timeout = \ int(self._dut_config.get("registrationTimeout")) # Read callSetupTimeout from Device_Catalog.xml self._call_setup_time = \ int(self._dut_config.get("callSetupTimeout")) # Retrieve valid bench name for 2G capability self._bench_name = get_nw_sim_bench_name("2G", global_config, self._logger) # Read NETWORK_SIMULATOR from BenchConfig.xml self._ns_node = \ global_config.benchConfig.get_parameters(self._bench_name) self._band_name = self._tc_parameters.get_param_value("CELL_BAND") # Read BCH_ARFCN from test case xml file self._bch_arfcn = int(self._tc_parameters.get_param_value("BCH_ARFCN")) # Read TCH_ARFCN from test case xml file self._tch_arfcn = int(self._tc_parameters.get_param_value("TCH_ARFCN")) # Read CELL_SERVICE from test case xml file self._cell_service = \ self._tc_parameters.get_param_value("CELL_SERVICE") # Read CELL_POWER from test case xml file self._cell_power = \ int(self._tc_parameters.get_param_value("CELL_POWER")) # Read VOICE_CODER_RATE from test case xml file self._voice_coder_rate = \ self._tc_parameters.get_param_value("VOICE_CODER_RATE") # Read RT_TIME from test case xml file self._rt_time = int(self._tc_parameters.get_param_value("RT_TIME")) # Read RT_NAME from test case xml file self._rt_name = self._tc_parameters.get_param_value("RT_NAME") # Read AUDIO_OUTPUT from test case xml file self._audio_output = str( self._tc_parameters.get_param_value("AUDIO_OUTPUT")).lower() # Read VIBRA_MODE from test case xml file self._vibra_mode = str( self._tc_parameters.get_param_value("VIBRA_MODE")).lower() # Read SILENT_MODE from test case xml file self._silent_enable = str( self._tc_parameters.get_param_value("SILENT_MODE")).lower() # store original silent mode and vibrate mode and audio output self._original_silent_vibrate = None self._origianl_audio_output = None # Create cellular network simulator and retrieve 2G voice call interface self._ns = self._em.get_cellular_network_simulator(self._bench_name) self._ns_cell_2g = self._ns.get_cell_2g() self._ns_voice_call_2g = self._ns_cell_2g.get_voice_call() self._ns_data_2g = self._ns_cell_2g.get_data() # Instantiate generic UECmd for voiceCall Ucs self._modem_api = self._device.get_uecmd("Modem") self._voicecall_api = self._device.get_uecmd("VoiceCall") self._audio_recorder_api = self._device.get_uecmd("AudioRecorderHost") self._phonesystem_api = self._device.get_uecmd("PhoneSystem") self._networking_api = self._device.get_uecmd("Networking")
def __init__(self, tc_name, global_config): """ Constructor """ # Call UseCase base Init function UseCaseBase.__init__(self, tc_name, global_config) # Read registrationTimeout from Device_Catalog.xml self._registration_timeout = \ int(self._dut_config.get("registrationTimeout")) # Read CELLULAR_NETWORK parameters from BenchConfig.xml 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") # Read callSetupTimeout from Device_Catalog.xml self._call_setup_time = \ int(self._dut_config.get("callSetupTimeout")) # Retrieve valid bench name for 2G capability self._bench_name = get_nw_sim_bench_name("2G", global_config, self._logger) # Read NETWORK_SIMULATOR from BenchConfig.xml self._ns_node = \ global_config.benchConfig.get_parameters(self._bench_name) self._band_name = self._tc_parameters.get_param_value("CELL_BAND") # Read BCH_ARFCN from test case xml file self._bch_arfcn = int(self._tc_parameters.get_param_value("BCH_ARFCN")) # Read TCH_ARFCN from test case xml file self._tch_arfcn = int(self._tc_parameters.get_param_value("TCH_ARFCN")) # Read CELL_SERVICE from test case xml file self._cell_service = \ self._tc_parameters.get_param_value("CELL_SERVICE") # Read CELL_POWER from test case xml file self._cell_power = \ int(self._tc_parameters.get_param_value("CELL_POWER")) # Read VOICE_CODER_RATE from test case xml file self._voice_coder_rate = \ self._tc_parameters.get_param_value("VOICE_CODER_RATE") # Read CALL_DURATION from test case xml file self._call_duration = \ int(self._tc_parameters.get_param_value("CALL_DURATION")) # Read Mobile Country Code (MCC) from test case xml file self._mcc = \ int(self._tc_parameters.get_param_value("MCC")) # Read Mobile Network Code (MNC) from test case xml file self._mnc = \ int(self._tc_parameters.get_param_value("MNC")) # Create cellular network simulator and retrieve 2G voice call interface self._ns = self._em.get_cellular_network_simulator(self._bench_name) self._ns_cell_2g = self._ns.get_cell_2g() self._ns_voice_call_2g = self._ns_cell_2g.get_voice_call() self._ns_data_2g = self._ns_cell_2g.get_data() # Instantiate generic UECmd for voiceCall Ucs self._modem_api = self._device.get_uecmd("Modem") self._voicecall_api = self._device.get_uecmd("VoiceCall") self._networking_api = self._device.get_uecmd("Networking") # init wanted registration parameters to a value that # will make the uecmd that used it to raise an error self._wanted_reg_state = "None"
def __init__(self, tc_name, global_config): """ Constructor """ UseCaseBase.__init__(self, tc_name, global_config) # Get TC parameters self._registration_timeout = \ int(self._dut_config.get("registrationTimeout")) # Read maxDlHspaRab from DeviceCatalog.xml max_dl_hspa_rab = \ str(self._dut_config.get("maxDlHspaRab")) # Read maxUlHspaRab from DeviceCatalog.xml max_ul_hspa_rab = \ str(self._dut_config.get("maxUlHspaRab")) # Get FTP server parameters self._server = \ global_config.benchConfig.get_parameters("LAB_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 = "" # Initialize the server ipv6 address to None. self._server_ip_v6_address = None # 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") # Get Network configuration 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") # Retrieve valid bench name for 3G capability self._bench_name = get_nw_sim_bench_name("3G", global_config, self._logger) # bench_name should be either NETWORK_SIMULATOR1 or NETWORK_SIMULATOR2 # In both cases, we need to retrieve the NS number (position in the bench config, either 1 or 2) self._ns_number = int(self._bench_name[-1]) # Read NETWORK_SIMULATOR from BenchConfig.xml self._ns_node = \ global_config.benchConfig.get_parameters(self._bench_name) # Retrieve the model of the equipment self._ns_model = self._ns_node.get_param_value("Model") self._ns_IP_Lan1 = self._ns_node.get_param_value("IP_Lan1") self._ns_IP_Lan2 = self._ns_node.get_param_value("IP_Lan2") self._ns_DUT_IP_Address = \ self._ns_node.get_param_value("DUT_IP_Address") self._ns_DUT_IP_Address2 = \ self._ns_node.get_param_value("DUT_IP_Address2", "") self._ns_DNS1 = self._ns_node.get_param_value("DNS1") self._ns_DNS2 = self._ns_node.get_param_value("DNS2") self._ns_Subnet_Mask = \ self._ns_node.get_param_value("Subnet_Mask") self._ns_Default_Gateway = \ self._ns_node.get_param_value("Default_Gateway") self._ns_fast_dormancy = \ self._ns_node.get_param_value("Fast_Dormancy", "disable") # Read the xml Template self._band = str(self._tc_parameters.get_param_value("CELL_BAND")) self._dl_uarfcn = int(self._tc_parameters.get_param_value("DL_UARFCN")) # NS_CELL_REL self._ns_cell_rel = 7 self._cell_power = \ int(self._tc_parameters.get_param_value("CELL_POWER")) self._cell_service = \ str(self._tc_parameters.get_param_value("CELL_SERVICE")) # Read the PDP_ACTIVATION value from UseCase xml Parameter (True or False) self._pdp_activation = \ self._tc_parameters.get_param_value("PDP_ACTIVATION", "TRUE") self._cqi_scheme = \ str(self._tc_parameters.get_param_value("CQI_SCHEME")) self._mac_d_pdu_size = \ str(self._tc_parameters.get_param_value("MAC_D_PDU_SIZE")) # Read the DIRECTION value from UseCase xml Parameter self._direction = self._tc_parameters.get_param_value("DIRECTION") self._ip_version = self._tc_parameters.get_param_value( "IP_VERSION", "IPV4") self._kpi_test = self._tc_parameters.get_param_value( "KPI_TEST", False, "str_to_bool") # Read the UL_RAB value from UseCase xml Parameter # Check if this value is set to MAX or not ul_rab_config = str(self._tc_parameters.get_param_value("UL_RAB")) if ul_rab_config != "" or ul_rab_config != "None": if ul_rab_config == "MAX": self._ul_rab = max_ul_hspa_rab else: self._ul_rab = ul_rab_config else: self._logger.info( "Unknown UL RAB Configuration %s has been chosen" % ul_rab_config) # Read the DL_RAB value from UseCase xml Parameter # Check if this value is set to MAX or not dl_rab_config = str(self._tc_parameters.get_param_value("DL_RAB")) if dl_rab_config != "" or dl_rab_config != "None": if dl_rab_config == "MAX": self._dl_rab = max_dl_hspa_rab else: self._dl_rab = dl_rab_config else: self._logger.info( "Unkown UL RAB Configuration %s has been chosen" % dl_rab_config) # Get the HSDPA category (only if user # wants to use HSDPA. if self._dl_rab is not None: # 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 = int(self._ul_rab[9:]) self._logger.debug("HSUPA CAT: " + str(self._hsupa_cat)) else: self._hsupa_cat = None self._cpc_tti_value = str(self._tc_parameters.get_param_value("CPC")) # Get the CPC parameters (only if user wants to use CPC feature) . if self._cpc_tti_value.strip().isdigit(): self._cpc_tti_value = int(self._cpc_tti_value) if self._cpc_tti_value != 2 and self._cpc_tti_value != 10: self._cpc_tti_value = None self._logger.warning( "Wrong CPC parameter : %s ; Value should be 2 or 10 " % self._cpc_tti_value) else: self._cpc_tti_value = None # Initialize further parameters self._rbt_channel_type = "HSPA" self._ps_data_ergch_information_state = None self._cqi = None self._tti = None self._throughput_targets = None self._rrc_inactivity_timer = None # Get the HSUPA MS reported category (only if user # wants to use HSUPA. if self._ul_rab.find("HSUPA_CAT") != -1: ul_rab = None else: ul_rab = self._ul_rab # Read the throughput targets hsupa_cat = self._hsupa_cat # If TC use CPC with a TTI of 10ms and UL category is CAT6 # Max throughput is 2Mbps in this case so get category 5 max throughput # CAT5 has a TTI=10ms if self._cpc_tti_value is not None: if self._cpc_tti_value == 10 and hsupa_cat == 6: hsupa_cat = 5 (self._throughput_targets, self._cqi, self._tti) = \ TelephonyConfigsParser("Throughput_Targets").\ parse_hspa_theoretical_targets(self._hsdpa_cat, hsupa_cat, ul_rab) # Get UECmdLayer for Data Use Cases self._networking_api = self._device.get_uecmd("Networking") self._modem_api = self._device.get_uecmd("Modem") self._phone_system = self._device.get_uecmd("PhoneSystem") # Create cellular network simulator and retrieve 3G data API self._ns = self._em.get_cellular_network_simulator(self._bench_name) self._ns_cell_3g = self._ns.get_cell_3g() self._ns_data_3g = self._ns_cell_3g.get_data()
def __init__(self, tc_name, global_config): """ Constructor """ UseCaseBase.__init__(self, tc_name, global_config) # Get TC parameters self._registration_timeout = \ int(self._dut_config.get("registrationTimeout")) # Read maxDlWcdmaRab from DeviceCatalog.xml max_dl_wcdma_rab = \ str(self._dut_config.get("maxDlWcdmaRab")) # Read maxUlWcdmaRab from DeviceCatalog.xml max_ul_wcdma_rab = \ str(self._dut_config.get("maxUlWcdmaRab")) # Get FTP server parameters self._server = \ global_config.benchConfig.get_parameters("LAB_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 = "" # Initialize the server ipv6 address to None. self._server_ip_v6_address = None # 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") # Get Network configuration 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") # Retrieve valid bench name for 3G capability self._bench_name = get_nw_sim_bench_name("3G", global_config, self._logger) # bench_name should be either NETWORK_SIMULATOR1 or NETWORK_SIMULATOR2 # In both cases, we need to retrieve the NS number (position in the bench config, either 1 or 2) self._ns_number = int(self._bench_name[-1]) # Read NETWORK_SIMULATOR from BenchConfig.xml self._ns_node = \ global_config.benchConfig.get_parameters(self._bench_name) # Retrieve the model of the equipment self._ns_model = self._ns_node.get_param_value("Model") self._ns_IP_Lan1 = self._ns_node.get_param_value("IP_Lan1") self._ns_IP_Lan2 = self._ns_node.get_param_value("IP_Lan2") self._ns_DUT_IP_Address = \ self._ns_node.get_param_value("DUT_IP_Address") self._ns_DUT_IP_Address2 = \ self._ns_node.get_param_value("DUT_IP_Address2", "") self._ns_DNS1 = self._ns_node.get_param_value("DNS1") self._ns_DNS2 = self._ns_node.get_param_value("DNS2") self._ns_Subnet_Mask = \ self._ns_node.get_param_value("Subnet_Mask") self._ns_Default_Gateway = \ self._ns_node.get_param_value("Default_Gateway") self._ns_fast_dormancy = \ self._ns_node.get_param_value("Fast_Dormancy", "disable") # Read the xml Template self._band = self._tc_parameters.get_param_value("CELL_BAND") self._dl_uarfcn = int(self._tc_parameters.get_param_value("DL_UARFCN")) # NS_CELL_REL self._ns_cell_rel = 7 self._cell_power = \ int(self._tc_parameters.get_param_value("CELL_POWER")) self._cell_service = self._tc_parameters.get_param_value( "CELL_SERVICE") # Read the DIRECTION value from UseCase xml Parameter self._direction = self._tc_parameters.get_param_value("DIRECTION") self._ip_version = self._tc_parameters.get_param_value( "IP_VERSION", "IPV4") # Read the UL_RAB value from UseCase xml Parameter # Check if this value is set to MAX or not ul_rab_config = str(self._tc_parameters.get_param_value("UL_RAB")) if ul_rab_config != "" or ul_rab_config != "None": if ul_rab_config == "MAX": self._ul_rab = max_ul_wcdma_rab else: self._ul_rab = ul_rab_config else: self._logger.info( "Unkown UL RAB Configuration %s has been chosen" % ul_rab_config) # Read the DL_RAB value from UseCase xml Parameter # Check if this value is set to MAX or not dl_rab_config = str(self._tc_parameters.get_param_value("DL_RAB")) if dl_rab_config != "" or dl_rab_config != "None": if dl_rab_config == "MAX": self._dl_rab = max_dl_wcdma_rab else: self._dl_rab = dl_rab_config else: self._logger.info( "Unkown UL RAB Configuration %s has been chosen" % dl_rab_config) # Read Home Public Land Mobile Network (HPLMN) Coverage # from test case xml file and accept all the different # written for True and False values self._hplmn_coverage = \ self._tc_parameters.get_param_value("HPLMN_COVERAGE", "True") # Read Mobile Country Code (MCC) from test case xml file self._mcc = \ int(self._tc_parameters.get_param_value("MCC", "1")) # Read Mobile Network Code (MNC) from test case xml file self._mnc = \ int(self._tc_parameters.get_param_value("MNC", "1")) # Get UECmdLayer for Data Use Cases self._networking_api = self._device.get_uecmd("Networking") self._modem_api = self._device.get_uecmd("Modem") # Create cellular network simulator and retrieve 3G data API self._ns = self._em.get_cellular_network_simulator(self._bench_name) self._ns_cell_3g = self._ns.get_cell_3g() self._ns_data_3g = self._ns_cell_3g.get_data() # Read the throughput targets self._throughput_targets = TelephonyConfigsParser("Throughput_Targets").\ parse_wcdma_theoretical_targets(self._dl_rab, self._ul_rab) # init wanted registration parameters self._wanted_reg_state = "None"
def __init__(self, tc_name, global_config): """ Constructor """ # Call UseCase base Init function UseCaseBase.__init__(self, tc_name, global_config) # Read registrationTimeout from Device_Catalog.xml self._registration_timeout = \ int(self._dut_config.get("registrationTimeout")) # Read CELLULAR_NETWORK parameters from BenchConfig.xml 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") # Retrieve valid bench name for 3G capability self._bench_name = get_nw_sim_bench_name("3G", global_config, self._logger) # bench_name should be either NETWORK_SIMULATOR1 or NETWORK_SIMULATOR2 # In both cases, we need to retrieve the NS number (position in the bench config, either 1 or 2) self._ns_number = int(self._bench_name[-1]) # Read NETWORK_SIMULATOR from BenchConfig.xml self._ns_node = \ global_config.benchConfig.get_parameters(self._bench_name) # Retrieve the model of the equipment self._ns_model = self._ns_node.get_param_value("Model") # Read BAND from xml UseCase parameter file self._band = self._tc_parameters.get_param_value("CELL_BAND") # NS_CELL_REL self._ns_cell_rel = 7 # Read CELL_POWER from xml UseCase parameter file self._cell_power = \ int(self._tc_parameters.get_param_value("CELL_POWER")) # Read DL_UARFCN from xml UseCase parameter file self._dl_uarfcn = \ int(self._tc_parameters.get_param_value("DL_UARFCN")) # Read DATA_CODING_SCHEME from xml UseCase parameter file self._data_coding_sheme = \ self._tc_parameters.get_param_value("DATA_CODING_SCHEME") # Read SMS_TEXT from xml UseCase parameter file self._sms_text = self._tc_parameters.get_param_value("SMS_TEXT") # Read SMS_TRANSFER_TIMEOUT from xml UseCase parameter file self._sms_transfer_timeout = \ int(self._tc_parameters.get_param_value("SMS_TRANSFER_TIMEOUT")) 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") # Instantiate Modem UECmd for checking phone registration self._modem_api = self._device.get_uecmd("Modem") # Instantiate generic UECmd for camp self._networking_api = self._device.get_uecmd("Networking") # Create cellular network simulator and retrieve 3G mesaging # and 3G data interfaces self._ns = self._em.get_cellular_network_simulator(self._bench_name) self._ns_cell_3g = self._ns.get_cell_3g() self._ns_messaging_3g = self._ns_cell_3g.get_messaging() self._ns_data_3g = self._ns_cell_3g.get_data()
def __init__(self, tc_name, global_config): # Call UseCaseBase init function. UseCaseBase.__init__(self, tc_name, global_config) # init following variable with it's default value: self._wanted_reg_state = "registered" # Read the configuration from test case self._registration_timeout = \ int(self._dut_config.get("registrationTimeout")) # Read MMS APN parameters from BenchConfig.xml to use NowSMS Server self._mms_apn = \ global_config.benchConfig.get_parameters("NOWSMS_SERVER") self._apn_ssid = self._mms_apn.get_param_value("SSID") self._apn_name = self._mms_apn.get_param_value("APN") self._apn_user = self._mms_apn.get_param_value("username") self._apn_password = self._mms_apn.get_param_value("password") self._apn_ip_address = self._mms_apn.get_param_value("IP") self._apn_port = self._mms_apn.get_param_value("APN_PORT") self._destination_number = self._mms_apn.get_param_value( "MMS_DESTINATION_NUMBER", "") # Compose the mmsc value using Now Sms Server URL, APN_PORT, APN_USER, APN_PASSWORD self._apn_mmsc = self._apn_ip_address + ":" + self._apn_port + "/" + self._apn_user + "=" + self._apn_password # Set apn type to "default,mms" according to UC definition (test of MO / MT MMS) self._apn_type = "default,mms" # Get NowSMS Server port self._nowsms_port = self._mms_apn.get_param_value("PORT") # Compose the complete NowSms Server URL with the connection port self._nowsms_url = self._apn_ip_address + ":" + self._nowsms_port # Get NOWSMS user name self._user_name = self._tc_parameters.get_param_value( "NOWSMS_USER_NAME") # Get NOWSMS user password self._user_password = self._tc_parameters.get_param_value( "NOWSMS_USER_PASSWORD") # Read NS_CELL_TECH from test case xml file self._cell_tech = \ str(self._tc_parameters.get_param_value("CELL_TECH", "3G")) # Read CELL_BAND from xml UseCase parameter file self._cell_band = self._tc_parameters.get_param_value("CELL_BAND") # NS_CELL_REL self._ns_cell_rel = 7 # Read CELL_SERVICE from test case xml file self._cell_service = \ str(self._tc_parameters.get_param_value("CELL_SERVICE")) # Read CELL_POWER from xml UseCase parameter file self._cell_power = \ int(self._tc_parameters.get_param_value("CELL_POWER")) # Read the DL_ARFCN value from UseCase xml Parameter self._arfcn = \ int(self._tc_parameters.get_param_value("ARFCN")) # Read the CELL_LAC value from UseCase xml Parameter self._lac = int(self._tc_parameters.get_param_value("LAC")) if self._lac is None: self._lac = 10 # Read the CELL_RAC value from UseCase xml Parameter self._rac = int(self._tc_parameters.get_param_value("RAC")) if self._rac is None: self._rac = 20 # Read the CELL_MCC value from UseCase xml Parameter self._mcc = int(self._tc_parameters.get_param_value("MCC")) if self._mcc is None: self._mcc = 1 # Read the CELL_MNC value from UseCase xml Parameter self._mnc = int(self._tc_parameters.get_param_value("MNC")) if self._mnc is None: self._mnc = 1 # Read optional MOVE_OUT_OF_COVERAGE parameter from UseCase xml Parameter self._move_out_of_coverage = self._tc_parameters.get_param_value( "MOVE_OUT_OF_COVERAGE", 0, int) if self._move_out_of_coverage != 1 and self._move_out_of_coverage != 2: self._move_out_of_coverage = 0 # Read optional OUT_OF_COVERAGE_TIMER parameter from UseCase xml Parameter self._out_of_coverage_timer = self._tc_parameters.get_param_value( "OUT_OF_COVERAGE_TIMER", 0, int) # Retrieve valid bench name for capability self._bench_name = get_nw_sim_bench_name(self._cell_tech, global_config, self._logger) # bench_name should be either NETWORK_SIMULATOR1 or NETWORK_SIMULATOR2 # In both cases, we need to retrieve the NS number (position in the bench config, either 1 or 2) self._ns_number = int(self._bench_name[-1]) # Read NETWORK_SIMULATOR from BenchConfig.xml self._ns_node = \ global_config.benchConfig.get_parameters(self._bench_name) # Create cellular network simulator self._em = EM() self._ns = self._em.get_cellular_network_simulator(self._bench_name) # Retrieve the model of the equipment self._ns_model = self._ns_node.get_param_value("Model") # Retrieve the model IP addresses ns_ips = NetworkSimulatorIP(self._logger) ns_ips.setup_config(global_config, self._ns_number) (self._ns_ip_lan1, self._ns_ip_lan2, self._ns_dut_ip_address, self._ns_dut_ip_address2, self._ns_dns1, self._ns_dns2, self._ns_subnet_mask, self._ns_default_gateway) = ns_ips.get_config() # Instantiate UECmd API self._modem_api = self._device.get_uecmd("Modem") self._phonesystem_api = self._device.get_uecmd("PhoneSystem") self._networking_api = self._device.get_uecmd("Networking") self._mms_messaging = self._device.get_uecmd("MmsMessaging")
def __init__(self, tc_name, global_config): # Call UseCaseBase init function. UseCaseBase.__init__(self, tc_name, global_config) # Get TC parameters self._registration_timeout = \ int(self._dut_config.get("registrationTimeout")) # Read NS_CELL_TECH from test case xml file self._ns_cell_tech = \ str(self._tc_parameters.get_param_value("CELL_TECH")) self._ns_cell_generation = self._ns_cell_tech if self._ns_cell_tech in ["3G", "HSPA"]: self._ns_cell_generation = "3G" # Read CELL_BAND from xml UseCase parameter file self._ns_cell_band = self._tc_parameters.get_param_value("CELL_BAND") # NS_CELL_REL self._ns_cell_rel = 7 # Read CELL_SERVICE from test case xml file self._ns_cell_service = \ str(self._tc_parameters.get_param_value("CELL_SERVICE")) # Read CELL_POWER from xml UseCase parameter file self._ns_cell_power = \ int(self._tc_parameters.get_param_value("CELL_POWER")) # Read the DARFCN value from UseCase xml Parameter self._ns_arfcn = \ int(self._tc_parameters.get_param_value("ARFCN")) self._cpc_tti_value = str( self._tc_parameters.get_param_value("CPC", "")) # Get the CPC parameters (only if user wants to use CPC feature) . if self._cpc_tti_value.strip().isdigit(): self._cpc_tti_value = int(self._cpc_tti_value) if self._cpc_tti_value != 2 and self._cpc_tti_value != 10: self._cpc_tti_value = None self._logger.warning( "Wrong CPC parameter : %s ; Value should be 2 or 10 " % self._cpc_tti_value) else: self._cpc_tti_value = None # Get Network configuration self._network = \ global_config.benchConfig.get_parameters("CELLULAR_NETWORK") self._apn_name = self._network.get_param_value("APN") self._apn_ssid = self._network.get_param_value("SSID") # Retrieve valid bench name for 3G capability self._bench_name = get_nw_sim_bench_name(self._ns_cell_generation, global_config, self._logger) # bench_name should be either NETWORK_SIMULATOR1 or NETWORK_SIMULATOR2 # In both cases, we need to retrieve the NS number (position in the bench config, either 1 or 2) self._ns_number = int(self._bench_name[-1]) # Read NETWORK_SIMULATOR from BenchConfig.xml self._ns_node = \ global_config.benchConfig.get_parameters(self._bench_name) # Retrieve the model of the equipment self._ns_model = self._ns_node.get_param_value("Model") # Retrieve the model IP addresses ns_ips = NetworkSimulatorIP(self._logger) ns_ips.setup_config(global_config, self._ns_number) (self._ns_ip_lan1, self._ns_ip_lan2, self._ns_ip_dut, self._ns_ip_dut2, self._ns_ip_dns1, self._ns_ip_dns2, self._ns_ip_subnet_mask, self._ns_ip_default_gateway) = ns_ips.get_config() # Get UECmdLayer for Data Use Cases self._modem_api = self._device.get_uecmd("Modem") self._phonesystem_api = self._device.get_uecmd("PhoneSystem") self._networking_api = self._device.get_uecmd("Networking") # Create cellular network simulator and retrieve 3G data API self._ns = self._em.get_cellular_network_simulator(self._bench_name) # Get server parameters self._server = \ global_config.benchConfig.get_parameters("LAB_SERVER") self._server_ip_address = self._server.get_param_value("IP") # Set the default duration of waiting after changing pdp context self._sleep_duration = 2 # Set the default duration of ping checking self._ping_check_duration = 10
def __init__(self, tc_name, global_config): """ Constructor """ UseCaseBase.__init__(self, tc_name, global_config) self._ftp_task_id = 0 self._ftp_filename = None self._ftp_direction = None # Read registrationTimeout from DeviceCatalog.xml self._registration_timeout = \ int(self._dut_config.get("registrationTimeout")) # Read callSetupTimeout from Device_Catalog.xml self._call_setup_timeout = \ int(self._dut_config.get("callSetupTimeout")) # Read the LAB_SERVER parameters from BenchConfig.xml self._server = \ global_config.benchConfig.get_parameters("LAB_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 = "" # Read ftp DIRECTION from testcase xml parameters self._direction = self._tc_parameters.get_param_value("DIRECTION") # 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")) # Read CELLULAR_NETWORK parameters from BenchConfig.xml 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") # Retrieve valid bench name for 2G capability self._bench_name = get_nw_sim_bench_name("2G", global_config, self._logger) # Read NETWORK_SIMULATOR from BenchConfig.xml self._ns_node = \ global_config.benchConfig.get_parameters(self._bench_name) self._ns_IP_Lan1 = self._ns_node.get_param_value("IP_Lan1") self._ns_IP_Lan2 = \ self._ns_node.get_param_value("IP_Lan2") self._ns_DUT_IP_Address = \ self._ns_node.get_param_value("DUT_IP_Address") self._ns_DNS1 = self._ns_node.get_param_value("DNS1") self._ns_DNS2 = self._ns_node.get_param_value("DNS2") self._ns_Subnet_Mask = \ self._ns_node.get_param_value("Subnet_Mask") self._ns_Default_Gateway = \ self._ns_node.get_param_value("Default_Gateway") # Read the xml Template self._band_name = self._tc_parameters.get_param_value("CELL_BAND") self._bch_arfcn = int(self._tc_parameters.get_param_value("BCH_ARFCN")) self._pdtch_arfcn = \ int(self._tc_parameters.get_param_value("PDTCH_ARFCN")) self._cell_power = \ int(self._tc_parameters.get_param_value("CELL_POWER")) self._multislot = \ self._tc_parameters.get_param_value("MULTISLOT_CONFIG") self._ul_mcs = self._tc_parameters.get_param_value("UL_MCS") self._dl_mcs = self._tc_parameters.get_param_value("DL_MCS") self._ps_mcs = self._tc_parameters.get_param_value("PS_MCS") # Get UECmdLayer for Data and Voice call Use Cases self._networking_api = self._device.get_uecmd("Networking") self._modem_api = self._device.get_uecmd("Modem") self._voicecall_api = self._device.get_uecmd("VoiceCall") # set VOICE CODER RATE to FR_AMR_NB_1220 self._voice_coder_rate = "FR_AMR_NB_1220" # Read CALL_DURATION from test case xml file self._call_duration = \ int(self._tc_parameters.get_param_value("CALL_DURATION")) # Create cellular network simulator and retrieve 2G data interface self._ns = self._em.get_cellular_network_simulator(self._bench_name) # Shortcut to get Cell 2G parameters self._ns_cell_2g = self._ns.get_cell_2g() self._ns_data_2g = self._ns_cell_2g.get_data() self._ns_voice_call_2g = self._ns_cell_2g.get_voice_call()