From 10e8f3f3d74ccb9974fe038a634171816a90c6df Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Tue, 14 Apr 2020 12:08:19 +1000 Subject: [PATCH] autotest: canonicalise on defaults_filepath rather than defaults_file This naming better represents the fact this isn't just a filename. --- Tools/autotest/apmrover2.py | 2 +- Tools/autotest/arduplane.py | 4 ++-- Tools/autotest/common.py | 10 +++++----- Tools/autotest/pysim/util.py | 10 +++++----- Tools/autotest/quadplane.py | 10 +++++----- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Tools/autotest/apmrover2.py b/Tools/autotest/apmrover2.py index f81dc863f3..219109af56 100644 --- a/Tools/autotest/apmrover2.py +++ b/Tools/autotest/apmrover2.py @@ -4934,7 +4934,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) defaults_filepath = vinfo.options["APMrover2"]["frames"][model]["default_params_filename"] self.customise_SITL_commandline([], model=model, - defaults_file=defaults_filepath) + defaults_filepath=defaults_filepath) self.change_mode("MANUAL") self.wait_ready_to_arm() self.arm_vehicle() diff --git a/Tools/autotest/arduplane.py b/Tools/autotest/arduplane.py index 7d67de87f5..a8fe6f7821 100644 --- a/Tools/autotest/arduplane.py +++ b/Tools/autotest/arduplane.py @@ -62,7 +62,7 @@ class AutoTestPlane(AutoTest): return "plane-elevrev" def apply_defaultfile_parameters(self): - # plane passes in a defaults_file in place of applying + # plane passes in a defaults_filepath in place of applying # parameters afterwards. pass @@ -1864,4 +1864,4 @@ class AutoTestSoaring(AutoTestPlane): ("Mission", "Soaring mission", self.fly_mission) ]) - return ret \ No newline at end of file + return ret diff --git a/Tools/autotest/common.py b/Tools/autotest/common.py index 17c258c4b9..cef3fcc249 100644 --- a/Tools/autotest/common.py +++ b/Tools/autotest/common.py @@ -1370,12 +1370,12 @@ class AutoTest(ABC): self.set_streamrate(self.sitl_streamrate()) self.progress("Reboot complete") - def customise_SITL_commandline(self, customisations, model=None, defaults_file=None): + def customise_SITL_commandline(self, customisations, model=None, defaults_filepath=None): '''customisations could be "--uartF=sim:nmea" ''' self.contexts[-1].sitl_commandline_customised = True self.stop_SITL() self.start_SITL(model=model, - defaults_file=defaults_file, + defaults_filepath=defaults_filepath, customisations=customisations, wipe=False) self.wait_heartbeat(drain_mav=True) @@ -3387,9 +3387,9 @@ class AutoTest(ABC): "wipe": True, } start_sitl_args.update(**sitl_args) - if ("defaults_file" not in start_sitl_args or - start_sitl_args["defaults_file"] is None): - start_sitl_args["defaults_file"] = self.defaults_filepath() + if ("defaults_filepath" not in start_sitl_args or + start_sitl_args["defaults_filepath"] is None): + start_sitl_args["defaults_filepath"] = self.defaults_filepath() if "model" not in start_sitl_args or start_sitl_args["model"] is None: start_sitl_args["model"] = self.frame diff --git a/Tools/autotest/pysim/util.py b/Tools/autotest/pysim/util.py index 9ddf9d2258..ce40e75476 100644 --- a/Tools/autotest/pysim/util.py +++ b/Tools/autotest/pysim/util.py @@ -235,7 +235,7 @@ def start_SITL(binary, home=None, model=None, speedup=1, - defaults_file=None, + defaults_filepath=None, unhide_parameters=False, gdbserver=False, breakpoints=[], @@ -318,10 +318,10 @@ def start_SITL(binary, cmd.extend(['--model', model]) if speedup != 1: cmd.extend(['--speedup', str(speedup)]) - if defaults_file is not None: - if type(defaults_file) == list: - defaults_file = ",".join(defaults_file) - cmd.extend(['--defaults', defaults_file]) + if defaults_filepath is not None: + if type(defaults_filepath) == list: + defaults_filepath = ",".join(defaults_filepath) + cmd.extend(['--defaults', defaults_filepath]) if unhide_parameters: cmd.extend(['--unhide-groups']) if vicon: diff --git a/Tools/autotest/quadplane.py b/Tools/autotest/quadplane.py index 451089c733..a90a69ebe0 100644 --- a/Tools/autotest/quadplane.py +++ b/Tools/autotest/quadplane.py @@ -59,17 +59,17 @@ class AutoTestQuadPlane(AutoTest): self.current_test_name_directory = "ArduPlane_Tests/" + name + "/" def apply_defaultfile_parameters(self): - # plane passes in a defaults_file in place of applying + # plane passes in a defaults_filepath in place of applying # parameters afterwards. pass def defaults_filepath(self): vinfo = vehicleinfo.VehicleInfo() - defaults_file = vinfo.options["ArduPlane"]["frames"][self.frame]["default_params_filename"] - if isinstance(defaults_file, str): - defaults_file = [defaults_file] + defaults_filepath = vinfo.options["ArduPlane"]["frames"][self.frame]["default_params_filename"] + if isinstance(defaults_filepath, str): + defaults_filepath = [defaults_filepath] defaults_list = [] - for d in defaults_file: + for d in defaults_filepath: defaults_list.append(os.path.join(testdir, d)) return ','.join(defaults_list)