mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 14:53:54 -06:00
tests: add prefixes to the bare mkdtemp calls
The first step to debug a thing is to know what created the thing in the first place. Add some prefixes so random tmpdir's have something grep in the code. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20201117173635.29101-3-alex.bennee@linaro.org>
This commit is contained in:
parent
e4b937d3c4
commit
8c175c63ee
2 changed files with 4 additions and 2 deletions
|
@ -303,7 +303,8 @@ class QEMUMachine:
|
||||||
return args
|
return args
|
||||||
|
|
||||||
def _pre_launch(self) -> None:
|
def _pre_launch(self) -> None:
|
||||||
self._temp_dir = tempfile.mkdtemp(dir=self._test_dir)
|
self._temp_dir = tempfile.mkdtemp(prefix="qemu-machine-",
|
||||||
|
dir=self._test_dir)
|
||||||
self._qemu_log_path = os.path.join(self._temp_dir, self._name + ".log")
|
self._qemu_log_path = os.path.join(self._temp_dir, self._name + ".log")
|
||||||
self._qemu_log_file = open(self._qemu_log_path, 'wb')
|
self._qemu_log_file = open(self._qemu_log_path, 'wb')
|
||||||
|
|
||||||
|
|
|
@ -171,7 +171,8 @@ class Test(avocado.Test):
|
||||||
self.cancel("No QEMU binary defined or found in the build tree")
|
self.cancel("No QEMU binary defined or found in the build tree")
|
||||||
|
|
||||||
def _new_vm(self, *args):
|
def _new_vm(self, *args):
|
||||||
vm = QEMUMachine(self.qemu_bin, sock_dir=tempfile.mkdtemp())
|
sd = tempfile.mkdtemp(prefix="avo_qemu_sock_")
|
||||||
|
vm = QEMUMachine(self.qemu_bin, sock_dir=sd)
|
||||||
if args:
|
if args:
|
||||||
vm.add_args(*args)
|
vm.add_args(*args)
|
||||||
return vm
|
return vm
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue