[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 40/42] tests/acceptance: Introduce QemuUserTest base class
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH 40/42] tests/acceptance: Introduce QemuUserTest base class |
Date: |
Sun, 14 Feb 2021 18:59:10 +0100 |
Similarly to the 'System' Test base class with methods for testing
system emulation, the QemuUserTest class contains methods useful to
test user-mode emulation.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
tests/acceptance/avocado_qemu/__init__.py | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/tests/acceptance/avocado_qemu/__init__.py
b/tests/acceptance/avocado_qemu/__init__.py
index e0067abca61..a293d228140 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -15,6 +15,7 @@
import tempfile
import avocado
+from avocado.utils import process
#: The QEMU build root directory. It may also be the source directory
#: if building from the source dir, but it's safer to use BUILD_DIR for
@@ -211,3 +212,17 @@ def tearDown(self):
for vm in self._vms.values():
vm.shutdown()
self._sd = None
+
+class QemuUserTest(QemuBaseTest):
+ def setUp(self):
+ self._ldpath = []
+ super(QemuUserTest, self).setUp("qemu-%s")
+
+ def add_ldpath(self, ldpath):
+ self._ldpath += [os.path.abspath(ldpath)]
+
+ def run(self, bin_path, args=[]):
+ qemu_args = " ".join(["-L %s" % ldpath for ldpath in self._ldpath])
+ bin_args = " ".join(args)
+ return process.run("%s %s %s %s" % (self.qemu_bin, qemu_args,
+ bin_path, bin_args))
--
2.26.2
- Re: [RFC PATCH 34/42] gitlab-ci: Build MIPS R5900 cross-toolchain (Gentoo based), (continued)
- [RFC PATCH 38/42] tests/acceptance: Extract QemuBaseTest from Test, Philippe Mathieu-Daudé, 2021/02/14
- [RFC PATCH 39/42] tests/acceptance: Make pick_default_qemu_bin() more generic, Philippe Mathieu-Daudé, 2021/02/14
- [RFC PATCH 40/42] tests/acceptance: Introduce QemuUserTest base class,
Philippe Mathieu-Daudé <=
- [RFC PATCH 41/42] tests/acceptance: Test R5900 CPU with BusyBox from Sony PS2, Philippe Mathieu-Daudé, 2021/02/14
- [RFC PATCH 42/42] gitlab-ci: Add job to run integration tests for the r5900o32el target, Philippe Mathieu-Daudé, 2021/02/14
- Re: [RFC PATCH 00/42] target/mips: Reintroduce the R5900 CPU (with more testing), Philippe Mathieu-Daudé, 2021/02/14
- Re: [RFC PATCH 00/42] target/mips: Reintroduce the R5900 CPU (with more testing), Philippe Mathieu-Daudé, 2021/02/15
- Re: [RFC PATCH 00/42] target/mips: Reintroduce the R5900 CPU (with more testing), Philippe Mathieu-Daudé, 2021/02/21