From f9cc00346d3e572ac128bc9b932b02c512490271 Mon Sep 17 00:00:00 2001 From: Hyman Date: Thu, 11 Mar 2021 01:29:55 +0800 Subject: tests/migration: fix unix socket batch migration when execute the following test command: "guestperf-batch.py --dst-host localhost --transport unix ..." test aborts and error message as the following be throwed: "launching VM Failed: [Errno 98] Address already in use". The reason is that batch script use the same monitor socket in all test cases and do not remove the socket file. The second migration test will launch vm use the same socket file as the first, so we get the error message. To fix it, just remove the socket file each time we have done the migration test. Signed-off-by: Hyman Message-Id: Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Cleber Rosa --- tests/migration/guestperf/engine.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/migration/guestperf/engine.py b/tests/migration/guestperf/engine.py index 83bfc3b6bb..5189cf9677 100644 --- a/tests/migration/guestperf/engine.py +++ b/tests/migration/guestperf/engine.py @@ -407,6 +407,13 @@ class Engine(object): vcpu_timings = ret[2] if uri[0:5] == "unix:": os.remove(uri[5:]) + + if os.path.exists(srcmonaddr): + os.remove(srcmonaddr) + + if self._dst_host == "localhost" and os.path.exists(dstmonaddr): + os.remove(dstmonaddr) + if self._verbose: print("Finished migration") -- cgit v1.2.3-55-g7522