autotest: break out a run_replay method

This commit is contained in:
Peter Barker 2024-06-24 19:48:07 +10:00 committed by Peter Barker
parent eb539f2c4a
commit e2ef47b221
2 changed files with 12 additions and 7 deletions

View File

@ -9225,13 +9225,7 @@ class AutoTestCopter(vehicle_test_suite.TestSuite):
(current_log_filepath, os.path.getsize(current_log_filepath))
))
util.run_cmd(
['build/sitl/tool/Replay', current_log_filepath],
directory=util.topdir(),
checkfail=True,
show=True,
output=True,
)
self.run_replay(current_log_filepath)
self.context_pop()

View File

@ -13852,6 +13852,17 @@ switch value'''
# heading seemingly indefinitely.
self.reboot_sitl()
def run_replay(self, filepath):
'''runs replay in filepath, returns filepath to Replay logfile'''
util.run_cmd(
['build/sitl/tool/Replay', filepath],
directory=util.topdir(),
checkfail=True,
show=True,
output=True,
)
return self.current_onboard_log_filepath()
def AHRS_ORIENTATION(self):
'''test AHRS_ORIENTATION parameter works'''
self.context_push()