def set_up(self): """ Test setup """ # If WIFI is ON, turn it off if self._networking_api.get_wifi_power_status() == self.STATE_ON: self._logger.info("Turn off WIFI") # Turn off WIFI self._networking_api.set_wifi_power(self.STATE_OFF) time.sleep(self._wait_btwn_cmd) # Turn off Bluetooth self._connectivity_api.set_bt_power(self.STATE_OFF) time.sleep(self._wait_btwn_cmd) # Call LAB_LTE_BASE set_up function LabLteBase.set_up(self) # Recording initial state before starting the test self._initial_flight_mode_state = \ self._networking_api.get_flight_mode() # If DUT is not in airplane mode on, enable it if self._initial_flight_mode_state == 0: self._logger.info("Now enabling Flight Mode.") self._networking_api.set_flight_mode(self.STATE_ON) # Set Cell on self._cell_4g.set_cell_on(self._mimo) return Global.SUCCESS, "No errors"
def set_up(self): """ Set up the test configuration """ # Call LAB_LTE_BASE set_up function LabLteBase.set_up(self) # Set Cell on self._cell_4g.set_cell_on(self._mimo) # Phone has to see the cell off! self._modem_api.check_cdk_no_registration_bfor_timeout( self._registration_timeout) # Flight mode deactivation self._networking_api.set_flight_mode("off") # Check registration state is connected using # registrationTimeout from Device_Catalog.xml self._logger.info("Check network registration status is %s on DUT" % (self._wanted_reg_state)) self._modem_api.check_cdk_state_bfor_timeout( self._wanted_reg_state, self._registration_timeout) # Set APN for LTE and/or IMS depending on protocol IPv4 or IPv6 self._set_apn_for_lte_and_ims() # Enable Data Usage time.sleep(self._wait_btwn_cmd) self._networking_api.activate_pdp_context() # Get RAT from Equipment network_type = self._data_4g.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) # Check IMS connection state status = self._data_4g.check_ims_connection_state( "REG", self._registration_timeout) if status == False: raise DeviceException(DeviceException.INVALID_DEVICE_STATE, "Failed to reach IMS registration") # Wait 15 seconds after registration before sending first SMS time.sleep(15) # Initialize counter to be append to sms_text in order to # differenciate the different SMS sent in B2B mode self._counter = 0 return (Global.SUCCESS, "No errors")