From 3fda7bbeac9d472b972cf2506477d6f06cdef403 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 22 Dec 2012 14:50:32 +1100 Subject: [PATCH] autotest: fixed log dumping --- Tools/autotest/autotest.py | 7 ++++++- Tools/autotest/autotest_jenkins.py | 2 +- Tools/autotest/pysim/util.py | 4 +--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Tools/autotest/autotest.py b/Tools/autotest/autotest.py index 7c7b7e6054..6dc07ddaff 100755 --- a/Tools/autotest/autotest.py +++ b/Tools/autotest/autotest.py @@ -37,7 +37,7 @@ def get_default_params(atype): def dump_logs(atype): '''dump DataFlash logs''' print("Dumping logs for %s" % atype) - sil = util.start_SIL(atype, CLI=True) + sil = util.start_SIL(atype) logfile = util.reltopdir('../buildlogs/%s.flashlog' % atype) log = open(logfile, mode='w') mavproxy = util.start_MAVProxy_SIL(atype, setup=True, logfile=log) @@ -173,6 +173,11 @@ skipsteps = opts.skip.split(',') signal.signal(signal.SIGALRM, alarm_handler) signal.alarm(opts.timeout) +if opts.list: + for step in steps: + print(step) + sys.exit(0) + def skip_step(step): '''see if a step should be skipped''' for skip in skipsteps: diff --git a/Tools/autotest/autotest_jenkins.py b/Tools/autotest/autotest_jenkins.py index 6cd9e4c0cc..94cf11369a 100755 --- a/Tools/autotest/autotest_jenkins.py +++ b/Tools/autotest/autotest_jenkins.py @@ -55,7 +55,7 @@ def get_default_params(atype): def dump_logs(atype): '''dump DataFlash logs''' print("Dumping logs for %s" % atype) - sil = util.start_SIL(atype, CLI=True) + sil = util.start_SIL(atype) logfile = util.reltopdir('../buildlogs/%s.flashlog' % atype) log = open(logfile, mode='w') mavproxy = util.start_MAVProxy_SIL(atype, setup=True, logfile=log) diff --git a/Tools/autotest/pysim/util.py b/Tools/autotest/pysim/util.py index 3b660d1f18..3036999b48 100644 --- a/Tools/autotest/pysim/util.py +++ b/Tools/autotest/pysim/util.py @@ -115,7 +115,7 @@ def pexpect_drain(p): except pexpect.TIMEOUT: pass -def start_SIL(atype, valgrind=False, wipe=False, CLI=False, height=None): +def start_SIL(atype, valgrind=False, wipe=False, height=None): '''launch a SIL instance''' cmd="" if valgrind and os.path.exists('/usr/bin/valgrind'): @@ -123,8 +123,6 @@ def start_SIL(atype, valgrind=False, wipe=False, CLI=False, height=None): cmd += reltopdir('tmp/%s.build/%s.elf' % (atype, atype)) if wipe: cmd += ' -w' - if CLI: - cmd += ' -s' if height is not None: cmd += ' -H %u' % height ret = pexpect.spawn(cmd, logfile=sys.stdout, timeout=5)