1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-09-03 11:52:36 +01:00

framework/tm: Ensure RebootPolicy is respected with unresponsive target

Expose the RebootPolicy as an attribute of the ExectionContext and ensure
that that the target is not automatically rebooted if the reboot
policy is set to "Never".
This commit is contained in:
Marc Bonnici
2018-05-22 17:45:59 +01:00
committed by setrofim
parent 78d5b18182
commit dc41af1f3f
3 changed files with 13 additions and 7 deletions

View File

@@ -83,10 +83,12 @@ class TargetManager(object):
def commit_runtime_parameters(self, parameters):
self.rpm.commit_runtime_parameters(parameters)
def verify_target_responsive(self):
def verify_target_responsive(self, can_reboot=True):
if not self.target.check_responsive(explode=False):
self.is_responsive = False
if self.target.has('hard_reset'):
if not can_reboot:
raise TargetNotRespondingError('Target unresponsive and is not allowed to reboot.')
elif self.target.has('hard_reset'):
self.logger.info('Target unresponsive; performing hard reset')
self.target.reboot(hard=True)
self.is_responsive = True