|
|
|
@ -1210,7 +1210,7 @@ class AutoTest(ABC):
@@ -1210,7 +1210,7 @@ class AutoTest(ABC):
|
|
|
|
|
_show_test_timings=False, |
|
|
|
|
logs_dir=None, |
|
|
|
|
force_ahrs_type=None, |
|
|
|
|
sup_binary=None): |
|
|
|
|
sup_binaries=[]): |
|
|
|
|
|
|
|
|
|
self.start_time = time.time() |
|
|
|
|
global __autotest__ # FIXME; make progress a non-staticmethod |
|
|
|
@ -1229,7 +1229,7 @@ class AutoTest(ABC):
@@ -1229,7 +1229,7 @@ class AutoTest(ABC):
|
|
|
|
|
self.breakpoints = breakpoints |
|
|
|
|
self.disable_breakpoints = disable_breakpoints |
|
|
|
|
self.speedup = speedup |
|
|
|
|
self.sup_binary = sup_binary |
|
|
|
|
self.sup_binaries = sup_binaries |
|
|
|
|
|
|
|
|
|
self.mavproxy = None |
|
|
|
|
self.mav = None |
|
|
|
@ -5394,7 +5394,7 @@ Also, ignores heartbeats not from our target system'''
@@ -5394,7 +5394,7 @@ Also, ignores heartbeats not from our target system'''
|
|
|
|
|
raise AutoTestTimeoutException("Failed to get EKF.flags=%u disabled" % not_required_value) |
|
|
|
|
|
|
|
|
|
def wait_text(self, *args, **kwargs): |
|
|
|
|
self.wait_statustext(*args, **kwargs) |
|
|
|
|
return self.wait_statustext(*args, **kwargs) |
|
|
|
|
|
|
|
|
|
def statustext_in_collections(self, text, regex=False): |
|
|
|
|
c = self.context_get() |
|
|
|
@ -5421,13 +5421,15 @@ Also, ignores heartbeats not from our target system'''
@@ -5421,13 +5421,15 @@ Also, ignores heartbeats not from our target system'''
|
|
|
|
|
if check_context: |
|
|
|
|
if self.statustext_in_collections(text, regex=regex): |
|
|
|
|
self.progress("Found expected text in collection: %s" % text.lower()) |
|
|
|
|
return |
|
|
|
|
return text |
|
|
|
|
|
|
|
|
|
global statustext_found |
|
|
|
|
global statustext_full |
|
|
|
|
statustext_found = False |
|
|
|
|
|
|
|
|
|
def mh(mav, m): |
|
|
|
|
global statustext_found |
|
|
|
|
global statustext_full |
|
|
|
|
if m.get_type() != "STATUSTEXT": |
|
|
|
|
return |
|
|
|
|
if regex: |
|
|
|
@ -5437,6 +5439,8 @@ Also, ignores heartbeats not from our target system'''
@@ -5437,6 +5439,8 @@ Also, ignores heartbeats not from our target system'''
|
|
|
|
|
if text.lower() in m.text.lower(): |
|
|
|
|
self.progress("Received expected text: %s" % m.text.lower()) |
|
|
|
|
statustext_found = True |
|
|
|
|
statustext_full = m.text |
|
|
|
|
|
|
|
|
|
self.install_message_hook(mh) |
|
|
|
|
if wallclock_timeout: |
|
|
|
|
tstart = time.time() |
|
|
|
@ -5456,6 +5460,8 @@ Also, ignores heartbeats not from our target system'''
@@ -5456,6 +5460,8 @@ Also, ignores heartbeats not from our target system'''
|
|
|
|
|
self.mav.recv_match(type='STATUSTEXT', blocking=True, timeout=0.1) |
|
|
|
|
finally: |
|
|
|
|
self.remove_message_hook(mh) |
|
|
|
|
if statustext_found: |
|
|
|
|
return statustext_full |
|
|
|
|
|
|
|
|
|
def get_mavlink_connection_going(self): |
|
|
|
|
# get a mavlink connection going |
|
|
|
@ -5720,12 +5726,17 @@ Also, ignores heartbeats not from our target system'''
@@ -5720,12 +5726,17 @@ Also, ignores heartbeats not from our target system'''
|
|
|
|
|
self.progress("Starting SITL", send_statustext=False) |
|
|
|
|
self.sitl = util.start_SITL(self.binary, **start_sitl_args) |
|
|
|
|
self.expect_list_add(self.sitl) |
|
|
|
|
if self.sup_binary is not None: |
|
|
|
|
self.progress("Starting Supplementary Program") |
|
|
|
|
self.sup_prog = util.start_SITL(self.sup_binary, **start_sitl_args) |
|
|
|
|
self.expect_list_add(self.sup_prog) |
|
|
|
|
else: |
|
|
|
|
self.sup_prog = None |
|
|
|
|
self.sup_prog = [] |
|
|
|
|
for sup_binary in self.sup_binaries: |
|
|
|
|
self.progress("Starting Supplementary Program ", sup_binary) |
|
|
|
|
start_sitl_args["customisations"] = [sup_binary[1]] |
|
|
|
|
start_sitl_args["supplementary"] = True |
|
|
|
|
sup_prog_link = util.start_SITL(sup_binary[0], **start_sitl_args) |
|
|
|
|
self.sup_prog.append(sup_prog_link) |
|
|
|
|
self.expect_list_add(sup_prog_link) |
|
|
|
|
|
|
|
|
|
def get_suplementary_programs(self): |
|
|
|
|
return self.sup_prog |
|
|
|
|
|
|
|
|
|
def sitl_is_running(self): |
|
|
|
|
if self.sitl is None: |
|
|
|
@ -5755,6 +5766,12 @@ Also, ignores heartbeats not from our target system'''
@@ -5755,6 +5766,12 @@ Also, ignores heartbeats not from our target system'''
|
|
|
|
|
|
|
|
|
|
util.expect_setup_callback(self.mavproxy, self.expect_callback) |
|
|
|
|
|
|
|
|
|
self.expect_list_clear() |
|
|
|
|
if len(self.sup_prog): |
|
|
|
|
self.expect_list_extend([self.sitl, self.mavproxy]) |
|
|
|
|
else: |
|
|
|
|
self.expect_list_extend([self.sitl, self.mavproxy] + self.sup_prog) |
|
|
|
|
|
|
|
|
|
# need to wait for a heartbeat to arrive as then mavutil will |
|
|
|
|
# select the correct set of messages for us to receive in |
|
|
|
|
# self.mav.messages. You can actually recieve messages with |
|
|
|
|