From 5784acd55f77945cb2d87ae6adee86860facce84 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 26 Nov 2011 19:16:56 +1100 Subject: [PATCH] autotest: fixed log dump log numbers are no longer sequential --- Tools/autotest/autotest.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Tools/autotest/autotest.py b/Tools/autotest/autotest.py index d2a48e00d8..57a0fd4c05 100755 --- a/Tools/autotest/autotest.py +++ b/Tools/autotest/autotest.py @@ -42,14 +42,18 @@ def dump_logs(atype): mavproxy.expect(']') mavproxy.send("logs\n") mavproxy.expect("logs enabled:") + lognums = [] i = mavproxy.expect(["No logs", "(\d+) logs"]) if i == 0: numlogs = 0 else: numlogs = int(mavproxy.match.group(1)) + for i in range(numlogs): + mavproxy.expect("Log (\d+),") + lognums.append(int(mavproxy.match.group(1))) mavproxy.expect("Log]") for i in range(numlogs): - mavproxy.send("dump %u\n" % (i+1)) + mavproxy.send("dump %u\n" % lognums[i]) mavproxy.expect("logs enabled:", timeout=400) mavproxy.expect("Log]") util.pexpect_close(mavproxy)