def run(self, context): """ Runs the test step :type context: TestStepContext :param context: test case context """ CellularBase.run(self, context) self._hsi_speed = self._pars.modem_hsi_speed assert self._hsi_speed in ["NO", "DEF", "HIGH"], \ "passed value for modem_hsi_speed (%s) is invalid at this stage" % self._hsi_speed assert any(char.isdigit() for char in self._pars.modem_traces_level), \ "passed value for modem_traces_level (%s) is invalid at this stage" % self._pars.modem_traces_level if self._hsi_speed == "NO": self._hsi_speed = "u" elif self._hsi_speed == "DEF": self._hsi_speed = "d" else: self._hsi_speed = "h" self._traces_level = int(self._pars.modem_traces_level) self._modem_api.configure_modem_trace(self._hsi_speed, self._traces_level)
def run(self, context): """ Runs the test step @type context: TestStepContext @param context: test case context """ CellularBase.run(self, context) self._logger.info("Getting the Cellular interface state...") # Where the information will be stored into the context? variable_to_set = self._pars.save_as value = self._modem_api.get_modem_power_status() if str_to_bool_ex(value): value = TestConst.STR_ON else: value = TestConst.STR_OFF # We have the value, let's save it into the context context.set_info(variable_to_set, value) self.ts_verdict_msg = "VERDICT: %s stored as {0}".format( value) % variable_to_set self._logger.debug(self.ts_verdict_msg)
def run(self, context): """ Runs the test step @type context: TestStepContext @param context: test case context """ CellularBase.run(self, context) self._logger.info("Getting the preferred network...") # Where the information will be stored into the context? variable_to_set = self._pars.save_as # Flight mode must be disable to use this function if self._networking_api.get_flight_mode() == 1: msg = "Can't set preferred network, Flight mode is currently ON" self._logger.error(msg) raise DeviceException(DeviceException.OPERATION_FAILED, msg) state = self._networking_api.get_preferred_network_type() # We have the value, let's save it into the context context.set_info(variable_to_set, state) self.ts_verdict_msg = "VERDICT: %s stored as {0}".format( state) % variable_to_set self._logger.debug(self.ts_verdict_msg)
def run(self, context): """ Runs the test step @type context: TestStepContext @param context: test case context """ CellularBase.run(self, context) state = str(self._pars.coex_manager_traces_state).lower() assert state in [TestConst.STR_ON, TestConst.STR_OFF], \ "passed value (%s) is invalid at this stage" % state mode = "" if state == TestConst.STR_ON: mode = "VERBOSE" cur_state = self._modem_api.get_lte_coex_manager_messages_state() if cur_state != state: self._logger.info("Setting the Coex manager traces %s" % state) self._device.disconnect_board() self._modem_api.set_lte_coex_manager_messages(mode) self._device.connect_board() else: self._logger.info("The Coex manager traces are already %s " % state)
def run(self, context): """ Runs the test step @type context: TestStepContext @param context: test case context """ CellularBase.run(self, context) assert self._pars.preferred_network in [ "2G_ONLY", "3G_ONLY", "4G_ONLY", "3G_PREF", "4G_PREF", "2G_3G", "CDMA_PREF", "CDMA_ONLY", "EVDO_ONLY", "GLOBAL", "4G_PREF_US", "WORLD_MODE" ], "passed value (%s) is invalid at this stage" % self._pars.preferred_network self._logger.info("Set preferred network for Cellular...") # Flight mode must be disable to use this function if self._networking_api.get_flight_mode() == 1: msg = "Can't set preferred network, Flight mode is currently ON" self._logger.error(msg) raise DeviceException(DeviceException.OPERATION_FAILED, msg) self._networking_api.set_preferred_network_type( self._pars.preferred_network) self._wait_until_state_is_reached(self._pars.preferred_network)
def run(self, context): """ Runs the test step @type context: TestStepContext @param context: test case context """ CellularBase.run(self, context) self._modem_api.check_cdk_no_registration_bfor_timeout(self._pars.timeout)
def run(self, context): """ Runs the test step :type context: TestStepContext :param context: test case context """ CellularBase.run(self, context) self._modem_api.deactivate_modem_trace()
def run(self, context): """ Runs the test step :type context: TestStepContext :param context: test case context """ CellularBase.run(self, context) # Check that DUT is registered on the good RAT self._networking_api.set_roaming_mode(self._pars.roaming_mode)
def run(self, context): """ Runs the test step @type context: TestStepContext @param context: test case context """ CellularBase.run(self, context) self._logger.info("Check IMS registration before {0}s".format(self._pars.timeou)) self._networking_api.check_ims_registration_before_timeout(self._pars.timeout)
def run(self, context): """ Runs the test step :type context: TestStepContext :param context: test case context """ CellularBase.run(self, context) # Check that DUT is registered on the good RAT self._modem_api.check_network_type_before_timeout(self._pars.network_type, self._pars.timeout)
def run(self, context): """ Runs the test step @type context: TestStepContext @param context: test case context """ CellularBase.run(self, context) # Flight mode must be disable to use this function if self._networking_api.get_flight_mode() == 1: msg = "Can't get IMSI, Flight mode is currently ON" self._logger.error(msg) raise DeviceException(DeviceException.OPERATION_FAILED, msg) self._modem_api.check_cdk_state_bfor_timeout(self._pars.state, self._pars.timeout)
def run(self, context): """ Runs the test step :type context: TestStepContext :param context: test case context """ CellularBase.run(self, context) self._logs_dest = self._pars.modem_traces_dest assert self._logs_dest in ["EMMC", "SDCARD"], \ "passed value (%s) is invalid at this stage" % self._logs_dest if self._logs_dest == "EMMC": self._logs_dest = BPLOG_LOC.EMMC else: self._logs_dest = BPLOG_LOC.SDCARD self._modem_api.activate_modem_trace(self._logs_dest)
def run(self, context): """ Runs the test step :type context: TestStepContext :param context: test case context """ CellularBase.run(self, context) assert self._pars.preferred_network in NETWORK_PREFERENCES, "passed value (%s) is invalid at this stage" % self._pars.preferred_network # Configure optional parameters if self._pars.loop_timer is not None: if self._pars.loop_timer < 0: loop_timer = 0 self._logger.warning( "Invalid LOOP_TIMER value, use 0 as default value") else: loop_timer = int(self._pars.loop_timer) else: loop_timer = 0 if self._pars.timeout_between_checks is not None: if self._pars.timeout_between_checks < 0: timeout_between_checks = 0 self._logger.warning( "Invalid TIMEOUT_BETWEEN_CHECKS value, use 0 as default value" ) else: timeout_between_checks = int(self._pars.timeout_between_checks) else: timeout_between_checks = 0 initial_time = time.time() first_loop = False while loop_timer > (time.time() - initial_time) or first_loop is False: self._modem_api.check_rat_with_pref_network( self._pars.preferred_network, int(self._pars.timeout)) time.sleep(timeout_between_checks) first_loop = True my_time = time.time()
def run(self, context): """ Runs the test step @type context: TestStepContext @param context: test case context """ CellularBase.run(self, context) # Get the power sequence (it might just be one single operation) power = str(self._pars.power).lower() power_sequence = split_and_strip(power, self.STR_SEPARATOR) for current in power_sequence: assert current.lower() in [TestConst.STR_ON, TestConst.STR_OFF], \ "passed value (%s) is invalid at this stage" % current self._logger.info("Powering %s the Cellular interface" % current) self._modem_api.set_modem_power(current) self._wait_until_state_is_reached(current)
def run(self, context): """ Runs the test step :type context: TestStepContext :param context: test case context """ CellularBase.run(self, context) # Flight mode must be disable to use this function if self._networking_api.get_flight_mode() == 1: msg = "Can't get SIM MNC and MCC, Flight mode is currently ON" self._logger.error(msg) raise DeviceException(DeviceException.OPERATION_FAILED, msg) sim_info = self._modem_api.get_extended_sim_operator_info(nb_digits=3) context.set_info(self._pars.mnc, sim_info["MNC"]) context.set_info(self._pars.mcc, sim_info["MCC"]) self.ts_verdict_msg = str("VERDICT: %s stored as %s and %s" % (sim_info, self._pars.mnc, self._pars.mcc)) self._logger.debug(self.ts_verdict_msg)
def run(self, context): """ Runs the test step @type context: TestStepContext @param context: test case context """ CellularBase.run(self, context) self._logger.info("Getting the IMSI...") # Flight mode must be disable to use this function if self._networking_api.get_flight_mode() == 1: msg = "Can't get IMSI, Flight mode is currently ON" self._logger.error(msg) raise DeviceException(DeviceException.OPERATION_FAILED, msg) imsi = self._modem_api.get_imsi(self._pars.timeout) context.set_info(self._pars.save_as, imsi) self.ts_verdict_msg = str("VERDICT: %s stored as %s" % (imsi, self._pars.save_as)) self._logger.debug(self.ts_verdict_msg)
def __init__(self, tc_conf, global_conf, ts_conf, factory): CellularBase.__init__(self, tc_conf, global_conf, ts_conf, factory) self._hsi_speed = None self._traces_level = None
def __init__(self, tc_conf, global_conf, ts_conf, factory): CellularBase.__init__(self, tc_conf, global_conf, ts_conf, factory) self._initial_time = None self._timeout = self.SET_DEFAULT_TIMEOUT_SECS self._wait_for = 1 self._state_reached = False
def __init__(self, tc_conf, global_conf, ts_conf, factory): CellularBase.__init__(self, tc_conf, global_conf, ts_conf, factory)
def __init__(self, tc_conf, global_conf, ts_conf, factory): CellularBase.__init__(self, tc_conf, global_conf, ts_conf, factory) self._logs_dest = None