mirror of
				https://github.com/ARM-software/workload-automation.git
				synced 2025-10-29 22:24:51 +00:00 
			
		
		
		
	Fixed WA extensions for AndroidManager
Changed method calls to devlib naming
This commit is contained in:
		| @@ -123,7 +123,7 @@ class BBench(Workload): | ||||
|             self.device.write_value('/proc/sys/vm/drop_caches', 3) | ||||
|  | ||||
|         #On android 6+ the web browser requires permissions to access the sd card | ||||
|         if self.device.get_sdk_version() >= 23: | ||||
|         if self.device.os_version["sdk"]() >= 23: | ||||
|             self.device.execute("pm grant com.android.browser android.permission.READ_EXTERNAL_STORAGE") | ||||
|             self.device.execute("pm grant com.android.browser android.permission.WRITE_EXTERNAL_STORAGE") | ||||
|  | ||||
|   | ||||
| @@ -88,7 +88,7 @@ class Dex2oatBenchmark(Workload): | ||||
|  | ||||
|         """ | ||||
|         logcat_log = os.path.join(context.output_directory, 'logcat.log') | ||||
|         self.device.dump_logcat(logcat_log) | ||||
|         context.device_manager.dump_logcat(logcat_log) | ||||
|  | ||||
|         regex_time = re.compile("^I\/dex2oat \( *[0-9]+\): dex2oat took (?P<time>[0-9]+\.?[0-9]*)(?P<unit>m?s)") | ||||
|         regex_comp_time = re.compile("^I\/dex2oat \( *[0-9]+\): +(?P<time>[0-9]*\.?[0-9]*)(?P<unit>m?s) Compile Dex File") | ||||
|   | ||||
| @@ -121,12 +121,13 @@ class Geekbench(AndroidUiAutoBenchmark): | ||||
|         score_calculator.update_results(context) | ||||
|  | ||||
|     def update_result_3(self, context): | ||||
|         outfile_glob = self.device.path.join(self.device.package_data_directory, self.package, 'files', '*gb3') | ||||
|         outfile_glob = self.device.path.join(context.device_manager.package_data_directory, self.package, 'files', '*gb3') | ||||
|         on_device_output_files = [f.strip() for f in | ||||
|                                   self.device.execute('ls {}'.format(outfile_glob), as_root=True).split('\n')] | ||||
|                                   self.device.execute('ls {}'.format(outfile_glob), as_root=True).split('\n') | ||||
|                                   if f.strip()] | ||||
|         for i, on_device_output_file in enumerate(on_device_output_files): | ||||
|             host_temp_file = tempfile.mktemp() | ||||
|             self.device.pull_file(on_device_output_file, host_temp_file) | ||||
|             self.device.pull(on_device_output_file, host_temp_file) | ||||
|             host_output_file = os.path.join(context.output_directory, os.path.basename(on_device_output_file)) | ||||
|             with open(host_temp_file) as fh: | ||||
|                 data = json.load(fh) | ||||
|   | ||||
| @@ -86,7 +86,7 @@ class ManualWorkload(Workload): | ||||
|     def update_result(self, context): | ||||
|         if self.enable_logcat: | ||||
|             logcat_dir = os.path.join(context.output_directory, 'logcat') | ||||
|             self.device.dump_logcat(logcat_dir) | ||||
|             context.device_manager.dump_logcat(logcat_dir) | ||||
|  | ||||
|     def teardown(self, context): | ||||
|         pass | ||||
| @@ -102,8 +102,3 @@ class ManualWorkload(Workload): | ||||
|             raise ConfigError(message) | ||||
|         if not self.user_triggered and not self.duration: | ||||
|             raise ConfigError('Either user_triggered must be ``True`` or duration must be > 0.') | ||||
|  | ||||
|         if self.enable_logcat is None: | ||||
|             self.enable_logcat = self.device.platform == "android" | ||||
|         elif self.enable_logcat and self.device.platform != "android": | ||||
|             raise ConfigError("The `enable_logcat` parameter can only be used on Android devices") | ||||
|   | ||||
| @@ -101,7 +101,7 @@ class Vellamo(AndroidUiAutoBenchmark): | ||||
|         for test in self.benchmarks:  # Get all scores from HTML files | ||||
|             filename = None | ||||
|             if test == "Browser": | ||||
|                 result_folder = self.device.path.join(self.device.package_data_directory, self.package, 'files') | ||||
|                 result_folder = self.device.path.join(context.device_manager.package_data_directory, self.package, 'files') | ||||
|                 for result_file in self.device.listdir(result_folder, as_root=True): | ||||
|                     if result_file.startswith("Browser"): | ||||
|                         filename = result_file | ||||
| @@ -110,7 +110,7 @@ class Vellamo(AndroidUiAutoBenchmark): | ||||
|  | ||||
|             device_file = self.device.path.join(self.device.package_data_directory, self.package, 'files', filename) | ||||
|             host_file = os.path.join(context.output_directory, filename) | ||||
|             self.device.pull_file(device_file, host_file, as_root=True) | ||||
|             self.device.pull(device_file, host_file, as_root=True) | ||||
|             with open(host_file) as fh: | ||||
|                 parser = VellamoResultParser() | ||||
|                 parser.feed(fh.read()) | ||||
| @@ -212,4 +212,3 @@ class VellamoResultParser(HTMLParser): | ||||
|                     self.benchmarks[-1].add_metric(data) | ||||
|                 else: | ||||
|                     self.failed = True | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user