def set_up(self): """ Set up the test configuration """ # Call UseCase base Setup function UseCaseBase.set_up(self) # Ensure flight mode off so that GSM sim operator info can be retrieved self._networking_api.set_flight_mode("off") time.sleep(self._wait_btwn_cmd) # Determinates the kind of registration state to wait # by comparing test case MCC/MNC parameters to sim MCC/MNC sim_info = self._modem_api.get_sim_operator_info() if sim_info["MCC"] != self._mcc or\ sim_info["MNC"] != self._mnc: self._wanted_reg_state = "roaming" else: self._wanted_reg_state = "registered" # Clear all data connections self._networking_api.clean_all_data_connections() time.sleep(self._wait_btwn_cmd) if self._switch_mode == "airplane": # Switch off according to the mode chosen self.phoneonoff_util.switch_off(self._switch_mode) # Initialize cellular network simulator self._ns.init() # Set the equipment application format WCDMA self._ns.switch_app_format("WCDMA") # Perform a full preset self._ns.perform_full_preset() # Set Cell off self._ns_cell_3g.set_cell_off() # 3G default cell setup RegUtil.setup_cell(self._ns_number, self._ns_model, "3G", self._band, self._ns_cell_rel, self._logger) # Set Cell Band and ARFCN using 3GSM_CELL_BAND # and 3GSM_ARFCN parameters # Set cell service using 3GSM_CELL_SERVICE parameter # Set Cell Power using 3GSM_CELL_POWER parameter # Set Cell LAC using 3GSM_LAC_VALUE parameter # Set Cell RAC using 3GSM_RAC_VALUE parameter self._ns_cell_3g.configure_basic_cell_parameters( self._cell_service, self._band, self._dl_uarfcn, self._cell_power, 1, 1, self._mcc, self._mnc) # Set Frequency points using frequency list # Set Amplitude Offset correction using offset list # Turning amplitude offset state to ON self._ns.configure_amplitude_offset_table() # Set Cell Band UARFCN (uplink) in auto mode self._ns_cell_3g.set_uplink_channel_mode("ON") # Set SRB Configuration Control to auto self._ns_cell_3g.set_srb_config_control("ON") # Deactivate HSUPA and HSDPA capabilities self._ns_data_3g.set_edch_cell_capability("OFF") self._ns_data_3g.set_hsdpa_cell_capability("OFF") self._modem_api.check_cdk_no_registration_bfor_timeout( self._registration_timeout) # Set Cell on self._ns_cell_3g.set_cell_on() return Global.SUCCESS, "No errors"
def set_up(self): """ Initialize the test """ # Call UseCase base set_up function UseCaseBase.set_up(self) # Ensure flight mode off so that GSM sim operator info can be retrieved self._networking_api.set_flight_mode("on") time.sleep(self._wait_btwn_cmd) # Connect to equipment using GPIBBoardId and GPIBAddress parameters self._ns.init() # Set the equipment application format WCDMA self._ns.switch_app_format("WCDMA") # Perform a full preset self._ns.perform_full_preset() # Set Cell off self._ns_cell_3g.set_cell_off() # 3G default cell setup RegUtil.setup_cell(self._ns_number, self._ns_model, "3G", self._band, self._ns_cell_rel, self._logger) # Set Cell Band and ARFCN using 3GSM_CELL_BAND # and 3GSM_ARFCN parameters # Set cell service using 3GSM_CELL_SERVICE parameter # Set Cell Power using 3GSM_CELL_POWER parameter # Set Cell LAC using 3GSM_LAC_VALUE parameter # Set Cell RAC using 3GSM_RAC_VALUE parameter self._ns_cell_3g.configure_basic_cell_parameters( self._cell_service, self._band, self._dl_uarfcn, self._cell_power, 1, 1, self._mcc, self._mnc) # Set Frequency points using frequency list # Set Amplitude Offset correction using offset list # Turning amplitude offset state to ON self._ns.configure_amplitude_offset_table() # Set Cell Band UARFCN (uplink) in auto mode self._ns_cell_3g.set_uplink_channel_mode("ON") # Set Audio codec using VOICE_CODER_RATE parameter self._ns_voice_call_3g.set_audio_codec(self._voice_coder_rate) # Set SRB Configuration Control to auto self._ns_cell_3g.set_srb_config_control("ON") # Set Cell Power using CELL_POWER parameter self._ns_cell_3g.set_cell_power(self._cell_power) # Deactivate HSUPA and HSDPA capabilities self._ns_data_3g.set_edch_cell_capability("OFF") self._ns_data_3g.set_hsdpa_cell_capability("OFF") # Set Cell on self._ns_cell_3g.set_cell_on() # Ensure flight mode off so that GSM sim operator info can be retrieved self._networking_api.set_flight_mode("off") # Check registration state is connected using # registrationTimeout from Device_Catalog.xml self._modem_api.check_cdk_registration_bfor_timeout( self._registration_timeout) # Adapt attachment procedure to CIRCUIT or PACKET if "CIRCUIT" not in self._cell_service: # Set the APN time.sleep(self._wait_btwn_cmd) self._logger.info("Setting APN " + str(self._apn) + "...") self._networking_api.set_apn(self._ssid, self._apn) # Activate PDP context time.sleep(self._wait_btwn_cmd) self._logger.info("Active PDP Context...") self._networking_api.activate_pdp_context(self._ssid, check=False) # Check Data Connection State => PDP_ACTIVE before timeout RegUtil.check_dut_data_connection_state_before_timeout( "PDP_ACTIVE", self._ns_cell_3g, self._networking_api, self._logger, self._registration_timeout, flightmode_cycle=True, blocking=False) # Get RAT from Equipment network_type = self._ns_data_3g.get_network_type() # Check that DUT is registered on the good RAT self._modem_api.check_network_type_before_timeout( network_type, self._registration_timeout) return Global.SUCCESS, "No errors"
def set_up(self): """ Set up the test configuration """ # Call LabMobilityBase Setup function LabMobilityBase.set_up(self) if self._ns1_cell_tech == "2G": # Set the equipment application format depending on NS1_CELL_TECH. # If 2G switch to ""GSM/GPRS"" self._ns1.switch_app_format("GSM/GPRS") elif self._ns1_cell_tech == "3G": # Set the equipment application format depending on NS1_CELL_TECH. # If 3G switch to ""WCDMA"" self._ns1.switch_app_format("WCDMA") if self._ns2_cell_tech == "2G": # Set the equipment application format depending on NS2_CELL_TECH. # If 2G switch to ""GSM/GPRS"" self._ns2.switch_app_format("GSM/GPRS") elif self._ns2_cell_tech == "3G": # Set the equipment application format depending on NS2_CELL_TECH. # If 3G switch to ""WCDMA"" self._ns2.switch_app_format("WCDMA") # Ensure flight mode off so that GSM sim operator info can be retrieved self._networking_api.set_flight_mode("off") time.sleep(self._wait_btwn_cmd) if self._category != "GSM": # Read maxDlWcdmaRab, maxUlWcdmaRab, maxDlHspaRab, maxUlHspaRab from DeviceCatalog.xml if self._category == "WCDMA": max_dl_rab = str(self._dut_config.get("maxDlWcdmaRab")) max_ul_rab = str(self._dut_config.get("maxUlWcdmaRab")) elif self._category == "HSPA": max_dl_rab = str(self._dut_config.get("maxDlHspaRab")) max_ul_rab = str(self._dut_config.get("maxUlHspaRab")) # Read the UL_RAB value from UseCase xml Parameter # Check if this value is set to MAX or not ul_rab_config = self._tc_parameters.get_param_value("UL_RAB", "MAX") # Read the DL_RAB value from UseCase xml Parameter # Check if this value is set to MAX or not dl_rab_config = self._tc_parameters.get_param_value("DL_RAB", "MAX") if ul_rab_config == "MAX": self._ul_rab = max_ul_rab else: self._ul_rab = ul_rab_config if dl_rab_config == "MAX": self._dl_rab = max_dl_rab else: self._dl_rab = dl_rab_config if self._category == "HSPA": # Get the HSDPA category (only if user # wants to use HSDPA. if(self._dl_rab is not None) and self._category: # 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 = self._ul_rab[9:] self._logger.debug("HSUPA CAT: " + str(self._hsupa_cat)) else: self._hsupa_cat = None # Initialize further parameters self._rbt_channel_type = "HSPA" # Disable data and PDP context self._networking_api.deactivate_pdp_context() # Enable flight mode self._networking_api.set_flight_mode("on") # Perform full preset on NS1 cell self._ns1.perform_full_preset() # Perform full preset on NS2 cell self._ns2.perform_full_preset() # Set cell off for the 2 network simulators self._ns1_cell.set_cell_off() self._ns2_cell.set_cell_off() # Set IP addresses for the 2 network simulators self._ns1.set_ip_addresses(self._ns1_ip_lan1, self._ns1_ip_lan2, self._ns1_ip_subnet_mask, self._ns1_ip_default_gateway, self._ns1_ip_dut, self._ns1_ip_dns1, self._ns1_ip_dns2) self._ns2.set_ip_addresses(self._ns2_ip_lan1, self._ns2_ip_lan2, self._ns2_ip_subnet_mask, self._ns2_ip_default_gateway, self._ns2_ip_dut, self._ns2_ip_dns1, self._ns2_ip_dns2) self.set_external_connection(self._ns1, self._ns2, self._ns1_ip_lan2, self._ns2_ip_lan2) # Set Frequency points using frequency list # Set Amplitude Offset correction using offset list # Turning amplitude offset state to ON self._ns1.configure_amplitude_offset_table() # Set Frequency points using frequency list # Set Amplitude Offset correction using offset list # Turning amplitude offset state to ON self._ns2.configure_amplitude_offset_table() # If the fast dormancy parameter is set to disable do nothing to # avoid regressions. if self._ns1_fast_dormancy.lower() == "enable" and (self._ns1_cell_tech == "3G"): # Setting fast dormancy support according to the parameter # present in the bench config. self._ns1_data.\ set_fast_dormancy_support("enable") if self._ns2_fast_dormancy.lower() == "enable" and (self._ns2_cell_tech == "3G"): # Setting fast dormancy support according to the parameter # present in the bench config. self._ns2_data.\ set_fast_dormancy_support("enable") # Call specific configuration functions RegUtil.setup_cell(1, self._ns1_model, self._ns1_cell_tech, self._ns1_cell_band, self._ns1_cell_rel, self._logger) RegUtil.setup_cell(2, self._ns2_model, self._ns2_cell_tech, self._ns2_cell_band, self._ns2_cell_rel, self._logger) # Deactivate E-DCH Cell and HSDPA Cell capabilities # if cell tech is 3G if self._ns1_cell_tech == "3G": self._ns1_data.set_edch_cell_capability("OFF") self._ns1_data.set_hsdpa_cell_capability("OFF") # if cell tech is 2G else: # Set the multislot configuration self._ns1_data.set_multislot_config(self._multislot) if self._ns2_cell_tech == "3G": self._ns2_data.set_edch_cell_capability("OFF") self._ns2_data.set_hsdpa_cell_capability("OFF") # if cell tech is 2G else: # Set the multislot configuration self._ns2_data.set_multislot_config(self._multislot) return Global.SUCCESS, "No errors"
def set_up(self): """ Set up the test configuration """ # Call LabMobilityBase set_up function LabMobilityBase.set_up(self) # Ensure flight mode off so that GSM sim operator info can be retrieved self._networking_api.set_flight_mode("off") time.sleep(self._wait_btwn_cmd) # Determinates the kind of registration state to wait # by comparing test case MCC/MNC parameters to sim MCC/MNC sim_info = self._modem_api.get_sim_operator_info() if sim_info["MCC"] != self._ns_lte_mcc or \ sim_info["MNC"] != self._ns_lte_mnc: self._wanted_reg_state = "roaming" self._networking_api.set_roaming_mode("ON") else: self._wanted_reg_state = "registered" # Disable data and PDP context self._networking_api.deactivate_pdp_context() # Enable flight mode self._networking_api.set_flight_mode("on") # Set the Network Simulators APIs instances self._set_ns_apis_instances() # Set the equipment application format depending on ACTIVE_CELL_TECH. # If 4G switch to ""LTE FDD"" self._ns_lte.switch_app_format("LTE FDD") # Perform full preset on LTE cell self._ns_lte.perform_full_preset() # Perform full preset on 3GSM cell self._ns_3gsm.perform_full_preset() # Set EPC off, not for CMW500 because DAU starting is a long lasting time operation self._ns_lte_data.set_epc_off() # Set cell off on LTE cell self._ns_lte_cell.set_cell_off() # Set cell off self._ns_3gsm_cell.set_cell_off() # Set IP addresses for the 3GSM NS self._ns_3gsm.set_ip_addresses( self._ns_3gsm_ip_lan1, self._ns_3gsm_ip_lan2, self._ns_3gsm_ip_subnet_mask, self._ns_3gsm_ip_default_gateway, self._ns_3gsm_ip_dut, self._ns_3gsm_ip_dns1, self._ns_3gsm_ip_dns2) # Call specific configuration functions # Some parameters are defined by function RegUtil.setup_cell(self._ns_number, self._ns_model, self._ns_3gsm_cell_tech, self._ns_3gsm_cell_band, self._ns_3gsm_cell_rel, self._logger) # Set Cell Band and ARFCN using 3GSM_CELL_BAND # and 3GSM_ARFCN parameters # Set cell service using 3GSM_CELL_SERVICE parameter # Set Cell Power using 3GSM_CELL_POWER parameter # Set Cell LAC using 3GSM_LAC_VALUE parameter # Set Cell RAC using 3GSM_RAC_VALUE parameter self._ns_3gsm_cell.configure_basic_cell_parameters( self._ns_3gsm_cell_service, self._ns_3gsm_cell_band, self._ns_3gsm_dl_arfcn, self._ns_3gsm_cell_power, self._ns_3gsm_lac, self._ns_3gsm_rac) # set mcc and mnc of 3gsm network self._ns_3gsm_cell.set_mcc(self._ns_3gsm_mcc) self._ns_3gsm_cell.set_mnc(self._ns_3gsm_mnc) if self._ns_lte_duplex_type == "FDD": # Call specific configuration functions for LTE Cell RegUtil.setup_cell_lte( self._ns_lte, self._ns_lte_mcc, self._ns_lte_mnc, self._ns_lte_ip_dut, self._ns_lte_signal_mode, self._ns_lte_cell_id, self._ns_lte_physical_cell_id, self._ns_lte_mimo, self._ns_lte_cell_power_rf1, self._ns_lte_cell_power_rf2, self._ns_lte_scenario_path, self._ns_lte_cell_band, self._ns_lte_dl_earfcn, self._apn) elif self._ns_lte_duplex_type == "TDD": # Set the DUT IP address self._ns_lte_data.set_dut_ip_address(self._ns_dut_ip_Address) # Load LTE TDD optimal configuration self._ns_lte.load_cell_config("TDD_COMMON", self._ns_number) if hasattr(self, "_lte_tdd_config"): self._ns_lte.load_cell_config(self._lte_tdd_config, self._ns_number) if self._cell_band is not None: self._ns_lte_cell.set_cell_band(self._ns_lte_cell_band) self._ns_lte_cell.set_downlink_earfcn(self._ns_lte_dl_earfcn) # Set MIMO mode self._ns_cell_4g.set_lte_tdd_configuration(self._antennas_number, self._mimo) # Set EPC on self._ns_lte_data.set_epc_on() # Deactivate E-DCH Cell and HSDPA Cell capabilities # if 3GSM NS cell tech is 3G if self._ns_3gsm_cell_tech == "3G": self._ns_3gsm_data.set_edch_cell_capability("OFF") self._ns_3gsm_data.set_hsdpa_cell_capability("OFF") # if 3GSM NS cell tech is 2G else: # Set the multislot configuration self._ns_3gsm_data.set_multislot_config(self._multislot) return Global.SUCCESS, "No errors"
def set_up(self): """ Initialize the test """ UseCaseBase.set_up(self) # Clear all data connections self._networking_api.clean_all_data_connections() time.sleep(self._wait_btwn_cmd) # Activate the flight mode. self._networking_api.set_flight_mode("on") # Connect to equipment self._ns.init() # Set the equipment application format GSM/GPRS self._ns.switch_app_format("GSM/GPRS") time.sleep(self._wait_btwn_cmd) # Perform a full preset self._ns.perform_full_preset() # Set cell off self._ns_cell_2g.set_cell_off() # Set serving cell to EGPRS self._ns_cell_2g.set_cell_service("EGPRS") # Set Frequency points using frequency list # Set Amplitude Offset correction using offset list # Turning amplitude offset state to ON self._ns.configure_amplitude_offset_table() # Set the equipment IP address 1 self._ns.set_ip4_lan_address(self._ns_IP_Lan1) # Set the equipment IP_Lan2 to the equipment self._ns.set_ip4_lan_address2(self._ns_IP_Lan2) # Set the equipment subnet mask self._ns.set_ip4_subnet_mask(self._ns_Subnet_Mask) # Set the equipment default gateway self._ns.set_ip4_default_gateway(self._ns_Default_Gateway) # Set the DUT IP address 1 self._ns_data_2g.set_dut_ip_address(1, self._ns_DUT_IP_Address) # Set the DUT IP address 2 if not empty str. if self._ns_DUT_IP_Address2 != "": self._ns_data_2g.set_dut_ip_address(2, self._ns_DUT_IP_Address2) # Set the DUT DNS1 self._ns_data_2g.set_dut_primary_dns(self._ns_DNS1) # Set the DUT DNS2 self._ns_data_2g.set_dut_secondary_dns(self._ns_DNS2) # Call specific configuration functions # Some parameters are defined by function RegUtil.setup_cell(self._ns_number, self._ns_model, self.ns_cell_tech, self._band_name, self._ns_cell_rel, self._logger) # Set Cell Power using CELL_POWER parameter self._ns_cell_2g.set_cell_power(self._cell_power) # Set connection type to auto self._ns_data_2g.set_connection_type("AUTO") # Set the multislot configuration self._ns_data_2g.set_multislot_config(self._multislot) # Set the downlink and uplink Modulation Coding Schema # (DL_MCS and UL_MCS) self._ns_data_2g.set_pdtch_modulation_coding_scheme( self._dl_mcs, self._ul_mcs) # Set the Puncturing Modulation Coding Schema (PS_MCS) self._ns_data_2g.set_pdtch_puncturing_scheme(self._ps_mcs) # Set cell on self._ns_cell_2g.set_cell_on() self._modem_api.check_cdk_no_registration_bfor_timeout( self._registration_timeout) # Deactivate the flight mode. self._networking_api.set_flight_mode("off") # Check registration state is connected using # registrationTimeout from Device_Catalog.xml (Non blocking # for this test if function isn't implemented on CDK) self._modem_api.check_cdk_registration_bfor_timeout( self._registration_timeout) # Set the APN time.sleep(self._wait_btwn_cmd) self._logger.info("Setting APN " + str(self._apn) + "...") self._networking_api.set_apn(self._ssid, self._apn) # Activate PDP context time.sleep(self._wait_btwn_cmd) self._logger.info("Active PDP Context...") self._networking_api.activate_pdp_context(self._ssid, check=False) # Check Data Connection State => PDP Active before timeout self._ns_data_2g.check_data_connection_state( "PDP_ACTIVE", self._registration_timeout) # Get RAT from Equipment network_type = self._ns_data_2g.get_network_type() # Check that DUT is registered on the good RAT self._modem_api.check_network_type_before_timeout( network_type, self._registration_timeout) return Global.SUCCESS, "No errors"
def set_up(self): """ Initialize the test """ UseCaseBase.set_up(self) # Ensure flight mode off so that GSM sim operator info can be retrieved self._networking_api.set_flight_mode("off") time.sleep(self._wait_btwn_cmd) # Determinates the kind of registration state to wait # by comparing test case MCC/MNC parameters to sim MCC/MNC sim_info = self._modem_api.get_sim_operator_info() if sim_info["MCC"] != self._mcc or\ sim_info["MNC"] != self._mnc: self._wanted_reg_state = "roaming" self._networking_api.set_roaming_mode("ON") else: self._wanted_reg_state = "registered" # Clear all data connections self._networking_api.clean_all_data_connections() time.sleep(self._wait_btwn_cmd) # Activate the flight mode. self._networking_api.set_flight_mode("on") # Connect to equipment using GPIBAddress and GPIBBoardId self._ns.init() # Set the equipment application format WCDMA self._ns.switch_app_format("WCDMA") time.sleep(self._wait_btwn_cmd) # Perform a full preset self._ns.perform_full_preset() # Set cell off self._ns_cell_3g.set_cell_off() # Set IP addresses for the 3GSM NS self._ns.set_ip_addresses(self._ns_IP_Lan1, self._ns_IP_Lan2, self._ns_Subnet_Mask, self._ns_Default_Gateway, self._ns_DUT_IP_Address, self._ns_DNS1, self._ns_DNS2) if self._ip_version == "IPV6": # Setting the version of the first DUT IP to IPV6 self._ns_data_3g.set_dut_ip_version(1, "IP6") # Setting the IPv6 Prefix and IID self._ns_data_3g.set_ip6_network_parameters( self._server_ip_v6_address) # Setting the DUT IPv6 Prefix and IID self._ns_data_3g.set_dut_ip6_network_parameters( self._server_ip_v6_address) # Setting the Agilent to IPV6 router mode. self._ns.set_ipv6_router_mode("ON") elif self._ip_version == "IPV4V6": # Setting the version of the first DUT IP to IPV6 self._ns_data_3g.set_dut_ip_version(1, "DUAL") # Setting the IPv6 Prefix and IID self._ns_data_3g.set_ip6_network_parameters( self._server_ip_v6_address) # Setting the DUT IPv6 Prefix and IID self._ns_data_3g.set_dut_ip6_network_parameters( self._server_ip_v6_address) # Setting the Agilent to IPV6 router mode. self._ns.set_ipv6_router_mode("ON") # Set the DUT IP address 2 if not empty str. if self._ns_DUT_IP_Address2 != "": self._ns_data_3g.set_dut_ip_address(2, self._ns_DUT_IP_Address2) # 3G default cell setup RegUtil.setup_cell(self._ns_number, self._ns_model, "3G", self._band, self._ns_cell_rel, self._logger) # Set Cell Band and ARFCN using 3GSM_CELL_BAND # and 3GSM_ARFCN parameters # Set cell service using 3GSM_CELL_SERVICE parameter # Set Cell Power using 3GSM_CELL_POWER parameter # Set Cell LAC using 3GSM_LAC_VALUE parameter # Set Cell RAC using 3GSM_RAC_VALUE parameter self._ns_cell_3g.configure_basic_cell_parameters( self._cell_service, self._band, self._dl_uarfcn, self._cell_power, 1, 1, self._mcc, self._mnc) message = "Expected network registration state to be %s while " \ "HPMLN coverage is %s, MCCODE is %s and MNCODE is %s" % ( str(self._wanted_reg_state), str(self._hplmn_coverage), str(self._mcc), str(self._mnc)) self._logger.info(message) # Set BCH update page state to AUTO self._ns_cell_3g.set_bch_update_page_state("AUTO") # Set Frequency points using frequency list # Set Amplitude Offset correction using offset list # Turning amplitude offset state to ON self._ns.configure_amplitude_offset_table() # If the fast dormancy parameter is set to disable do nothing to # avoid regressions. if self._ns_fast_dormancy.lower() == "enable": # Setting fast dormancy support according to the parameter # present in the bench config. self._ns_data_3g.\ set_fast_dormancy_support("enable") # Set Uplink channel mode control to auto self._ns_cell_3g.set_uplink_channel_mode("ON") # Active SRB Configuration Control to AUTO self._ns_cell_3g.set_srb_config_control("ON") # Set the initial PS Data RRC State to DCH self._ns_data_3g.set_initial_ps_data_rrc_state("DCH") # Sets the GPRS Radio Access Bearer self._ns_data_3g.set_gprs_radio_access_bearer(self._ul_rab, self._dl_rab) # Deactivate HSUPA and HSDPA capabilities self._ns_data_3g.set_edch_cell_capability("OFF") self._ns_data_3g.set_hsdpa_cell_capability("OFF") # Phone has to see the cell off! self._modem_api.check_cdk_no_registration_bfor_timeout( self._registration_timeout) # Set cell on self._ns_cell_3g.set_cell_on() # Deactivate the flight mode. self._networking_api.set_flight_mode("off") # Check Data Connection State => ATTACHED before timeout self._ns_data_3g.check_data_connection_state( "ATTACHED", self._registration_timeout) # Check registration state is connected using # registrationTimeout from Device_Catalog.xml (Non blocking # for this test if function isn't implemented on CDK) self._modem_api.check_cdk_state_bfor_timeout( self._wanted_reg_state, self._registration_timeout) # Set the APN time.sleep(self._wait_btwn_cmd) if self._ip_version == "IPV6": self._logger.info("Setting APN " + str(self._apn) + " on " + str(self._ip_version) + "...") self._networking_api.set_apn(self._ssid, self._apn, None, None, self._ip_version) elif self._ip_version == "IPV4V6": self._logger.info("Setting APN " + str(self._apn) + " on " + str(self._ip_version) + "...") self._networking_api.set_apn(self._ssid, self._apn, None, None, self._ip_version) else: self._logger.info("Setting APN " + str(self._apn) + " on IPV4 ") self._networking_api.set_apn(self._ssid, self._apn) if self._wanted_reg_state == "registered": # Activate PDP context time.sleep(self._wait_btwn_cmd) self._logger.info("Active PDP Context...") self._networking_api.activate_pdp_context(self._ssid) # Check Data Connection State => PDP Active before timeout self._ns_data_3g.check_data_connection_state( "PDP_ACTIVE", self._registration_timeout, blocking=False) # Get RAT from Equipment network_type = self._ns_data_3g.get_network_type() # Check that DUT is registered on the good RAT self._modem_api.check_network_type_before_timeout( network_type, self._registration_timeout) return Global.SUCCESS, "No errors"
def set_up(self): """ Initialize the test """ UseCaseBase.set_up(self) # Clear all data connections self._networking_api.clean_all_data_connections() time.sleep(self._wait_btwn_cmd) # Activate the flight mode. self._networking_api.set_flight_mode("on") # Connect to equipment self._ns.init() # Set the equipment application format WCDMA self._ns.switch_app_format("WCDMA") time.sleep(self._wait_btwn_cmd) # Perform a full preset self._ns.perform_full_preset() # Set cell off self._ns_cell_3g.set_cell_off() # Set IP addresses for the 3GSM NS self._ns.set_ip_addresses(self._ns_IP_Lan1, self._ns_IP_Lan2, self._ns_Subnet_Mask, self._ns_Default_Gateway, self._ns_DUT_IP_Address, self._ns_DNS1, self._ns_DNS2) if self._ip_version == "IPV6": # Setting the version of the first DUT IP to IPV6 self._ns_data_3g.set_dut_ip_version(1, "IP6") # Setting the IPv6 Prefix and IID self._ns_data_3g.set_ip6_network_parameters( self._server_ip_v6_address) # Setting the DUT IPv6 Prefix and IID self._ns_data_3g.set_dut_ip6_network_parameters( self._server_ip_v6_address) # Setting the Agilent to IPV6 router mode. self._ns.set_ipv6_router_mode("ON") elif self._ip_version == "IPV4V6": # Setting the version of the first DUT IP to IPV6 self._ns_data_3g.set_dut_ip_version(1, "DUAL") # Setting the IPv6 Prefix and IID self._ns_data_3g.set_ip6_network_parameters( self._server_ip_v6_address) # Setting the DUT IPv6 Prefix and IID self._ns_data_3g.set_dut_ip6_network_parameters( self._server_ip_v6_address) # Setting the Agilent to IPV6 router mode. self._ns.set_ipv6_router_mode("ON") else: # Setting the version of the first DUT IP to IPV4 self._ns_data_3g.set_dut_ip_version(1, "IP4") # Setting the Agilent to IPV6 router mode. self._ns.set_ipv6_router_mode("OFF") # Set the DUT IP address 2 if not empty str. if self._ns_DUT_IP_Address2 != "": self._ns_data_3g.set_dut_ip_address(2, self._ns_DUT_IP_Address2) # 3G default cell setup RegUtil.setup_cell(self._ns_number, self._ns_model, "3G", self._band, self._ns_cell_rel, self._logger) # Set Cell Band and ARFCN using 3GSM_CELL_BAND # and 3GSM_ARFCN parameters # Set cell service using 3GSM_CELL_SERVICE parameter # Set Cell Power using 3GSM_CELL_POWER parameter # Set Cell LAC using 3GSM_LAC_VALUE parameter # Set Cell RAC using 3GSM_RAC_VALUE parameter self._ns_cell_3g.configure_basic_cell_parameters( self._cell_service, self._band, self._dl_uarfcn, self._cell_power) # Set BCH update page state to AUTO self._ns_cell_3g.set_bch_update_page_state("AUTO") # Set Frequency points using frequency list # Set Amplitude Offset correction using offset list # Turning amplitude offset state to ON self._ns.configure_amplitude_offset_table() # If the fast dormancy parameter is set to disable do nothing to # avoid regressions. if self._ns_fast_dormancy.lower() == "enable": # Setting fast dormancy support according to the parameter # present in the bench config. self._ns_data_3g.\ set_fast_dormancy_support("enable", self._rrc_inactivity_timer) # Set Uplink channel mode control to auto self._ns_cell_3g.set_uplink_channel_mode("ON") # Active SRB Configuration Control to AUTO self._ns_cell_3g.set_srb_config_control("ON") # Set the initial PS Data RRC State to DCH self._ns_data_3g.set_initial_ps_data_rrc_state("DCH") # Sets the GPRS Radio Access Bearer if self._ul_rab.find("HSUPA_CAT") != -1: self._ns_data_3g.set_gprs_radio_access_bearer("HSUPA", "HSDPA") else: self._ns_data_3g.set_gprs_radio_access_bearer( self._ul_rab, "HSDPA") # Set the category configuration to AUTO self._ns_data_3g.set_category_control_mode("ON") # Set channel type, the default value is "HSPA" self._ns_cell_3g.set_rbt_channel_type(self._rbt_channel_type) # Call specific configuration functions self._setup_high_categories(self._ns_number) # configure HS-DSCH config type (FIXED, REPORTED, USER_DEFINED) self._ns_data_3g.set_ps_data_configuration_type(self._cqi_scheme) if self._cqi_scheme == "FIXED": self._ns_data_3g.set_cqi_value(self._cqi) # Set the TTI value if self._tti: self._ns_data_3g.set_hsupa_tti(self._tti) # Call specific configuration functions self._setup_cpc_feature(self._ns_number) # Set Ps Data E-RGCH Information state to off # Only if this param is overridden in the UC # The default value is ON to transmit an E-RGCH from test set if self._ps_data_ergch_information_state == "OFF": self._ns_cell_3g.set_ps_data_ergch_information_state( self._ps_data_ergch_information_state) # Set PS Data HS-DSCH MAC-d PDU Size self._ns_data_3g.set_macd_pdu_size(self._mac_d_pdu_size) # Phone has to see the cell off! self._modem_api.check_cdk_no_registration_bfor_timeout( self._registration_timeout) # Set cell on self._ns_cell_3g.set_cell_on() # Deactivate the flight mode. self._networking_api.set_flight_mode("off") # Check Data Connection State => ATTACHED before timeout self._ns_data_3g.check_data_connection_state( "ATTACHED", self._registration_timeout) # Check registration state is connected using # registrationTimeout from Device_Catalog.xml (Non blocking # for this test if function isn't implemented on CDK) self._modem_api.check_cdk_registration_bfor_timeout( self._registration_timeout) # Set the APN time.sleep(self._wait_btwn_cmd) # Increase cell power if needed check_and_set_minimal_cell_power(self._ns_cell_3g, self._modem_api, self._dut_config, self._cell_power) if self._ip_version == "IPV6": self._logger.info("Setting APN " + str(self._apn) + " on " + str(self._ip_version)) self._networking_api.set_apn(self._ssid, self._apn, None, None, self._ip_version) elif self._ip_version == "IPV4V6": self._logger.info("Setting APN " + str(self._apn) + " on " + str(self._ip_version)) self._networking_api.set_apn(self._ssid, self._apn, None, None, self._ip_version) else: self._logger.info("Setting APN " + str(self._apn) + " on IPV4 ") self._networking_api.set_apn(self._ssid, self._apn) RegUtil.configure_ims_for_8960(self._ns_data_3g, self._networking_api, self._logger) if self._pdp_activation.lower() == "true": # Activate PDP context time.sleep(self._wait_btwn_cmd) self._logger.info("Active PDP Context...") self._networking_api.activate_pdp_context(self._ssid, False) # Force screen on to avoid end of PDP context due to fast dormancy self._phone_system.wake_screen() self._phone_system.set_phone_screen_lock_on(1) # Check Data Connection State => PDP Active before timeout self._ns_data_3g.check_data_connection_state( "PDP_ACTIVE", self._registration_timeout, blocking=False) # Get RAT from Equipment network_type = self._ns_data_3g.get_network_type() # Check that DUT is registered on the good RAT self._modem_api.check_network_type_before_timeout( network_type, self._registration_timeout) # Force screen on to avoid end of PDP context due to fast dormancy self._phone_system.wake_screen() self._phone_system.set_phone_screen_lock_on(1) if self._ns_data_3g.get_data_connection_status() != "PDP_ACTIVE": self._networking_api.reactivate_pdp_context(self._ssid, False) self._ns_data_3g.check_data_connection_state( "PDP_ACTIVE", self._registration_timeout, blocking=False) # Check IP protocol if needed (not needed for KPI test) if not self._kpi_test: self._networking_api.check_ip_protocol(self._ip_version) return Global.SUCCESS, "No errors"
def set_up(self): """ Set up the test configuration """ # Call use case base Setup function UseCaseBase.set_up(self) # Clear all data connections self._networking_api.clean_all_data_connections() time.sleep(self._wait_btwn_cmd) # Connect to equipment self._ns.init() # Set the equipment Application Format = "WCDMA" self._ns.switch_app_format("WCDMA") # Perform full preset self._ns.perform_full_preset() # Deactivate HSUPA and HSDPA capabilities self._ns_data_3g.set_edch_cell_capability("OFF") self._ns_data_3g.set_hsdpa_cell_capability("OFF") # Set cell off self._ns_cell_3g.set_cell_off() # 3G default cell setup RegUtil.setup_cell(self._ns_number, self._ns_model, "3G", self._band, self._ns_cell_rel, self._logger) # Set Frequency points using frequency list self._ns.configure_amplitude_offset_table() # Set cell power using CELL_POWER value self._ns_cell_3g.set_cell_power(self._cell_power) # Set serving cell to PACKET self._ns_cell_3g.set_cell_service("PACKET") # Set downlink UARFCN using DL_UARFCN value self._ns_cell_3g.set_band_and_dl_arfcn( "BAND" + str(self._band), self._dl_uarfcn) # Set cell on self._ns_cell_3g.set_cell_on() # Check Data Connection State => ATTACHED before timeout RegUtil.check_dut_data_connection_state_before_timeout("ATTACHED", self._ns_cell_3g, self._networking_api, self._logger, self._registration_timeout, flightmode_cycle=True, blocking=False) # Check registration state is connected using # registrationTimeout from Device_Catalog.xml self._modem_api.check_cdk_registration_bfor_timeout( self._registration_timeout) # Set the APN time.sleep(self._wait_btwn_cmd) self._logger.info("Setting APN " + str(self._apn) + "...") self._networking_api.set_apn(self._ssid, self._apn) # Activate PDP context time.sleep(self._wait_btwn_cmd) self._logger.info("Active PDP Context...") self._networking_api.activate_pdp_context(self._ssid) # Check Data Connection State => PDP Active before timeout self._ns_data_3g.check_data_connection_state("PDP_ACTIVE", self._registration_timeout, blocking=False) # Get RAT from Equipment network_type = self._ns_data_3g.get_network_type() # Check that DUT is registered on the good RAT self._modem_api.check_network_type_before_timeout(network_type, self._registration_timeout) return Global.SUCCESS, "No errors"
def set_up(self): """ Set up the test configuration """ # Call use case base Setup function UseCaseBase.set_up(self) # Ensure flight mode off so that GSM sim operator info can be retrieved self._networking_api.set_flight_mode("on") time.sleep(self._wait_btwn_cmd) # Connect to equipment self._ns.init() # Set the equipment Application Format = "GSM/GPRS" self._ns.switch_app_format("GSM/GPRS") # Perform full preset self._ns.perform_full_preset() # Set cell off self._ns_cell_2g.set_cell_off() # 2G default cell setup RegUtil.setup_cell(self._ns_number, self._ns_model, "2G", self._band_name, self._ns_cell_rel, self._logger) # Set serving cell to GSM self._ns_cell_2g.set_cell_service("GSM") # Set cell power using CELL_POWER value self._ns_cell_2g.set_cell_power(self._cell_power) # Set cell on self._ns_cell_2g.set_cell_on() # Ensure flight mode off so that GSM sim operator info can be retrieved self._networking_api.set_flight_mode("off") # Check registration status before time out using # registrationTimeout value from Device_Catalog.xml time.sleep(self._wait_btwn_cmd) dut_imsi = self._modem_api.get_imsi(self._registration_timeout) # Start DUT registration RegUtil.check_dut_registration_before_timeout( self._ns_cell_2g, self._networking_api, self._logger, dut_imsi, self._registration_timeout) # Check registration state is connected using # registrationTimeout from Device_Catalog.xml (Non blocking # for this test if function isn't implemented on CDK) time.sleep(self._wait_btwn_cmd) self._modem_api.check_cdk_registration_bfor_timeout( self._registration_timeout) # Set the APN time.sleep(self._wait_btwn_cmd) self._logger.info("Setting APN " + str(self._apn) + "...") self._networking_api.set_apn(self._ssid, self._apn) # Activate PDP context but without check as in GSM, PDP can not be activated time.sleep(self._wait_btwn_cmd) self._logger.info("Active PDP Context...") self._networking_api.activate_pdp_context(self._ssid, check=False) # Get RAT from Equipment network_type = self._ns_data_2g.get_network_type() # Check that DUT is registered on the good RAT self._modem_api.check_network_type_before_timeout( network_type, self._registration_timeout) return Global.SUCCESS, "No errors"
def set_up(self): """ Setting up the test """ # Call UseCaseBase set_up function. UseCaseBase.set_up(self) # Ensure flight mode off so that GSM sim operator info can be retrieved self._networking_api.set_flight_mode("off") time.sleep(self._wait_btwn_cmd) # Determinate the kind of registration state to wait # by comparing test case MCC/MNC parameters to sim MCC/MNC sim_info = self._modem_api.get_sim_operator_info() if sim_info["MCC"] != self._mcc or\ sim_info["MNC"] != self._mnc: self._wanted_reg_state = "roaming" self._networking_api.set_roaming_mode("ON") else: self._wanted_reg_state = "registered" # Clear all data connections self._networking_api.clean_all_data_connections() time.sleep(self._wait_btwn_cmd) # Enable flight mode self._networking_api.set_flight_mode("on") # Instantiate Network Simulator APIs and # Initialize the Network Simulator self.set_ns_apis_instances() # Perform full preset self._ns.perform_full_preset() # Set cell off self._ns_cell.set_cell_off() # Set the Equipment IP Address 1 self._ns.set_ip4_lan_address(self._ns_ip_lan1) # Set the equipment IP_Lan2 to the equipment self._ns.set_ip4_lan_address2(self._ns_ip_lan2) # Set the Equipment Subnet mask self._ns.set_ip4_subnet_mask(self._ns_subnet_mask) # Set the Equipment gateway self._ns.set_ip4_default_gateway(self._ns_default_gateway) # Set the DUT IP address 1 self._ns_data.set_dut_ip_address(1, self._ns_dut_ip_address) # Set the DUT IP address 2 if not empty str. if self._ns_dut_ip_address2 != "": self._ns_data.set_dut_ip_address(2, self._ns_dut_ip_address2) # Set HTTP Input ON for Nowsms # Set HTTP output ON for Nowsms self._ns.set_sms_http("ON", "ON") # Call specific configuration functions RegUtil.setup_cell(self._ns_number, self._ns_model, self._cell_tech, self._cell_band, self._ns_cell_rel, self._logger) # Set Cell Band and ARFCN using CELL_BAND # and ARFCN parameters # Set cell service using CELL_SERVICE parameter # Set Cell Power using CELL_POWER parameter # Set Cell LAC using LAC parameter # Set Cell RAC using RAC parameter # Set Cell MCC using MCC parameter # Set Cell MNC using MNC parameter self._ns_cell.configure_basic_cell_parameters( self._cell_service, self._cell_band, self._arfcn, self._cell_power, self._lac, self._rac, self._mcc, self._mnc) # Set cell on self._ns_cell.set_cell_on() # Disable flight mode self._networking_api.set_flight_mode("off") # Set the MMS APN in the DUT time.sleep(self._wait_btwn_cmd) self._logger.info("Setting APN " + str(self._apn_name) + "...") self._networking_api.set_apn(self._apn_ssid, self._apn_name, self._apn_user, self._apn_password, protocol=None, mmsc=self._apn_mmsc, apn_type=self._apn_type) # Activate PDP context time.sleep(self._wait_btwn_cmd) self._logger.info("Active PDP Context...") self._networking_api.activate_pdp_context(self._apn_ssid, check=False) # Check DUT is register verdict, output = self._check_network_registration() if verdict == Global.FAILURE: return verdict, output # Set display to "on" self._phonesystem_api.display_on() return Global.SUCCESS, "No error"
def set_up(self): """ Set up the test configuration """ # Call use case base Setup function UseCaseBase.set_up(self) # Ensure flight mode off so that GSM sim operator info can be retrieved self._networking_api.set_flight_mode("off") time.sleep(self._wait_btwn_cmd) # Determinates the kind of registration state to wait # by comparing test case MCC/MNC parameters to sim MCC/MNC sim_info = self._modem_api.get_sim_operator_info() if sim_info["MCC"] != self._mcc or\ sim_info["MNC"] != self._mnc: self._wanted_reg_state = "roaming" self._networking_api.set_roaming_mode("ON") else: self._wanted_reg_state = "registered" # Clear all data connections self._networking_api.clean_all_data_connections() time.sleep(self._wait_btwn_cmd) # Enable flight mode self._networking_api.set_flight_mode("on") hpmln_message = "Expected network registration state to be %s while " \ % self._wanted_reg_state self._logger.info(hpmln_message) # Connect to equipment self._ns.init() # Set the equipment Application Format = "WCDMA" self._ns.switch_app_format("WCDMA") # Perform full preset self._ns.perform_full_preset() # Deactivate HSUPA and HSDPA capabilities self._ns_data_3g.set_edch_cell_capability("OFF") self._ns_data_3g.set_hsdpa_cell_capability("OFF") # Set cell off self._ns_cell_3g.set_cell_off() # Set Mobile Country Code (MCC) self._ns_cell_3g.set_mcc(self._mcc) # Set Mobile Network Code (MNC) self._ns_cell_3g.set_mnc(self._mnc) hpmln_message = "Expected network registration state to be %s while " \ "HPMLN coverage is %s, MCCODE is %s and MNCODE is %s" % ( str(self._wanted_reg_state), str(self._hplmn_coverage), str(self._mcc), str(self._mnc)) self._logger.info(hpmln_message) # 3G default cell setup RegUtil.setup_cell(self._ns_number, self._ns_model, "3G", self._band_name, self._ns_cell_rel, self._logger) # Set cell power using CELL_POWER value self._ns_cell_3g.set_cell_power(self._cell_power) # Set cell on self._ns_cell_3g.set_cell_on() # Disable airplane mode self._networking_api.set_flight_mode("off") # Check registration status before time out using # registrationTimeout value from Device_Catalog.xml time.sleep(self._wait_btwn_cmd) dut_imsi = self._modem_api.get_imsi(self._registration_timeout) RegUtil.check_dut_registration_before_timeout( self._ns_cell_3g, self._networking_api, self._logger, dut_imsi, self._registration_timeout) # Check registration state is connected using # registrationTimeout from Device_Catalog.xml (Non blocking # for this test if function isn't implemented on CDK) time.sleep(self._wait_btwn_cmd) self._modem_api.check_cdk_state_bfor_timeout( self._wanted_reg_state, self._registration_timeout) # Set the APN time.sleep(self._wait_btwn_cmd) self._logger.info("Setting APN " + str(self._apn) + "...") self._networking_api.set_apn(self._ssid, self._apn) # Activate PDP context time.sleep(self._wait_btwn_cmd) self._logger.info("Active PDP Context...") self._networking_api.activate_pdp_context(self._ssid) time.sleep(self._wait_btwn_cmd) # Check Data Connection State => PDP_ACTIVE before timeout self._ns_data_3g.check_data_connection_state( "PDP_ACTIVE", self._registration_timeout, blocking=False) # Get RAT from Equipment network_type = self._ns_data_3g.get_network_type() # Check that DUT is registered on the good RAT self._modem_api.check_network_type_before_timeout( network_type, self._registration_timeout) return Global.SUCCESS, "No errors"
def set_up(self): # Call UseCaseBase set_up function. UseCaseBase.set_up(self) # Disable data and PDP context self._networking_api.deactivate_pdp_context() # Enable flight mode self._networking_api.set_flight_mode("on") # Set the Network Simulators APIs instances self._set_ns_apis_instances() # Perform full preset self._ns.perform_full_preset() # Set cell off self._ns_cell.set_cell_off() # Set IP addresses self._ns.set_ip_addresses(self._ns_ip_lan1, self._ns_ip_lan2, self._ns_ip_subnet_mask, self._ns_ip_default_gateway, self._ns_ip_dut, self._ns_ip_dns1, self._ns_ip_dns2) # Call specific configuration functions # Some parameters are defined by function RegUtil.setup_cell(self._ns_number, self._ns_model, self._ns_cell_generation, self._ns_cell_band, self._ns_cell_rel, self._logger) # Set Cell Band and ARFCN using 3GSM_CELL_BAND # and 3GSM_ARFCN parameters # Set cell service using 3GSM_CELL_SERVICE parameter # Set Cell Power using 3GSM_CELL_POWER parameter # Set Cell LAC using 3GSM_LAC_VALUE parameter # Set Cell RAC using 3GSM_RAC_VALUE parameter self._ns_cell.configure_basic_cell_parameters(self._ns_cell_service, self._ns_cell_band, self._ns_arfcn, self._ns_cell_power) # Set CPC Feature if self._cpc_tti_value is not None: self._em.configure_equipments("CPCFeature%d" % self._ns_number, {"type": self._cpc_tti_value}) self._logger.info( "CPC Feature has been set on the equipment with TII equal to %s ms." % self._cpc_tti_value) if self._ns_cell_tech == "HSPA": hsdpa_cat = str(self._dut_config.get("maxDlHspaRab"))[9:] self._em.configure_equipments( "HSDPACategories%d" % self._ns_number, {"category": hsdpa_cat}) hsupa_cat = str(self._dut_config.get("maxUlHspaRab"))[9:] self._em.configure_equipments( "HSDPACategories%d" % self._ns_number, {"category": hsupa_cat}) # Set cell on self._ns_cell.set_cell_on() # Disable flight mode self._networking_api.set_flight_mode("off") # Set the APN in the DUT time.sleep(self._wait_btwn_cmd) self._logger.info("Setting APN " + str(self._apn_name) + "...") self._networking_api.set_apn(self._apn_ssid, self._apn_name) # Activate PDP context time.sleep(self._wait_btwn_cmd) self._logger.info("Active PDP Context...") self._networking_api.activate_pdp_context(self._apn_ssid, check=False) # Get RAT from Equipment network_type = self._ns_data.get_network_type() # Check that DUT is registered on the good RAT self._modem_api.check_network_type_before_timeout( network_type, self._registration_timeout) # Force screen on to avoid end of PDP context due to fast dormancy self._phonesystem_api.wake_screen() self._phonesystem_api.set_phone_screen_lock_on(1) if self._ns_data.get_data_connection_status() != "PDP_ACTIVE": self._ns_data.check_data_connection_state( "PDP_ACTIVE", self._registration_timeout, blocking=False) self._logger.info("Start continuous ping to " + self._server_ip_address) self._networking_api.start_continuous_ping(self._server_ip_address) return Global.SUCCESS, "No errors"