Skip to content

Commit

Permalink
autotest: add test for MAV_CMD_MISSION_START sanity checks
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Aug 15, 2024
1 parent 6309489 commit 47bd584
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Tools/autotest/arducopter.py
Original file line number Diff line number Diff line change
Expand Up @@ -11729,6 +11729,36 @@ def BatteryInternalUseOnly(self):
"id": 1
})

def MAV_CMD_MISSION_START_p1_p2(self):
'''make sure we deny MAV_CMD_MISSION_START if either p1 or p2 non-zero'''
self.upload_simple_relhome_mission([
(mavutil.mavlink.MAV_CMD_NAV_TAKEOFF, 0, 0, 20),
])
self.set_parameters({
"AUTO_OPTIONS": 3,
})
self.change_mode('AUTO')
self.wait_ready_to_arm()

self.run_cmd(
mavutil.mavlink.MAV_CMD_MISSION_START,
p1=1,
want_result=mavutil.mavlink.MAV_RESULT_DENIED,
)

self.run_cmd(
mavutil.mavlink.MAV_CMD_MISSION_START,
p2=1,
want_result=mavutil.mavlink.MAV_RESULT_DENIED,
)

self.run_cmd(
mavutil.mavlink.MAV_CMD_MISSION_START,
p1=1,
p2=1,
want_result=mavutil.mavlink.MAV_RESULT_DENIED,
)

def tests2b(self): # this block currently around 9.5mins here
'''return list of all tests'''
ret = ([
Expand Down Expand Up @@ -11828,6 +11858,7 @@ def tests2b(self): # this block currently around 9.5mins here
self.LoggingFormat,
self.MissionRTLYawBehaviour,
self.BatteryInternalUseOnly,
self.MAV_CMD_MISSION_START_p1_p2,
])
return ret

Expand Down

0 comments on commit 47bd584

Please sign in to comment.