Browse Source

autotest: fixed log dumping

master
Andrew Tridgell 12 years ago
parent
commit
3fda7bbeac
  1. 7
      Tools/autotest/autotest.py
  2. 2
      Tools/autotest/autotest_jenkins.py
  3. 4
      Tools/autotest/pysim/util.py

7
Tools/autotest/autotest.py

@ -37,7 +37,7 @@ def get_default_params(atype): @@ -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(',') @@ -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:

2
Tools/autotest/autotest_jenkins.py

@ -55,7 +55,7 @@ def get_default_params(atype): @@ -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)

4
Tools/autotest/pysim/util.py

@ -115,7 +115,7 @@ def pexpect_drain(p): @@ -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): @@ -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)

Loading…
Cancel
Save