Skip to content

Commit

Permalink
autotest: add test for partial-transfer after mission-upload
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed May 15, 2024
1 parent 2891b37 commit 39bb63c
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions Tools/autotest/rover.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -6870,6 +6899,7 @@ def tests(self):
self.NetworkingWebServerPPP,
self.RTL_SPEED,
self.MissionRetransfer,
self.FenceFullAndPartialTransfer,
])
return ret

Expand Down

0 comments on commit 39bb63c

Please sign in to comment.