aboutsummaryrefslogtreecommitdiff
path: root/tests/acceptance
diff options
context:
space:
mode:
Diffstat (limited to 'tests/acceptance')
-rw-r--r--tests/acceptance/avocado_qemu/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
index 307020be45..bf54e419da 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -171,8 +171,8 @@ class Test(avocado.Test):
self.cancel("No QEMU binary defined or found in the build tree")
def _new_vm(self, *args):
- sd = tempfile.mkdtemp(prefix="avo_qemu_sock_")
- vm = QEMUMachine(self.qemu_bin, sock_dir=sd)
+ self._sd = tempfile.TemporaryDirectory(prefix="avo_qemu_sock_")
+ vm = QEMUMachine(self.qemu_bin, sock_dir=self._sd.name)
if args:
vm.add_args(*args)
return vm
@@ -193,6 +193,7 @@ class Test(avocado.Test):
def tearDown(self):
for vm in self._vms.values():
vm.shutdown()
+ self._sd = None
def fetch_asset(self, name,
asset_hash=None, algorithm=None,