From a7f23b477cda1a3d080d0b340fbd78f1c4d7f7d0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 29 Sep 2022 10:53:05 +1000 Subject: [PATCH] autotest: move do_aux_function to common --- Tools/autotest/arduplane.py | 16 ---------------- Tools/autotest/common.py | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Tools/autotest/arduplane.py b/Tools/autotest/arduplane.py index 71e9401559..ef02ebe3f2 100644 --- a/Tools/autotest/arduplane.py +++ b/Tools/autotest/arduplane.py @@ -3393,22 +3393,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=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): '''Test triggering Auxiliary Functions via mavlink''' self.context_collect('STATUSTEXT') diff --git a/Tools/autotest/common.py b/Tools/autotest/common.py index cbb9e75b13..e132bd860d 100644 --- a/Tools/autotest/common.py +++ b/Tools/autotest/common.py @@ -3398,6 +3398,22 @@ class AutoTest(ABC): def get_mission_count(self): 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): count = self.get_mission_count() if count != expected: