def install(self, appuri, additionnals=None, arguments=None, url=None, destination=None): """ Install the application on the device :type appuri: String :param appuri: The full path to the application file :type additionnals: String :param additionnals: The full path of additionnals elements to run the application :type arguments: String :param arguments: The arguments of the application. May be everything the application need to run. :type destination: String :param destination: The directory where the application will be installed """ IApplication.install(self, appuri, additionnals, arguments, url, destination) metadata = self._ApkMetaReader(self._application_uri) apk_infos = metadata.get_infos() self.__app_name = apk_infos["package"]["name"] self.__version = apk_infos["package"]["versionName"] if "launchable-activity" in apk_infos: self.__launcher = apk_infos["launchable-activity"]["name"]
def get_score( self, stat_type="MEDIAN" ): #This method will override the method at the end of itreation IApplication.get_score(self, stat_type) msg = "Partially Automated - Unable to parse final result,Check webxprt_result folder for screenshot " raise AcsBaseException("", msg)
def install(self, appuri, additionnals=None, arguments=None, url=None, destination=None): """ Install the application on the device :type appuri: String :param appuri: The full path to the application file :type additionnals: String :param additionnals: The full path of additionnals elements to run the application :type arguments: String :param arguments: The arguments of the application. May be everything the application need to run. :type destination: String :param destination: The directory where the application will be installed """ IApplication.install(self, appuri, additionnals, arguments, url, destination) self.__url = url
def __init__(self, device): """ Initializes this instance. @type device: Device @param device: The DUT """ IApplication.__init__(self, device) self.is_lower_better = True self.__pattern = "\[\s*(?P<result>\d*\.\d*)\].*bootanim.exit" self.__pattern2 = ".*Boot animation finished.*" self.__subscore_pattern = ".*boot_progress_%s.*\s(?P<score>\d+)" self._results = {"score": []} self.__subscores = { "start": [], "preload_start": [], "preload_end": [], "system_run": [], "pms_start": [], "pms_system_scan_start": [], "pms_data_scan_start": [], "pms_scan_end": [], "pms_ready": [], "ams_ready": [], "enable_screen": [] } self.__match = None self.start_cold_boot = 0 self.end_cold_boot = 0
def get_score( self, stat_type="MEDIAN" ): #This method will override the method at the end of itreation IApplication.get_score(self, stat_type) msg = "Partially Automated-Unable to fetch score.Check BxBenchPCCG_result folder for screenshot " raise AcsBaseException("", msg)
def install(self, appuri, additionnals=None, arguments=None, url=None, destination=None): """ Install the application on the device :type appuri: String :param appuri: The full path to the application file :type additionnals: String :param additionnals: The full path of additionnals elements to run the application :type arguments: String :param arguments: The arguments of the application. May be everything the application need to run. :type destination: String :param destination: The directory where the application will be installed """ IApplication.install(self, appuri, additionnals, arguments, url, destination) app_name = os.path.split(self._application_uri)[1] cmd = "mv /data/%s /data/%s" % (app_name, self._benchmark_name) self.adb_shell(cmd, 3)
def install(self, appuri, additionnals=None, arguments=None, destination=None): """ install the application : create .sh file and push it on device """ IApplication.install(self, appuri, additionnals, arguments, destination) # get number of capture capture_number = self.__get_arguments_value("NumberOfIteration") # default value_execution_file if capture_number is None: self._capture_number = 10 else: self._capture_number = int(capture_number) # get sleep time between capture sleep_time = self.__get_arguments_value("SleepTimeBetweenCapture") # default value if sleep_time is None: self._sleep_time_between_capture = 30 else: self._sleep_time_between_capture = int(sleep_time) self._camera = Camera(self._device) # generate and push application file self.__generate_and_push_sh()
def __init__(self, device): """ Initializes this instance. :type device: Device :param device: The DUT """ IApplication.__init__(self, device) self._wifi_router = None self._ssid = None self._passphrase = None self._security = None self._browser_cache_dir = None self._results = None self._wait_btwn_cmd = None self._browser = "native" self._browsername = None self._logcat_pattern = None self._display_orientation = False self.__url = None self._parameters = {} self._sw_release = device.get_sw_release() self._model_number = device.get_model_number() self._kernel_version = device.get_kernel_version() self._fw_version = device.get_fw_version() self._device_id = device.get_device_id()
def pre_install(self, execution_config_path, global_config, dut_config, sysdebug_apis=None): """ Pre installation actions :type execution_config_path: str :param execution_config_path: The path of the configuration of ACS :type global_config: Dictionnary :param global_config: Global configuration of ACS :type dut_config: Dictionnary :param dut_config: The configuration of the DUT """ IApplication.pre_install(self, execution_config_path, global_config, dut_config, sysdebug_apis) self._wait_btwn_cmd = float(dut_config.get("waitBetweenCmd")) if self._parameters.get("wifi_connect", True): self._wifi_router = global_config.benchConfig.get_parameters( "WPA_WIFI_ROUTER") self._ssid = self._wifi_router.get_param_value("SSID") self._passphrase = self._wifi_router.get_param_value("passphrase") self._security = self._wifi_router.get_param_value("WIFI_SECURITY") self._phonesystem.display_on() self.__wifi_enable() self.__wifi_connection() self._phonesystem.display_off()
def stop(self): """ Stop the application """ IApplication.stop(self) run_apk_cmd = "am force-stop " + self.__app_name self.adb_shell(run_apk_cmd, 5)
def __init__(self, device): """ Initializes this instance. :type device: Device :param device: The DUT """ IApplication.__init__(self, device)
def __init__(self, device): """ Initializes this instance. :type device: Device :param device: The DUT """ IApplication.__init__(self, device) self.__app_name = None self.__launcher = None self.__version = None
def __init__(self, device): """ Initializes this instance. :type device: Device :param device: The DUT """ IApplication.__init__(self, device) self.__binary_file = "/data/%s" % self._benchmark_name self.__shell_file = "/data/%s.sh" % self._benchmark_name self._result_file = "/data/result_%s.txt" % self._benchmark_name self._command = "./%s" % self._benchmark_name
def post_install(self): """ Post installation configuration """ self._logger.debug("Software release: %s " % self._sw_release) self._logger.debug("Model number: %s " % self._model_number) self._logger.debug("Kernel version: %s " % self._kernel_version) self._logger.debug("FW version: %s " % self._fw_version) self._logger.debug("Device ID: %s " % self._device_id) IApplication.post_install(self) self.__parse_arguments() self.__set_browser() self.__set_orientation()
def __init__(self, device): """ Initializes this instance. :type device: Device :param device: The DUT """ IApplication.__init__(self, device) self._camera = None self._camera_name = "camera" self._arguments = None self._capture_number = None self._sleep_time_between_capture = None self._flash_mode = None self._screen_mode = None self._execution_file = None self._device = device self.__umic_report_path = None self.__um_capture_pid = None
def pre_install(self, execution_config_path, global_config, dut_config, sysdebug_apis=None): """ Pre installation actions :type execution_config_path: str :param execution_config_path: The path of the configuration of ACS :type global_config: Dictionnary :param global_config: Global configuration of AC :type dut_config: Dictionnary :param dut_config: The configuration of the DUT """ IApplication.pre_install(self, execution_config_path, global_config, dut_config, sysdebug_apis) self._wait_btwn_cmd = float(dut_config.get("waitBetweenCmd"))
def get_score(self, stat_type="MEDIAN"): IApplication.get_score(self, stat_type) raise DeviceException(DeviceException.OPERATION_SET_ERROR, "Empty operation set is defined")
def stop(self): """ Stop sunspider benchmark """ IApplication.stop(self) self._networking.close_web_browser(self._browser)