1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-09-01 19:02:31 +01:00

Merge pull request #78 from ep1cman/binary_install

BaseLinuxDevice: Tidied up the way binaries are handled
This commit is contained in:
setrofim
2016-01-19 10:52:54 +00:00
15 changed files with 218 additions and 130 deletions

View File

@@ -80,6 +80,8 @@ class Antutu(AndroidUiAutoBenchmark):
info = ApkInfo(antutu_3d)
if not context.device.is_installed(info.package):
self.device.install_apk(antutu_3d, timeout=120)
# Antutu doesnt seem to list this as one of its permissions, but it asks for it.
self.device.execute("pm grant com.antutu.ABenchMark android.permission.ACCESS_FINE_LOCATION")
super(Antutu, self).setup(context)
def update_result(self, context):

View File

@@ -79,11 +79,8 @@ class Cyclictest(Workload):
if not self.device.is_rooted:
raise WorkloadError("This workload requires a device with root premissions to run")
if not self.device.is_installed('cyclictest'):
host_binary = context.resolver.get(Executable(self, self.device.abi, 'cyclictest'))
self.device_binary = self.device.install(host_binary)
else:
self.device_binary = 'cyclictest'
host_binary = context.resolver.get(Executable(self, self.device.abi, 'cyclictest'))
self.device_binary = self.device.install(host_binary)
self.cyclictest_command = self.cyclictest_command.format(self.device_binary,
0 if self.clock == 'monotonic' else 1,

View File

@@ -52,16 +52,13 @@ class Ebizzy(Workload):
def setup(self, context):
timeout_buf = 10
self.command = '{} -t {} -S {} -n {} {} > {}'
self.ebizzy_results = os.path.join(self.device.working_directory, results_txt)
self.ebizzy_results = self.device.path.join(self.device.working_directory, results_txt)
self.device_binary = None
self.run_timeout = self.seconds + timeout_buf
self.binary_name = 'ebizzy'
if not self.device.is_installed(self.binary_name):
host_binary = context.resolver.get(Executable(self, self.device.abi, self.binary_name))
self.device_binary = self.device.install(host_binary)
else:
self.device_binary = self.binary_name
host_binary = context.resolver.get(Executable(self, self.device.abi, self.binary_name))
self.device_binary = self.device.install_if_needed(host_binary)
self.command = self.command.format(self.device_binary, self.threads, self.seconds,
self.chunks, self.extra_params, self.ebizzy_results)

View File

@@ -61,11 +61,8 @@ class Hackbench(Workload):
self.run_timeout = self.duration + timeout_buf
self.binary_name = 'hackbench'
if not self.device.is_installed(self.binary_name):
host_binary = context.resolver.get(Executable(self, self.device.abi, self.binary_name))
self.device_binary = self.device.install(host_binary)
else:
self.device_binary = self.binary_name
host_binary = context.resolver.get(Executable(self, self.device.abi, self.binary_name))
self.device_binary = self.device.install(host_binary)
self.command = self.command.format(self.device_binary, self.datasize, self.groups,
self.loops, self.extra_params, self.hackbench_result)

View File

@@ -18,7 +18,7 @@
import os
import re
from wlauto import Workload, Parameter
from wlauto import Workload, Parameter, Executable
THIS_DIR = os.path.dirname(__file__)
@@ -54,11 +54,10 @@ class MemcpyTest(Workload):
]
def setup(self, context):
self.host_binary = os.path.join(THIS_DIR, 'memcpy')
if not self.device.is_installed('memcpy'):
self.device_binary = self.device.install(self.host_binary)
else:
self.device_binary = 'memcpy'
self.binary_name = 'memcpy'
host_binary = context.resolver.get(Executable(self, self.device.abi, self.binary_name))
self.device_binary = self.device.install_if_needed(host_binary)
self.command = '{} -i {} -s {}'.format(self.device_binary, self.iterations, self.buffer_size)
if self.cpus:
for c in self.cpus:

Binary file not shown.

View File

@@ -216,14 +216,13 @@ class RtApp(Workload):
def _deploy_rt_app_binary_if_necessary(self):
# called from initialize() so gets invoked once per run
if self.force_install or not self.device.is_installed(BINARY_NAME):
RtApp.device_binary = self.device.get_binary_path("rt-app")
if self.force_install or not RtApp.device_binary:
if not self.host_binary:
message = '''rt-app is not installed on the device and could not be
found in workload resources'''
raise ResourceError(message)
RtApp.device_binary = self.device.install(self.host_binary)
else:
RtApp.device_binary = BINARY_NAME
def _load_json_config(self, context):
user_config_file = self._get_raw_json_config(context.resolver)
@@ -280,4 +279,3 @@ class RtApp(Workload):
tf.extractall(context.output_directory)
os.remove(host_path)
self.device.execute('rm -rf {}/*'.format(self.device_working_directory))

View File

@@ -132,13 +132,13 @@ class Sysbench(Workload):
self.device.delete_file(self.results_file)
def _check_executable(self):
self.on_device_binary = self.device.path.join(self.device.binaries_directory, 'sysbench')
if self.device.is_installed('sysbench') and not self.force_install:
self.logger.debug('sysbench found on device')
return
if not self.on_host_binary:
self.on_device_binary = self.device.get_binary_path("sysbench")
if not self.on_device_binary and not self.on_host_binary:
raise WorkloadError('sysbench binary is not installed on the device, and it is not found on the host.')
self.device.install(self.on_host_binary)
if self.force_install:
self.device.install(self.on_host_binary)
else:
self.device.install_if_needed(self.on_host_binary)
def _build_command(self, **parameters):
param_strings = ['--{}={}'.format(k.replace('_', '-'), v)