From 39bb63c61ffec8239f24a54539c9a50669b40e91 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 8 May 2024 22:13:56 +1000 Subject: [PATCH] autotest: add test for partial-transfer after mission-upload --- Tools/autotest/rover.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Tools/autotest/rover.py b/Tools/autotest/rover.py index 26304003fb01c8..8df5e424c2be6a 100644 --- a/Tools/autotest/rover.py +++ b/Tools/autotest/rover.py @@ -6749,6 +6749,35 @@ def NetworkingWebServerPPP(self): shutil.copy('build/sitl/bin/ardurover.noppp', 'build/sitl/bin/ardurover') self.reboot_sitl() + def FenceFullAndPartialTransfer(self, target_system=1, target_component=1): + '''ensure starting a fence transfer then a partial transfer behaves + appropriately''' + # start uploading a 10 item list: + self.mav.mav.mission_count_send( + target_system, + target_component, + 10, + mavutil.mavlink.MAV_MISSION_TYPE_FENCE + ) + self.assert_receive_mission_item_request(mavutil.mavlink.MAV_MISSION_TYPE_FENCE, 0) + # change our mind and try a partial mission upload: + self.mav.mav.mission_write_partial_list_send( + target_system, + target_component, + 3, + 3, + mavutil.mavlink.MAV_MISSION_TYPE_FENCE) + # should get denied for that one: + self.assert_receive_mission_ack( + mavutil.mavlink.MAV_MISSION_TYPE_FENCE, + want_type=mavutil.mavlink.MAV_MISSION_DENIED, + ) + # now wait for the original upload to be "cancelled" + self.assert_receive_mission_ack( + mavutil.mavlink.MAV_MISSION_TYPE_FENCE, + want_type=mavutil.mavlink.MAV_MISSION_OPERATION_CANCELLED, + ) + def MissionRetransfer(self, target_system=1, target_component=1): '''torture-test with MISSION_COUNT''' # self.send_debug_trap() @@ -6870,6 +6899,7 @@ def tests(self): self.NetworkingWebServerPPP, self.RTL_SPEED, self.MissionRetransfer, + self.FenceFullAndPartialTransfer, ]) return ret