Tools: autotest: add test for SITL implementation of Block backend

This commit is contained in:
Peter Barker 2019-09-18 16:25:25 +10:00 committed by Peter Barker
parent 5e6b6ee0e0
commit 1f25b6e406
2 changed files with 28 additions and 0 deletions

View File

@ -1951,6 +1951,10 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm)
"Test DataFlash over MAVLink",
self.test_dataflash_over_mavlink),
("DataFlashSITL",
"Test DataFlash SITL backend",
self.test_dataflash_sitl),
("DownLoadLogs", "Download logs", lambda:
self.log_download(
self.buildlogs_path("APMrover2-log.bin"),

View File

@ -2463,6 +2463,30 @@ class AutoTest(ABC):
if ex is not None:
raise ex
def test_dataflash_sitl(self):
self.context_push()
ex = None
try:
self.set_parameter("LOG_BACKEND_TYPE", 5)
self.reboot_sitl()
self.drain_mav() # hopefully draining COMMAND_ACK from that failed arm
self.mavproxy.send("module load log\n")
# self.mavproxy.expect("Loaded module log\n")
self.mavproxy.send("log erase\n")
self.mavproxy.send("log list\n")
self.mavproxy.expect("Log 1 numLogs 1 lastLog 1 size")
self.reboot_sitl()
self.mavproxy.send("log list\n")
self.mavproxy.expect("Log 1 numLogs 2 lastLog 2 size")
except Exception as e:
self.progress("Exception (%s) caught" % str(e))
ex = e
self.mavproxy.send("module unload log\n")
self.context_pop()
self.reboot_sitl()
if ex is not None:
raise ex
def test_arm_feature(self):
"""Common feature to test."""
# TEST ARMING/DISARM