From 3ae83d70b13280f20e60eb17c51a7634b572d4ce Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 26 Aug 2020 11:06:42 +1000 Subject: [PATCH] autotest: ensure df log is present for rangefinder tests there may not be a current onboard log present if we've just rebooted --- Tools/autotest/arducopter.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Tools/autotest/arducopter.py b/Tools/autotest/arducopter.py index d7177e7074..05c1bd7991 100644 --- a/Tools/autotest/arducopter.py +++ b/Tools/autotest/arducopter.py @@ -2204,14 +2204,11 @@ class AutoTestCopter(AutoTest): def test_rangefinder(self): ex = None self.context_push() + self.progress("Making sure we don't ordinarily get RANGEFINDER") - try: - m = self.mav.recv_match(type='RANGEFINDER', - blocking=True, - timeout=5) - except Exception as e: - self.progress("Caught exception: %s" % - self.get_exception_stacktrace(e)) + m = self.mav.recv_match(type='RANGEFINDER', + blocking=True, + timeout=5) if m is not None: raise NotAchievedException("Received unexpected RANGEFINDER msg") @@ -2219,6 +2216,7 @@ class AutoTestCopter(AutoTest): # may need to force a rotation if some other test has used the # rangefinder... self.progress("Ensure no RFND messages in log") + self.set_parameter("LOG_DISARMED", 1) if self.current_onboard_log_contains_message("RFND"): raise NotAchievedException("Found unexpected RFND message")