1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-06 02:41:11 +01:00

fw: implement reboot signals

- Wire up reboot signals via the TargetManager
- Add instrument mappings for the same.
This commit is contained in:
Sergei Trofimov 2018-05-29 09:40:39 +01:00 committed by Marc Bonnici
parent 3a6fcd688e
commit 43d047eeb5
3 changed files with 11 additions and 6 deletions

View File

@ -354,7 +354,7 @@ class Executor(object):
attempts = config_manager.run_config.max_retries
while attempts:
try:
self.target_manager.target.reboot()
self.target_manager.reboot()
except TargetError as e:
if attempts:
attempts -= 1
@ -504,10 +504,10 @@ class Runner(object):
log.indent()
if self.context.reboot_policy.reboot_on_each_job:
self.logger.info('Rebooting on new job.')
self.context.tm.target.reboot()
self.context.tm.reboot()
elif self.context.reboot_policy.reboot_on_each_spec and context.spec_changed:
self.logger.info('Rebooting on new spec.')
self.context.tm.target.reboot()
self.context.tm.reboot()
with signal.wrap('JOB', self, context):
context.tm.start()

View File

@ -135,6 +135,10 @@ SIGNAL_MAP = OrderedDict([
('on_successful_job', signal.SUCCESSFUL_JOB),
('after_job', signal.AFTER_JOB),
('before_reboot', signal.BEFORE_REBOOT),
('on_successful_reboot', signal.SUCCESSFUL_REBOOT),
('after_reboot', signal.AFTER_REBOOT),
('on_error', signal.ERROR_LOGGED),
('on_warning', signal.WARNING_LOGGED),
@ -151,9 +155,6 @@ SIGNAL_MAP = OrderedDict([
# ('before_first_iteration_boot', signal.BEFORE_FIRST_ITERATION_BOOT),
# ('on_successful_first_iteration_boot', signal.SUCCESSFUL_FIRST_ITERATION_BOOT),
# ('after_first_iteration_boot', signal.AFTER_FIRST_ITERATION_BOOT),
# ('before_boot', signal.BEFORE_BOOT),
# ('on_successful_boot', signal.SUCCESSFUL_BOOT),
# ('after_boot', signal.AFTER_BOOT),
# ('on_spec_init', signal.SPEC_INIT),
# ('on_run_init', signal.RUN_INIT),

View File

@ -74,6 +74,10 @@ class TargetManager(object):
def get_target_info(self):
return get_target_info(self.target)
def reboot(self):
with signal.wrap('REBOOT'):
self.target.reboot()
def merge_runtime_parameters(self, parameters):
return self.rpm.merge_runtime_parameters(parameters)