mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-18 12:06:08 +00:00
workloads: Update to better utilize cleanup_assets
and uninstall
Update the workload classes to attempt and standardize the use of the `cleanup_assets` parameter and the newly added `uninstall` parameter
This commit is contained in:
parent
f5d1a9e94a
commit
1108c5701e
@ -358,6 +358,7 @@ class ApkUIWorkload(ApkWorkload):
|
||||
@once_per_instance
|
||||
def finalize(self, context):
|
||||
super(ApkUIWorkload, self).finalize(context)
|
||||
if self.cleanup_assets:
|
||||
self.gui.remove()
|
||||
|
||||
|
||||
@ -438,6 +439,7 @@ class UIWorkload(Workload):
|
||||
@once_per_instance
|
||||
def finalize(self, context):
|
||||
super(UIWorkload, self).finalize(context)
|
||||
if self.cleanup_assets:
|
||||
self.gui.remove()
|
||||
|
||||
|
||||
@ -634,12 +636,12 @@ class ReventGUI(object):
|
||||
if self.revent_teardown_file:
|
||||
self.revent_recorder.replay(self.on_target_teardown_revent,
|
||||
timeout=self.teardown_timeout)
|
||||
|
||||
def remove(self):
|
||||
self.target.remove(self.on_target_setup_revent)
|
||||
self.target.remove(self.on_target_run_revent)
|
||||
self.target.remove(self.on_target_extract_results_revent)
|
||||
self.target.remove(self.on_target_teardown_revent)
|
||||
|
||||
def remove(self):
|
||||
self.revent_recorder.remove()
|
||||
|
||||
def _check_revent_files(self):
|
||||
|
@ -153,6 +153,7 @@ class Dhrystone(Workload):
|
||||
|
||||
@once
|
||||
def finalize(self, context):
|
||||
if self.uninstall:
|
||||
self.target.uninstall('dhrystone')
|
||||
|
||||
def validate(self):
|
||||
|
@ -90,8 +90,10 @@ class Hackbench(Workload):
|
||||
context.add_metric(label, float(match.group(1)), units)
|
||||
|
||||
def teardown(self, context):
|
||||
if self.cleanup_assets:
|
||||
self.target.execute('rm -f {}'.format(self.target_output_file))
|
||||
|
||||
@once
|
||||
def finalize(self, context):
|
||||
if self.uninstall:
|
||||
self.target.uninstall(self.binary_name)
|
||||
|
@ -120,5 +120,5 @@ class HWUITest(Workload):
|
||||
|
||||
@once
|
||||
def finalize(self, context):
|
||||
if self.target_exe:
|
||||
if self.target_exe and self.uninstall:
|
||||
self.target.uninstall(self.target_exe)
|
||||
|
@ -117,6 +117,7 @@ class Lmbench(Workload):
|
||||
context.add_artifact('lmbench-result', "lmbench.output", kind='raw')
|
||||
|
||||
def teardown(self, context):
|
||||
if self.uninstall:
|
||||
self.target.uninstall(self.test)
|
||||
|
||||
#
|
||||
|
@ -286,6 +286,7 @@ class Meabo(Workload):
|
||||
int(match.group('duration')), units="ns")
|
||||
|
||||
def finalize(self, context):
|
||||
if self.uninstall:
|
||||
self._uninstall_executable()
|
||||
|
||||
def _build_command(self):
|
||||
|
@ -86,4 +86,5 @@ class Memcpy(Workload):
|
||||
|
||||
@once
|
||||
def finalize(self, context):
|
||||
if self.uninstall:
|
||||
self.target.uninstall('memcpy')
|
||||
|
@ -156,5 +156,5 @@ class Openssl(Workload):
|
||||
|
||||
@once
|
||||
def finalize(self, context):
|
||||
if not self.use_system_binary:
|
||||
if not self.use_system_binary and self.uninstall:
|
||||
self.target.uninstall('openssl')
|
||||
|
@ -130,8 +130,8 @@ class RtApp(Workload):
|
||||
'''),
|
||||
Parameter('cpus', kind=cpu_mask, default=0, aliases=['taskset_mask'],
|
||||
description='Constrain execution to specific CPUs.'),
|
||||
Parameter('uninstall_on_exit', kind=bool, default=False,
|
||||
description="""
|
||||
Parameter('uninstall', aliases=['uninstall_on_exit'], kind=bool, default=False,
|
||||
override=True, description="""
|
||||
If set to ``True``, rt-app binary will be uninstalled from the device
|
||||
at the end of the run.
|
||||
"""),
|
||||
@ -213,8 +213,9 @@ class RtApp(Workload):
|
||||
|
||||
@once
|
||||
def finalize(self, context):
|
||||
if self.uninstall_on_exit:
|
||||
if self.uninstall:
|
||||
self.target.uninstall(self.target_binary)
|
||||
if self.cleanup_assets:
|
||||
self.target.execute('rm -rf {}'.format(self.target_working_directory))
|
||||
|
||||
def _deploy_rt_app_binary_if_necessary(self):
|
||||
|
@ -67,4 +67,5 @@ class ShellScript(Workload):
|
||||
wfh.write(self.output)
|
||||
|
||||
def teardown(self, context):
|
||||
if self.cleanup_assets:
|
||||
self.target.remove(self.on_target_script_file)
|
||||
|
@ -131,4 +131,5 @@ class StressNg(Workload):
|
||||
|
||||
@once
|
||||
def finalize(self, context):
|
||||
if self.uninstall:
|
||||
self.target.uninstall('stress-ng')
|
||||
|
@ -147,10 +147,12 @@ class Sysbench(Workload):
|
||||
extract_threads_fairness_metric('execution time', next(fh), context.output)
|
||||
|
||||
def teardown(self, context):
|
||||
if self.cleanup_assets:
|
||||
self.target.remove(self.target_results_file)
|
||||
|
||||
@once
|
||||
def finalize(self, context):
|
||||
if self.uninstall:
|
||||
self.target.uninstall('sysbench')
|
||||
|
||||
def _build_command(self, **parameters):
|
||||
|
Loading…
x
Reference in New Issue
Block a user