def tear_down(self): """ End and dispose the test """ # call tear down after some operations EmUsecaseBase.tear_down(self) # get just the aplogs if self._device.get_state() == "alive": # restart acs connection to have clean rooted device self._device.disconnect_board() self._device.connect_board() self.get_application_logs() if len(self.__file_secure_copy_list) > 0: self._logger.info("Restoring and deleting generated file") # parse all secure copy for index in range(len(self.__file_secure_copy_list)): secure_copy_file = self.__file_secure_copy_list[index] # if a copy exist, compare it if original if self.__file_api.exist(secure_copy_file)[0]: original_file = self.__file_to_test_list[index] self.__file_api.remount() if (not self.__file_api.exist(original_file)[0] or not self.__file_api.is_equal( original_file, secure_copy_file) ) and self.__dangerous_action_performed: self._logger.info("restoring file") self.__restore_file(index) # delete it the end self.__file_api.delete(secure_copy_file) self.__dangerous_action_performed = False return Global.SUCCESS, "No errors"
def tear_down(self): """ End and dispose the test """ EmUsecaseBase.tear_down(self) if self.__temp_camera is not None: try: self.__temp_camera.delete_all_pictures() self.__temp_camera.set_linear_temperature_mode(False) except Exception as e: self._logger.error( "error happen when releasing thermal camera %s" % str(e)) finally: self.__temp_camera.release() if not self.__media_player is None: self.__media_player.stop() # stop all load self.em_core_module.clean_up() self.__load_module.stop_load() # stop any remaining video capture self.__video_record_api.force_stop() self.__video_record_api.restore_camera_setup() self.__video_record_api.clean_video_storage() return Global.SUCCESS, "No errors"
def tear_down(self): """ End and dispose the test """ # call tear down EmUsecaseBase.tear_down(self) # retrieve measurement from test self.__em_meas_tab.generate_global_file() if self._load in ["HEAVY", "MEDIUM"]: # set CMU cell phone OFF self._data_2g.set_data_cell_off() # Disconnect from the equipment (Network simulator) self._ns.release() # reboot the board to clean it from all setting self.em_core_module.reboot_board() # clean the board state and retrieve logs self.em_core_module.clean_up() if self.is_board_and_acs_ok() and self.batt_capacity != -1: self.phonesystem_api.set_screen_timeout(30) if self._load in ["HEAVY"]: self.networking_api.set_wifi_power("off") self.phonesystem_api.clean_daemon_files() return Global.SUCCESS, "No errors"
def tear_down(self): """ End and dispose the test """ EmUsecaseBase.tear_down(self) benchmark_stopped = False # stop benchmark here to prevent it from running in loop while charging below if self.is_board_and_acs_ok(): try: self.__benchmark_module.clean() benchmark_stopped = True except Exception as e: self._logger.error("error happen when stopping benchmark %s" % str(e)) # stop camera anyway if self.__temp_camera is not None: try: self.__temp_camera.delete_all_pictures() self.__temp_camera.set_linear_temperature_mode(False) except Exception as e: self._logger.error( "error happen when releasing thermal camera %s" % str(e)) finally: self.__temp_camera.release() # stop all load self.em_core_module.clean_up() self.__load_module.stop_load() if not benchmark_stopped: self.__benchmark_module.clean() # stop benchmark return Global.SUCCESS, "No errors"
def tear_down(self): """ End and dispose the test """ # call tear down after some operations EmUsecaseBase.tear_down(self) # retrieve measurement from test self.__em_meas_tab.generate_global_file() # set CMU cell phone OFF self._data_2g.set_data_cell_off() # Disconnect from the equipment (Network simulator) self._ns.release() if self.is_board_and_acs_ok(): self.em_api.set_usb_charging("on") # call tear down after some operations self.em_core_module.clean_up() if self.is_board_and_acs_ok(): self.phonesystem_api.set_screen_timeout(30) self.phonesystem_api.clean_daemon_files() return Global.SUCCESS, "No errors"
def tear_down(self): """ End and dispose the test """ self._logger.info("[HARDWARE_SHUTDOWN] Tear Down") if self._device.get_boot_mode() != "MOS": # disconnect battery self._io_card.battery_connector(False) time.sleep(5) # connect battery self._io_card.battery_connector(True) time.sleep(0.3) self._logger.info(" press on 3s") self._io_card.press_power_button(3) time.sleep(60) # plug SDP self.em_core_module.plug_charger("SDP") # reboot in MOS self._device.reboot("MOS") # execute base tear down EmUsecaseBase.tear_down(self) return Global.SUCCESS, "No errors"
def tear_down(self): """ End and dispose the test """ # call tear down after some operations EmUsecaseBase.tear_down(self) # retrieve measurement from test self.__em_meas_tab.generate_global_file() # release equipment if self.tc_module is not None: self.tc_module.release_eq() # clean the board state and retrieve logs self.em_core_module.clean_up() # clean autolog if self.is_board_and_acs_ok(): self.em_api.clean_autolog() # toggle techno off depending of what was put in LOAD var if "WIFI" in self.__load: self.networking_api.set_wifi_power("off") if "BLUETOOTH" in self.__load: self.bt_api.set_bt_power("off") if "TORCH" in self.__load: self.phonesystem_api.set_torchlight("off") if "VIBRA" in self.__load: self.phonesystem_api.set_vibration("off") return Global.SUCCESS, "No errors"
def tear_down(self): EmUsecaseBase.tear_down(self) # stop load self.em_core_module.clean_up() self.__load_module.stop_load() return Global.SUCCESS, "No errors"
def tear_down(self): """ End and dispose the test """ # desactivate load self.__load_module.stop_load() EmUsecaseBase.tear_down(self) return Global.SUCCESS, "No errors"
def tear_down(self): """ End and dispose the test """ # call tear down after some operations EmUsecaseBase.tear_down(self) # clean the board state and retrieve logs self.em_core_module.clean_up() return (Global.SUCCESS, "success")
def tear_down(self): """ End and dispose the test """ EmUsecaseBase.tear_down(self) if self.em_core_module.TYPE == "BATTERY_BENCH": self.em_core_module.clean_up() return Global.SUCCESS, "No errors"
def tear_down(self): """ End and dispose the test """ EmUsecaseBase.tear_down(self) # restore power supply resistance self.em_core_module.pwrs_vbatt.set_resistance( self.em_core_module.resistance) return Global.SUCCESS, "No errors"
def tear_down(self): """ End and dispose the test """ if self._initial_os_state.upper() == "OFF_NO_BATT": # plug the battery self._io_card.battery_connector(True) EmUsecaseBase.tear_down(self) return Global.SUCCESS, "No errors"
def tear_down(self): """ End and dispose the test """ EmUsecaseBase.tear_down(self) # restore the original warn voltage value for key in self.__warntype: self.em_api.set_bcu_warn_level(self.__warntype[key], key) return Global.SUCCESS, "No errors"
def tear_down(self): """ End and dispose the test """ EmUsecaseBase.tear_down(self) # retrieve logs self.get_application_logs() self.phonesystem_api.set_screen_timeout(60) # clean schedule created object self.phonesystem_api.clean_daemon_files() return Global.SUCCESS, "No errors"
def tear_down(self): """ End and dispose the test """ EmUsecaseBase.tear_down(self) # retrieve logs if self.DEDICATED_BENCH == "BATTERY_BENCH": self.get_application_logs() # clean schedule created object self.phonesystem_api.clean_daemon_files() return Global.SUCCESS, "No errors"
def tear_down(self): """ End and dispose the test """ # switch on the board self._device.switch_on() # install acs apk embedded DEPREACTED CODE TO BE REPLACED # self._device.setup_embedded() # call the base tear down EmUsecaseBase.tear_down(self) return Global.SUCCESS, "No errors"
def tear_down(self): """ End and dispose the test """ # call tear down after some operations EmUsecaseBase.tear_down(self) # clean the board state and retrieve logs if self.em_core_module.TYPE == "BATTERY_BENCH": self.em_core_module.clean_up() return Global.SUCCESS, "No errors"
def tear_down(self): """ End and dispose the test """ # call the base EmUsecaseBase.tear_down(self) # set brightness mode to auto self.phonesystem_api.set_brightness_mode("automatic") return Global.SUCCESS, "No errors"
def tear_down(self): """ End and dispose the test """ # call tear down after some operations EmUsecaseBase.tear_down(self) # clean the board state and retrieve logs self.em_core_module.clean_up() if self.is_board_and_acs_ok(): self.__load_module.clean() # restore setting that does not persist on reboot return Global.SUCCESS, "No errors"
def tear_down(self): """ End and dispose the test """ EmUsecaseBase.tear_down(self) # reboot in normal mode for next test if self._battery_type == "BATTERY_EMULATOR": # Set Battery type using BATTERY_TYPE parameter self._io_card.set_battery_type("DEFAULT") self.em_core_module.reboot_board() return Global.SUCCESS, "No errors"
def tear_down(self): """ End and dispose the test """ # call tear down after some operations EmUsecaseBase.tear_down(self) # activate set auto brightness self.phonesystem_api.set_brightness_mode("automatic") # clean the board state and retrieve logs self.em_core_module.clean_up() return Global.SUCCESS, "No errors"
def tear_down(self): """ End and dispose the test """ EmUsecaseBase.tear_down(self) # clean the board state and retrieve logs self.em_core_module.clean_up() if self.is_board_and_acs_ok() and self.batt_capacity != -1: if self._stand_mode == "FLIGHT_MODE": self._network_api.set_flight_mode("off") return Global.SUCCESS, "No errors"
def tear_down(self): """ End and dispose the test """ EmUsecaseBase.tear_down(self) # clean generated measure on the board if self.is_board_and_acs_ok(): self.phonesystem_api.clean_daemon_files() # check for setting the board as before the setup if self.__is_ac_charger_plugged is True: self._io_card.ac_charger_connector(False) self.__is_ac_charger_plugged = False return Global.SUCCESS, "No errors"
def tear_down(self): """ End and dispose the test """ # call tear down after some operations EmUsecaseBase.tear_down(self) if self.is_board_and_acs_ok(): self.__load_module.stop_load() self.__retrieve_lost_em_info() # clean the board state and retrieve logs self.clean_up() if self.is_board_and_acs_ok(): self.__retrieve_lost_em_info() return Global.SUCCESS, "No errors"
def tear_down(self): """ End and dispose the test """ # call tear down after some operations EmUsecaseBase.tear_down(self) # retrieve measurement from test self.__em_meas_tab.generate_global_file() if self.is_board_and_acs_ok(): self.em_api.set_usb_charging("on") # clean the board state and retrieve logs self.em_core_module.clean_up() return Global.SUCCESS, "No errors"
def tear_down(self): """ End and dispose the test """ # call tear down after some operations EmUsecaseBase.tear_down(self) boot_mode = self._device.get_boot_mode() # re-establish MOS if boot_mode in ["ROS"]: self._logger.info("Board in Recovery OS") self._device.reboot() # clean the board state and retrieve logs self.em_core_module.clean_up() return Global.SUCCESS, "No errors"
def tear_down(self): """ End and dispose the test """ # call tear down after some operations EmUsecaseBase.tear_down(self) boot_mode = self._device.get_boot_mode() # re-establish MOS if boot_mode not in ["UNKNOWN", "MOS"]: self._device.reboot() # if board is in unknown state, force shutdown and reboot elif boot_mode == "UNKNOWN": self.em_core_module.reboot_board(switch_off_mode="HARD") # clean the board state and retrieve logs self.em_core_module.clean_up() return Global.SUCCESS, "No errors"
def tear_down(self): """ End and dispose the test """ # call tear down after some operations EmUsecaseBase.tear_down(self) # release equipment if self.tc_module is not None: self.tc_module.release_eq() # clean the board state and retrieve logs self.em_core_module.clean_up() # stop all daemonized ACS process self.phonesystem_api.clean_daemon_files() return Global.SUCCESS, "No errors"
def tear_down(self): """ End and dispose the test """ # call tear down after some operations EmUsecaseBase.tear_down(self) if self.tc_module is not None: # Go to the ambient temperature self.tc_module.release_eq() # clean the board state and retrieve logs self.em_core_module.clean_up() # restore thermal management setting self.em_api.set_thermal_management(True) # a reboot is required to apply this change self._device.reboot() return Global.SUCCESS, "No errors"