From ebc781ba3a034a0c833a53e88a23737d14d2c51e Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sun, 3 May 2020 10:52:12 +1000 Subject: [PATCH] autotest: switch to looking for barometer update string for passthrough test MAVProxy can fetch parameters using FTP rather than normal param mechanism. Currently this does not emit any of our statustext information - like the text we're looking for in this test --- Tools/autotest/common.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/Tools/autotest/common.py b/Tools/autotest/common.py index 2b4d854cf9..feec781c3f 100644 --- a/Tools/autotest/common.py +++ b/Tools/autotest/common.py @@ -5165,15 +5165,29 @@ switch value''' self.wait_ready_to_arm() # test we get statustext strings. This relies on ArduPilot - # emitting statustext strings when we fetch parameters. - self.mavproxy.send("param fetch\n") + # emitting statustext strings when we fetch parameters. (or, + # now, an updating-barometer statustext) tstart = self.get_sim_time_cached() old_data = None text = "" + sent_request = False while True: now = self.get_sim_time() if now - tstart > 60: # it can take a *long* time to get these messages down! raise NotAchievedException("Did not get statustext in time") + if now - tstart > 30 and not sent_request: + # have to wait this long or our message gets squelched.... + sent_request = True +# self.mavproxy.send("param fetch\n") + self.run_cmd(mavutil.mavlink.MAV_CMD_PREFLIGHT_CALIBRATION, + 0, #p1 + 0, #p2 + 1, #p3, baro + 0, #p4 + 0, #p5 + 0, #p6 + 0, #p7 + ) frsky.update() data = frsky.get_data(0x5000) # no timestamping on this data, so we can't catch legitimate repeats. if data is None: @@ -5195,7 +5209,9 @@ switch value''' if (x & 0x7f) == 0x00: last = True if last: - m = re.match("Ardu(Plane|Copter|Rover|Tracker|Sub) V[345]", text) + # we used to do a 'param fetch' and expect this back, but the params-via-ftp thing broke it. +# m = re.match("Ardu(Plane|Copter|Rover|Tracker|Sub) V[345]", text) + m = re.match("Updating barometer calibration", text) if m is not None: want_sev = mavutil.mavlink.MAV_SEVERITY_INFO if severity != want_sev: