mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-31 10:11:17 +00:00
framework/execution: Implement reboot policies
Although the configuration of reboot policies was present the actual implementation was missing.
This commit is contained in:
parent
1a67a3a4e5
commit
78d5b18182
@ -78,8 +78,8 @@ class RebootPolicy(object):
|
|||||||
return self.policy != 'never'
|
return self.policy != 'never'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def perform_initial_boot(self):
|
def perform_initial_reboot(self):
|
||||||
return self.policy not in ['never', 'as_needed']
|
return self.policy == 'initial'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def reboot_on_each_job(self):
|
def reboot_on_each_job(self):
|
||||||
|
@ -327,6 +327,9 @@ class Executor(object):
|
|||||||
self.target_manager = TargetManager(config.run_config.device,
|
self.target_manager = TargetManager(config.run_config.device,
|
||||||
config.run_config.device_config,
|
config.run_config.device_config,
|
||||||
output.basepath)
|
output.basepath)
|
||||||
|
|
||||||
|
if config_manager.run_config.reboot_policy.perform_initial_reboot:
|
||||||
|
self.target_manager.target.reboot()
|
||||||
output.set_target_info(self.target_manager.get_target_info())
|
output.set_target_info(self.target_manager.get_target_info())
|
||||||
|
|
||||||
self.logger.info('Initializing execution context')
|
self.logger.info('Initializing execution context')
|
||||||
@ -461,6 +464,10 @@ class Runner(object):
|
|||||||
signal.disconnect(self._warning_signalled_callback, signal.WARNING_LOGGED)
|
signal.disconnect(self._warning_signalled_callback, signal.WARNING_LOGGED)
|
||||||
|
|
||||||
def run_next_job(self, context):
|
def run_next_job(self, context):
|
||||||
|
if self.config.run_config.reboot_policy.reboot_on_each_job:
|
||||||
|
self.logger.debug('Rebooting on new job.')
|
||||||
|
self.context.tm.target.reboot()
|
||||||
|
|
||||||
job = context.start_job()
|
job = context.start_job()
|
||||||
self.logger.info('Running job {}'.format(job.id))
|
self.logger.info('Running job {}'.format(job.id))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user