[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 07/26] tests/acceptance: Make pick_default_qemu_bin() more generi
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 07/26] tests/acceptance: Make pick_default_qemu_bin() more generic |
Date: |
Mon, 28 Oct 2019 08:34:22 +0100 |
Make pick_default_qemu_bin() generic to find qemu-system or
qemu-user binaries.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
tests/acceptance/avocado_qemu/__init__.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tests/acceptance/avocado_qemu/__init__.py
b/tests/acceptance/avocado_qemu/__init__.py
index a2cc3d689b..d23681818d 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -24,7 +24,7 @@ def is_readable_executable_file(path):
return os.path.isfile(path) and os.access(path, os.R_OK | os.X_OK)
-def pick_default_qemu_bin(arch=None):
+def pick_default_qemu_bin(path_fmt, bin_fmt, arch=None):
"""
Picks the path of a QEMU binary, starting either in the current working
directory or in the source tree root directory.
@@ -43,8 +43,7 @@ def pick_default_qemu_bin(arch=None):
# qemu binary path does not match arch for powerpc, handle it
if 'ppc64le' in arch:
arch = 'ppc64'
- qemu_bin_relative_path = os.path.join("%s-softmmu" % arch,
- "qemu-system-%s" % arch)
+ qemu_bin_relative_path = os.path.join(path_fmt % arch, bin_fmt % arch)
if is_readable_executable_file(qemu_bin_relative_path):
return qemu_bin_relative_path
@@ -99,14 +98,15 @@ def exec_command_and_wait_for_pattern(test, command,
class Test(avocado.Test):
- def setUp(self):
+ def base_setUp(self, path_fmt, bin_fmt):
arches = self.tags.get('arch', [])
if len(arches) == 1:
arch = arches.pop()
else:
arch = None
self.arch = self.params.get('arch', default=arch)
- default_qemu_bin = pick_default_qemu_bin(arch=self.arch)
+ default_qemu_bin = pick_default_qemu_bin(path_fmt, bin_fmt,
+ arch=self.arch)
self.qemu_bin = self.params.get('qemu_bin',
default=default_qemu_bin)
if self.qemu_bin is None:
@@ -116,7 +116,7 @@ class Test(avocado.Test):
class MachineTest(Test):
def setUp(self):
self._vms = {}
- super().setUp()
+ self.base_setUp("%s-softmmu", "qemu-system-%s")
def _new_vm(self, *args):
vm = QEMUMachine(self.qemu_bin)
--
2.21.0
- Re: [PATCH 02/26] Acceptance tests: refactor wait_for_console_pattern, (continued)
- [PATCH 03/26] tests/acceptance: Fixe wait_for_console_pattern() hangs, Philippe Mathieu-Daudé, 2019/10/28
- [PATCH 04/26] tests/acceptance: Send <carriage return> on serial lines, Philippe Mathieu-Daudé, 2019/10/28
- [PATCH 05/26] tests/acceptance: Refactor exec_command_and_wait_for_pattern(), Philippe Mathieu-Daudé, 2019/10/28
- [PATCH 06/26] tests/acceptance: Rename avocado_qemu.Test as MachineTest, Philippe Mathieu-Daudé, 2019/10/28
- [PATCH 07/26] tests/acceptance: Make pick_default_qemu_bin() more generic,
Philippe Mathieu-Daudé <=
- [PATCH 08/26] tests/acceptance: Introduce LinuxUserTest base class, Philippe Mathieu-Daudé, 2019/10/28
- [PATCH 09/26] tests/acceptance: Add bFLT loader linux-user test, Philippe Mathieu-Daudé, 2019/10/28
- [PATCH 10/26] tests/acceptance: Add test that boots the HelenOS microkernel on Leon3, Philippe Mathieu-Daudé, 2019/10/28
- [PATCH 11/26] tests/acceptance: Add test that boots Linux up to BusyBox on Leon3, Philippe Mathieu-Daudé, 2019/10/28
- [PATCH 12/26] .travis.yml: Let the avocado job run the Leon3 test, Philippe Mathieu-Daudé, 2019/10/28
- [PATCH 13/26] tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p, Philippe Mathieu-Daudé, 2019/10/28