autotest: add serial loopback test script

Tests that data can flow both ways with one end using protocol 28
(Scripting) and the other using the serial device feature.
This commit is contained in:
Thomas Watson 2024-06-02 14:56:22 -05:00 committed by Peter Barker
parent f9b138724c
commit ad7270f682

View File

@ -5428,6 +5428,28 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm)
self.context_pop()
self.reboot_sitl()
def test_scripting_serial_loopback(self):
self.start_subtest("Scripting serial loopback test")
self.context_push()
self.context_collect('STATUSTEXT')
self.set_parameters({
"SCR_ENABLE": 1,
"SCR_SDEV_EN": 1,
"SCR_SDEV1_PROTO": 28,
})
self.install_test_script_context("serial_loopback.lua")
self.reboot_sitl()
for success_text in [
"driver -> device good",
"device -> driver good",
]:
self.wait_statustext(success_text, check_context=True)
self.context_pop()
self.reboot_sitl()
def Scripting(self):
'''Scripting test'''
self.test_scripting_set_home_to_vehicle_location()
@ -5436,6 +5458,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm)
self.test_scripting_simple_loop()
self.test_scripting_internal_test()
self.test_scripting_auxfunc()
self.test_scripting_serial_loopback()
def test_mission_frame(self, frame, target_system=1, target_component=1):
self.clear_mission(mavutil.mavlink.MAV_MISSION_TYPE_MISSION,