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

fw/execution: Handle unresponsive targets

If a target error occurs, check whether the target is unresponsive. If
it is, attempt to hard reset it if possible, or gracefully terminate
execution if not.
This commit is contained in:
Sergei Trofimov
2018-02-28 10:24:56 +00:00
committed by Marc Bonnici
parent fdb872d9cd
commit 6fe31d6cad
4 changed files with 40 additions and 15 deletions

View File

@@ -1,7 +1,7 @@
import logging
from wa.framework import signal
from wa.framework.exception import ExecutionError, TargetError
from wa.framework.exception import ExecutionError, TargetError, TargetNotRespondingError
from wa.framework.plugin import Parameter
from wa.framework.target.descriptor import (get_target_description,
instantiate_target,
@@ -90,8 +90,9 @@ class TargetManager(object):
self.logger.info('Target unresponsive; performing hard reset')
self.target.reboot(hard=True)
self.is_responsive = True
raise ExecutionError('Target became unresponsive but was recovered.')
else:
raise ExecutionError('Target unresponsive and hard reset not supported; bailing.')
raise TargetNotRespondingError('Target unresponsive and hard reset not supported; bailing.')
def _init_target(self):
tdesc = get_target_description(self.target_name)