autotest: copter: catch exception on test_gcs_failsafe to reset parameters

This commit is contained in:
Pierre Kancir 2020-08-11 11:40:46 +02:00 committed by Peter Barker
parent 9c41462bf6
commit 5fe81706bb

View File

@ -672,6 +672,15 @@ class AutoTestCopter(AutoTest):
# Tests all actions and logic behind the GCS failsafe
def fly_gcs_failsafe(self, side=60, timeout=360):
try:
self.test_gcs_failsafe(side=side, timeout=timeout)
except Exception as ex:
self.setGCSfailsafe(0)
self.set_parameter('FS_OPTIONS', 0)
self.reboot_sitl()
raise ex
def test_gcs_failsafe(self, side=60, timeout=360):
# Trigger telemety loss with failsafe disabled. Verify no action taken.
self.start_subtest("GCS failsafe disabled test: FS_GCS_ENABLE=0 should take no failsafe action")
self.setGCSfailsafe(0)