autotest: neaten start of MAVProxy, add debug showing cmdline

Attempting to diagnose failure of MAVProxy to find rline.py on the
autotest server.
This commit is contained in:
Peter Barker 2020-03-03 18:55:04 +11:00 committed by Peter Barker
parent 566732a2d7
commit 8deaa36f5a
1 changed files with 12 additions and 7 deletions

View File

@ -380,16 +380,21 @@ def start_MAVProxy_SITL(atype, aircraft=None, setup=False, master='tcp:127.0.0.1
env.get('PYTHONPATH', '')) env.get('PYTHONPATH', ''))
import pexpect import pexpect
global close_list global close_list
MAVPROXY = mavproxy_cmd() cmd = []
cmd = MAVPROXY + ' --master=%s --out=127.0.0.1:14550' % master cmd.append(mavproxy_cmd())
cmd.extend(['--master', master])
cmd.extend(['--out', '127.0.0.1:14550'])
if setup: if setup:
cmd += ' --setup' cmd.append('--setup')
if aircraft is None: if aircraft is None:
aircraft = 'test.%s' % atype aircraft = 'test.%s' % atype
cmd += ' --aircraft=%s' % aircraft cmd.extend(['--aircraft', aircraft])
cmd += ' ' + ' '.join(options) cmd.extend(options)
cmd += ' --default-modules misc,terrain,wp,rally,fence,param,arm,mode,rc,cmdlong,output' cmd.extend(['--default-modules', 'misc,terrain,wp,rally,fence,param,arm,mode,rc,cmdlong,output'])
ret = pexpect.spawn(cmd, logfile=logfile, encoding=ENCODING, timeout=60, env=env)
print("Running: %s" % cmd_as_shell(cmd))
ret = pexpect.spawn(cmd[0], cmd[1:], logfile=logfile, encoding=ENCODING, timeout=60, env=env)
ret.delaybeforesend = 0 ret.delaybeforesend = 0
pexpect_autoclose(ret) pexpect_autoclose(ret)
return ret return ret