autotest: move do_aux_function to common

This commit is contained in:
Andrew Tridgell 2022-09-29 10:53:05 +10:00
parent 3f4c5e243e
commit 9dd2301198
2 changed files with 16 additions and 16 deletions

View File

@ -3440,22 +3440,6 @@ class AutoTestPlane(AutoTest):
attempt_fence_breached_disable(start_mode="FBWA", end_mode="FBWA", expected_mode="GUIDED", action=6) attempt_fence_breached_disable(start_mode="FBWA", end_mode="FBWA", expected_mode="GUIDED", action=6)
attempt_fence_breached_disable(start_mode="FBWA", end_mode="FBWA", expected_mode="GUIDED", action=7) attempt_fence_breached_disable(start_mode="FBWA", end_mode="FBWA", expected_mode="GUIDED", action=7)
def run_auxfunc(self,
function,
level,
want_result=mavutil.mavlink.MAV_RESULT_ACCEPTED):
self.run_cmd(
mavutil.mavlink.MAV_CMD_DO_AUX_FUNCTION,
function, # p1
level, # p2
0, # p3
0, # p4
0, # p5
0, # p6
0, # p7
want_result=want_result
)
def MAV_DO_AUX_FUNCTION(self): def MAV_DO_AUX_FUNCTION(self):
'''Test triggering Auxiliary Functions via mavlink''' '''Test triggering Auxiliary Functions via mavlink'''
self.context_collect('STATUSTEXT') self.context_collect('STATUSTEXT')

View File

@ -3400,6 +3400,22 @@ class AutoTest(ABC):
def get_mission_count(self): def get_mission_count(self):
return self.get_parameter("MIS_TOTAL") return self.get_parameter("MIS_TOTAL")
def run_auxfunc(self,
function,
level,
want_result=mavutil.mavlink.MAV_RESULT_ACCEPTED):
self.run_cmd(
mavutil.mavlink.MAV_CMD_DO_AUX_FUNCTION,
function, # p1
level, # p2
0, # p3
0, # p4
0, # p5
0, # p6
0, # p7
want_result=want_result
)
def assert_mission_count(self, expected): def assert_mission_count(self, expected):
count = self.get_mission_count() count = self.get_mission_count()
if count != expected: if count != expected: