aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCleber Rosa <crosa@redhat.com>2021-02-11 16:55:05 -0500
committerCleber Rosa <crosa@redhat.com>2021-07-13 13:18:50 -0400
commitb1f3b410528177c0a2f86b48bb9fb24422008fb1 (patch)
treea764bb73cdb9a789af9e7049c063b785cbc410e3 /tests
parent708f50199b59476ec4b45ebcdf171550086d6292 (diff)
Acceptance Tests: use the job work directory for created VMs
The QEMUMachine uses a base temporary directory for all temporary needs. By setting it to the Avocado's workdir, it's possible to keep the temporary files during debugging sessions much more easily by setting the "--keep-tmp" command line option. Reference: https://avocado-framework.readthedocs.io/en/85.0/api/test/avocado.html#avocado.Test.workdir Reference: https://avocado-framework.readthedocs.io/en/85.0/config/index.html#run-keep-tmp Signed-off-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-Id: <20210211220146.2525771-4-crosa@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/acceptance/avocado_qemu/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
index 93c4b9851f..693c226d91 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -221,7 +221,8 @@ class Test(avocado.Test):
def _new_vm(self, *args):
self._sd = tempfile.TemporaryDirectory(prefix="avo_qemu_sock_")
- vm = QEMUMachine(self.qemu_bin, sock_dir=self._sd.name)
+ vm = QEMUMachine(self.qemu_bin, base_temp_dir=self.workdir,
+ sock_dir=self._sd.name)
if args:
vm.add_args(*args)
return vm