diff --git a/Tools/autotest/arducopter.py b/Tools/autotest/arducopter.py index 2bcef0763b..c1e9181726 100644 --- a/Tools/autotest/arducopter.py +++ b/Tools/autotest/arducopter.py @@ -6681,19 +6681,28 @@ class AutoTestCopter(AutoTest): # inspect generated log for messages: dfreader = self.dfreader_for_current_onboard_log() wanted = set([0, 1, 2]) + seen_primary_change = False while True: - m = dfreader.recv_match(type="GPS") # disarmed + m = dfreader.recv_match(type=["GPS", "EV"]) # disarmed if m is None: break - try: - wanted.remove(m.I) - except KeyError: - continue - if len(wanted) == 0: + mtype = m.get_type() + if mtype == 'GPS': + try: + wanted.remove(m.I) + except KeyError: + continue + elif mtype == 'EV': + if m.Id == 67: # GPS_PRIMARY_CHANGED + seen_primary_change = True + if len(wanted) == 0 and seen_primary_change: break if len(wanted): raise NotAchievedException("Did not get all three GPS types") + if not seen_primary_change: + raise NotAchievedException("Did not see primary change") + except Exception as e: self.progress("Caught exception: %s" % self.get_exception_stacktrace(e))