Tools: autotest: tidy handling of armed-at-end-of-test handling

This commit is contained in:
Peter Barker 2019-09-25 12:45:01 +10:00 committed by Peter Barker
parent 92160b454a
commit 4c40640238
1 changed files with 4 additions and 0 deletions

View File

@ -109,6 +109,9 @@ class PreconditionFailedException(ErrorException):
"""Thrown when a precondition for a test is not met"""
pass
class ArmedAtEndOfTestException(ErrorException):
"""Created when test left vehicle armed"""
pass
class Context(object):
def __init__(self):
@ -2053,6 +2056,7 @@ class AutoTest(ABC):
self.wait_heartbeat()
if self.armed():
ex = ArmedAtEndOfTestException("Still armed at end of test")
self.progress("Armed at end of test; force-rebooting SITL")
self.disarm_vehicle(force=True)
self.forced_post_test_sitl_reboots += 1