From 666e7b88d761b5539799aaff8e0ecb06177303fd Mon Sep 17 00:00:00 2001 From: Pierre Kancir Date: Mon, 15 Jul 2019 11:36:53 +0200 Subject: [PATCH] Tools: common: dynamicly load and unload log module as needed --- Tools/autotest/common.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Tools/autotest/common.py b/Tools/autotest/common.py index 7e7ff1e906..799b2327f3 100644 --- a/Tools/autotest/common.py +++ b/Tools/autotest/common.py @@ -537,6 +537,8 @@ class AutoTest(ABC): def log_download(self, filename, timeout=360, upload_logs=False): """Download latest log.""" self.wait_heartbeat() + self.mavproxy.send("module load log\n") + self.mavproxy.expect("Loaded module log") self.mavproxy.send("log list\n") self.mavproxy.expect("numLogs") self.wait_heartbeat() @@ -2934,9 +2936,14 @@ switch value''' def last_onboard_log(self): '''return number of last onboard log''' + self.mavproxy.send("module load log\n") + self.mavproxy.expect("Loaded module log") self.mavproxy.send("log list\n") self.mavproxy.expect("lastLog ([0-9]+)") - return int(self.mavproxy.match.group(1)) + num_log = int(self.mavproxy.match.group(1)) + self.mavproxy.send("module unload log\n") + self.mavproxy.expect("Unloaded module log") + return num_log def current_onboard_log_filepath(self): '''return filepath to currently open dataflash log'''