1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-31 18:21:14 +00:00

Merge pull request #528 from bjackman/geekbench-fixes

Geekbench fixes
This commit is contained in:
setrofim 2017-10-26 08:01:35 +01:00 committed by GitHub
commit 6df4b33d3f

View File

@ -122,9 +122,11 @@ class Geekbench(ApkUiautoWorkload):
def initialize(self, context): def initialize(self, context):
super(Geekbench, self).initialize(context) super(Geekbench, self).initialize(context)
if not self.target.is_rooted: if not self.disable_update_result and not self.target.is_rooted:
raise WorkloadError( raise WorkloadError(
'Geekbench workload requires root to collect results') 'Geekbench workload requires root to collect results. '
'You can set disable_update_result=True in the workload params '
'to run without collecting results.')
def setup(self, context): def setup(self, context):
super(Geekbench, self).setup(context) super(Geekbench, self).setup(context)
@ -153,7 +155,7 @@ class Geekbench(ApkUiautoWorkload):
as_root=True).split('\n') if f] as_root=True).split('\n') if f]
for i, on_target_output_file in enumerate(on_target_output_files): for i, on_target_output_file in enumerate(on_target_output_files):
host_temp_file = tempfile.mktemp() host_temp_file = tempfile.mktemp()
self.target.pull(on_target_output_file, host_temp_file) self.target.pull(on_target_output_file, host_temp_file, as_root=True)
host_output_file = os.path.join(context.output_directory, os.path.basename(on_target_output_file)) host_output_file = os.path.join(context.output_directory, os.path.basename(on_target_output_file))
with open(host_temp_file) as fh: with open(host_temp_file) as fh:
data = json.load(fh) data = json.load(fh)
@ -175,7 +177,7 @@ class Geekbench(ApkUiautoWorkload):
as_root=True).split('\n') if f] as_root=True).split('\n') if f]
for i, on_target_output_file in enumerate(on_target_output_files): for i, on_target_output_file in enumerate(on_target_output_files):
host_temp_file = tempfile.mktemp() host_temp_file = tempfile.mktemp()
self.target.pull(on_target_output_file, host_temp_file) self.target.pull(on_target_output_file, host_temp_file, as_root=True)
host_output_file = os.path.join(context.output_directory, os.path.basename(on_target_output_file)) host_output_file = os.path.join(context.output_directory, os.path.basename(on_target_output_file))
with open(host_temp_file) as fh: with open(host_temp_file) as fh:
data = json.load(fh) data = json.load(fh)