From 87eb703bc14a744123d53be9f33aab14d2c544c1 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sun, 21 Aug 2022 20:33:10 +1000 Subject: [PATCH] autotest: terminate FTP session after transfering files race condition starting the second MAVProxy if the first session isn't terminated --- Tools/autotest/common.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tools/autotest/common.py b/Tools/autotest/common.py index 837b8b7997..02317c0a07 100644 --- a/Tools/autotest/common.py +++ b/Tools/autotest/common.py @@ -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