Tools: autotest: add a simple dataflash-over-mavlink test

This commit is contained in:
Peter Barker 2019-03-01 22:19:03 +11:00 committed by Peter Barker
parent 603d9f6907
commit 6103d5ebac
2 changed files with 22 additions and 0 deletions

View File

@ -1012,6 +1012,10 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm)
"Test Rally Points",
self.test_rally_points),
("DataFlashOverMAVLink",
"Test DataFlash over MAVLink",
self.test_dataflash_over_mavlink),
("DownLoadLogs", "Download logs", lambda:
self.log_download(
self.buildlogs_path("APMrover2-log.bin"),

View File

@ -1780,6 +1780,24 @@ class AutoTest(ABC):
raise NotAchievedException("home is drifting")
self.reboot_sitl()
def test_dataflash_over_mavlink(self):
self.context_push()
self.set_parameter("LOG_BACKEND_TYPE", 3)
self.reboot_sitl()
self.wait_ready_to_arm()
self.mavproxy.send('arm throttle\n')
self.mavproxy.expect('PreArm: Logging failed')
self.mavproxy.send("module load dataflash_logger\n")
self.mavproxy.send("dataflash_logger set verbose 1\n")
self.mavproxy.expect('logging started')
self.mavproxy.send("dataflash_logger set verbose 0\n")
self.delay_sim_time(1)
self.drain_mav() # hopefully draining COMMAND_ACK from that failed arm
self.arm_vehicle()
self.disarm_vehicle()
self.context_pop()
self.reboot_sitl()
def test_arm_feature(self):
"""Common feature to test."""
self.context_push()