autotest: tidy pre_arm_checks

This commit is contained in:
Peter Barker 2024-05-22 14:29:39 +10:00 committed by Andrew Tridgell
parent a9eb6051fa
commit bac008d51c

View File

@ -5443,6 +5443,19 @@ class AutoTestPlane(vehicle_test_suite.TestSuite):
self.context_pop()
self.reboot_sitl()
def GPSPreArms(self):
'''ensure GPS prearm checks work'''
self.wait_ready_to_arm()
self.start_subtest('DroneCAN sanity checks')
self.set_parameter('GPS1_TYPE', 9)
self.set_parameter('GPS2_TYPE', 9)
self.set_parameter('GPS1_CAN_OVRIDE', 130)
self.set_parameter('GPS2_CAN_OVRIDE', 130)
self.assert_prearm_failure(
"set for multiple GPS",
other_prearm_failures_fatal=False,
)
def tests(self):
'''return list of all tests'''
ret = super(AutoTestPlane, self).tests()
@ -5555,6 +5568,7 @@ class AutoTestPlane(vehicle_test_suite.TestSuite):
self.ClimbThrottleSaturation,
self.GuidedAttitudeNoGPS,
self.ScriptStats,
self.GPSPreArms,
])
return ret