[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 37/44] tests/functional: Add QemuUserTest class
|
From: |
Thomas Huth |
|
Subject: |
[PATCH v5 37/44] tests/functional: Add QemuUserTest class |
|
Date: |
Fri, 30 Aug 2024 15:38:31 +0200 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Per commit 5334df4822 ("tests/avocado: Introduce
QemuUserTest base class"):
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é <philmd@linaro.org>
Message-ID: <20240822104238.75045-2-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/functional/qemu_test/__init__.py | 2 +-
tests/functional/qemu_test/testcase.py | 17 +++++++++++++++++
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/tests/functional/qemu_test/__init__.py
b/tests/functional/qemu_test/__init__.py
index 1d87d7122f..f33282efe8 100644
--- a/tests/functional/qemu_test/__init__.py
+++ b/tests/functional/qemu_test/__init__.py
@@ -11,4 +11,4 @@
from .cmd import has_cmd, has_cmds, run_cmd, is_readable_executable_file, \
interrupt_interactive_console_until_pattern, wait_for_console_pattern, \
exec_command, exec_command_and_wait_for_pattern, get_qemu_img
-from .testcase import QemuSystemTest, QemuBaseTest
+from .testcase import QemuBaseTest, QemuUserTest, QemuSystemTest
diff --git a/tests/functional/qemu_test/testcase.py
b/tests/functional/qemu_test/testcase.py
index 18314be9d1..aa0146265a 100644
--- a/tests/functional/qemu_test/testcase.py
+++ b/tests/functional/qemu_test/testcase.py
@@ -13,6 +13,7 @@
import logging
import os
+import subprocess
import pycotap
import sys
import unittest
@@ -70,6 +71,22 @@ def main():
unittest.main(module = None, testRunner = tr, argv=["__dummy__", path])
+class QemuUserTest(QemuBaseTest):
+
+ def setUp(self):
+ super().setUp('qemu-')
+ self._ldpath = []
+
+ def add_ldpath(self, ldpath):
+ self._ldpath.append(os.path.abspath(ldpath))
+
+ def run_cmd(self, bin_path, args=[]):
+ return subprocess.run([self.qemu_bin]
+ + ["-L %s" % ldpath for ldpath in self._ldpath]
+ + [bin_path]
+ + args,
+ text=True, capture_output=True)
+
class QemuSystemTest(QemuBaseTest):
"""Facilitates system emulation tests."""
--
2.46.0
- [PATCH v5 27/44] tests/functional: Convert the ppc_hv avocado test into a standalone test, (continued)
- [PATCH v5 27/44] tests/functional: Convert the ppc_hv avocado test into a standalone test, Thomas Huth, 2024/08/30
- [PATCH v5 28/44] tests/functional: Convert the m68k nextcube test with tesseract, Thomas Huth, 2024/08/30
- [PATCH v5 29/44] tests/functional: Convert the acpi-bits test into a standalone test, Thomas Huth, 2024/08/30
- [PATCH v5 30/44] tests/functional: Convert the rx_gdbsim avocado test into a standalone test, Thomas Huth, 2024/08/30
- [PATCH v5 31/44] tests/functional: Convert the linux_initrd avocado test into a standalone test, Thomas Huth, 2024/08/30
- [PATCH v5 32/44] tests/functional: Convert the vnc test, Thomas Huth, 2024/08/30
- [PATCH v5 33/44] tests/functional: Convert ARM Integrator/CP avocado tests, Thomas Huth, 2024/08/30
- [PATCH v5 35/44] tests/functional: Convert Aarch64 Virt machine avocado tests, Thomas Huth, 2024/08/30
- [PATCH v5 34/44] tests/functional: Convert Aarch64 SBSA-Ref avocado tests, Thomas Huth, 2024/08/30
- [PATCH v5 36/44] tests/functional: Convert mips64el Fuloong2e avocado test (1/2), Thomas Huth, 2024/08/30
- [PATCH v5 37/44] tests/functional: Add QemuUserTest class,
Thomas Huth <=
- [PATCH v5 38/44] tests/functional: Convert ARM bFLT linux-user avocado test, Thomas Huth, 2024/08/30
- [PATCH v5 39/44] tests/avocado: Remove unused QemuUserTest class, Thomas Huth, 2024/08/30
- [PATCH v5 41/44] docs/devel: Split testing docs from the build docs and move to separate folder, Thomas Huth, 2024/08/30
- [PATCH v5 40/44] gitlab-ci: Add "check-functional" to the build tests, Thomas Huth, 2024/08/30
- [PATCH v5 43/44] docs/devel/testing: Rename avocado_qemu.Test class, Thomas Huth, 2024/08/30
- [PATCH v5 42/44] docs/devel/testing: Split the Avocado documentation into a separate file, Thomas Huth, 2024/08/30
- [PATCH v5 44/44] docs/devel/testing: Add documentation for functional tests, Thomas Huth, 2024/08/30