From 8deaa36f5a8be1b7512ba9238e2226e94369c638 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Tue, 3 Mar 2020 18:55:04 +1100 Subject: [PATCH] autotest: neaten start of MAVProxy, add debug showing cmdline Attempting to diagnose failure of MAVProxy to find rline.py on the autotest server. --- Tools/autotest/pysim/util.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Tools/autotest/pysim/util.py b/Tools/autotest/pysim/util.py index 493396e3e0..910208339e 100644 --- a/Tools/autotest/pysim/util.py +++ b/Tools/autotest/pysim/util.py @@ -380,16 +380,21 @@ def start_MAVProxy_SITL(atype, aircraft=None, setup=False, master='tcp:127.0.0.1 env.get('PYTHONPATH', '')) import pexpect global close_list - MAVPROXY = mavproxy_cmd() - cmd = MAVPROXY + ' --master=%s --out=127.0.0.1:14550' % master + cmd = [] + cmd.append(mavproxy_cmd()) + cmd.extend(['--master', master]) + cmd.extend(['--out', '127.0.0.1:14550']) if setup: - cmd += ' --setup' + cmd.append('--setup') if aircraft is None: aircraft = 'test.%s' % atype - cmd += ' --aircraft=%s' % aircraft - cmd += ' ' + ' '.join(options) - cmd += ' --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) + cmd.extend(['--aircraft', aircraft]) + cmd.extend(options) + cmd.extend(['--default-modules', 'misc,terrain,wp,rally,fence,param,arm,mode,rc,cmdlong,output']) + + 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 pexpect_autoclose(ret) return ret