autotest: terminate FTP session after transfering files

race condition starting the second MAVProxy if the first session isn't terminated
This commit is contained in:
Peter Barker 2022-08-21 20:33:10 +10:00 committed by Peter Barker
parent b3e4306b70
commit 87eb703bc1

View File

@ -12288,11 +12288,15 @@ switch value'''
try:
mavproxy.send("module load ftp\n")
mavproxy.expect(["Loaded module ftp", "module ftp already loaded"])
mavproxy.send("ftp set debug 1\n") # so we get the "Terminated session" message
mavproxy.send("ftp get %s %s\n" % (path, tmpfile.name))
mavproxy.expect("Getting")
self.delay_sim_time(2)
mavproxy.send("ftp status\n")
mavproxy.expect("No transfer in progress")
# terminate the connection, or it may still be in progress the next time an FTP is attempted:
mavproxy.send("ftp cancel\n")
mavproxy.expect("Terminated session")
except Exception as e:
self.print_exception_caught(e)
ex = e