Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autotest: remove special-case-for-reboot for Sub #26473

Merged
merged 1 commit into from Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 0 additions & 41 deletions Tools/autotest/ardusub.py
Expand Up @@ -10,7 +10,6 @@
from __future__ import print_function
import os
import sys
import time

from pymavlink import mavutil

Expand Down Expand Up @@ -480,39 +479,6 @@ def SET_POSITION_TARGET_GLOBAL_INT(self):
self.change_mode('MANUAL')
self.disarm_vehicle()

def reboot_sitl(self):
"""Reboot SITL instance and wait it to reconnect."""
# our battery is reset to full on reboot. So reduce it to 10%
# and wait for it to go above 50.
self.run_cmd(
mavutil.mavlink.MAV_CMD_BATTERY_RESET,
p1=65535, # battery mask
p2=10, # percentage
)
self.run_cmd_reboot()
tstart = time.time()
while True:
if time.time() - tstart > 30:
raise NotAchievedException("Did not detect reboot")
# ask for the message:
batt = None
try:
self.send_cmd(
mavutil.mavlink.MAV_CMD_REQUEST_MESSAGE,
p1=mavutil.mavlink.MAVLINK_MSG_ID_BATTERY_STATUS,
)
batt = self.mav.recv_match(type='BATTERY_STATUS',
blocking=True,
timeout=1)
except ConnectionResetError:
pass
self.progress("Battery: %s" % str(batt))
if batt is None:
continue
if batt.battery_remaining > 50:
break
self.initialise_after_reboot_sitl()

def DoubleCircle(self):
'''Test entering circle twice'''
self.change_mode('CIRCLE')
Expand All @@ -527,13 +493,6 @@ def default_parameter_list(self):
ret["FS_GCS_ENABLE"] = 0 # FIXME
return ret

def disabled_tests(self):
ret = super(AutoTestSub, self).disabled_tests()
ret.update({
"ConfigErrorLoop": "Sub does not instantiate AP_Stats. Also see https://github.com/ArduPilot/ardupilot/issues/10247", # noqa
})
return ret

def MAV_CMD_NAV_LOITER_UNLIM(self):
'''test handling of MAV_CMD_NAV_LOITER_UNLIM received via mavlink'''
for cmd in self.run_cmd, self.run_cmd_int:
Expand Down