autotest: add test for partial-transfer after mission-upload

This commit is contained in:
Peter Barker 2024-05-08 22:13:56 +10:00 committed by Peter Barker
parent 2891b37807
commit 39bb63c61f

View File

@ -6749,6 +6749,35 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm)
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 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm)
self.NetworkingWebServerPPP,
self.RTL_SPEED,
self.MissionRetransfer,
self.FenceFullAndPartialTransfer,
])
return ret