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

Merge pull request #232 from ep1cman/cleanup

Cleanup
This commit is contained in:
setrofim 2016-08-26 17:32:50 +01:00 committed by GitHub
commit 5b59d101ef
4 changed files with 10 additions and 1 deletions

View File

@ -342,7 +342,7 @@ class AndroidDevice(BaseLinuxDevice): # pylint: disable=W0223
def delete_file(self, filepath, as_root=False): # pylint: disable=W0221
self._check_ready()
adb_shell(self.adb_name, "rm '{}'".format(filepath), as_root=as_root, timeout=self.default_timeout)
adb_shell(self.adb_name, "rm -rf '{}'".format(filepath), as_root=as_root, timeout=self.default_timeout)
def file_exists(self, filepath):
self._check_ready()

View File

@ -54,6 +54,9 @@ retry_on_status = ['FAILED', 'PARTIAL']
# How many times a job will be re-run before giving up
max_retries = 3
# If WA should delete its files from the device after the run is completed
clean_up = False
####################################################################################################
######################################### Device Settings ##########################################
####################################################################################################

View File

@ -481,6 +481,7 @@ class RunConfiguration(object):
RunConfigurationItem('flashing_config', 'dict', 'replace'),
RunConfigurationItem('retry_on_status', 'list', 'replace'),
RunConfigurationItem('max_retries', 'scalar', 'replace'),
RunConfigurationItem('clean_up', 'scalar', 'replace'),
]
# Configuration specified for each workload spec. "workload_parameters"

View File

@ -344,6 +344,11 @@ class Executor(object):
runner = self._get_runner(result_manager)
runner.init_queue(self.config.workload_specs)
runner.run()
if getattr(self.config, "clean_up", False):
self.logger.info('Clearing WA files from device')
self.device.delete_file(self.device.binaries_directory)
self.device.delete_file(self.device.working_directory)
self.execute_postamble()
def execute_postamble(self):