From 5ba8755802d1a0635fe7c698457de1eef830fcb0 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 18 Apr 2024 11:12:37 +1000 Subject: [PATCH] autotest: stop passing defaults in via --defaults to custom_sitl_commandline --- Tools/autotest/arducopter.py | 6 ++++-- Tools/autotest/arduplane.py | 3 ++- Tools/autotest/helicopter.py | 6 ++++-- Tools/autotest/pysim/util.py | 3 +++ 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Tools/autotest/arducopter.py b/Tools/autotest/arducopter.py index 969992c434..b0f67ebb38 100644 --- a/Tools/autotest/arducopter.py +++ b/Tools/autotest/arducopter.py @@ -7652,7 +7652,8 @@ class AutoTestCopter(vehicle_test_suite.TestSuite): ex = None try: self.customise_SITL_commandline( - ["--defaults", ','.join(self.model_defaults_filepath('Callisto'))], + [], + defaults_filepath=self.model_defaults_filepath('Callisto'), model="octa-quad:@ROMFS/models/Callisto.json", wipe=True, ) @@ -8847,7 +8848,8 @@ class AutoTestCopter(vehicle_test_suite.TestSuite): def Callisto(self): '''Test Callisto''' self.customise_SITL_commandline( - ["--defaults", ','.join(self.model_defaults_filepath('Callisto')), ], + [], + defaults_filepath=self.model_defaults_filepath('Callisto'), model="octa-quad:@ROMFS/models/Callisto.json", wipe=True, ) diff --git a/Tools/autotest/arduplane.py b/Tools/autotest/arduplane.py index e038240252..f2dc63c9e1 100644 --- a/Tools/autotest/arduplane.py +++ b/Tools/autotest/arduplane.py @@ -3917,7 +3917,8 @@ class AutoTestPlane(vehicle_test_suite.TestSuite): if not isinstance(defaults, list): defaults = [defaults] self.customise_SITL_commandline( - ["--defaults", ','.join(defaults), ], + [], + defaults_filepath=defaults, model=model, wipe=True, ) diff --git a/Tools/autotest/helicopter.py b/Tools/autotest/helicopter.py index 8c6cb0eeff..3b85bc70e0 100644 --- a/Tools/autotest/helicopter.py +++ b/Tools/autotest/helicopter.py @@ -199,7 +199,8 @@ class AutoTestHelicopter(AutoTestCopter): if not isinstance(defaults, list): defaults = [defaults] self.customise_SITL_commandline( - ["--defaults", ','.join(defaults), ], + [], + defaults_filepath=defaults, model=model, wipe=True, ) @@ -210,7 +211,8 @@ class AutoTestHelicopter(AutoTestCopter): def governortest(self): '''Test Heli Internal Throttle Curve and Governor''' self.customise_SITL_commandline( - ["--defaults", ','.join(self.model_defaults_filepath('heli-gas')), ], + [], + defaults_filepath=self.model_defaults_filepath('heli-gas'), model="heli-gas", wipe=True, ) diff --git a/Tools/autotest/pysim/util.py b/Tools/autotest/pysim/util.py index 00d8ed1ac8..1830e8f82a 100644 --- a/Tools/autotest/pysim/util.py +++ b/Tools/autotest/pysim/util.py @@ -542,6 +542,9 @@ def start_SITL(binary, cmd.extend(customisations) + if "--defaults" in customisations: + raise ValueError("--defaults must be passed in via defaults_filepath keyword argument, not as part of customisation list") # noqa + pexpect_logfile_prefix = stdout_prefix if pexpect_logfile_prefix is None: pexpect_logfile_prefix = os.path.basename(binary)