diff mbox series

[08/26] tests/acceptance: Introduce LinuxUserTest base class

Message ID 20191028073441.6448-9-philmd@redhat.com (mailing list archive)
State New, archived
Headers show
Series tests/acceptance: Queue for 4.2 | expand

Commit Message

Philippe Mathieu-Daudé Oct. 28, 2019, 7:34 a.m. UTC
Similarly to the MachineTest base class, this class contains
methods common to linux-user tests.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 tests/acceptance/avocado_qemu/__init__.py | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Philippe Mathieu-Daudé Nov. 18, 2019, 12:16 p.m. UTC | #1
Laurent, you weren't Cc'ed on this series, you might find it helpful to 
test linux-user code. The next patch (09/26 Add bFLT loader linux-user 
test) is provided as an example, and tests a STM32 BusyBox.

On 10/28/19 8:34 AM, Philippe Mathieu-Daudé wrote:
> Similarly to the MachineTest base class, this class contains
> methods common to linux-user tests.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>   tests/acceptance/avocado_qemu/__init__.py | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
> index d23681818d..2611a5146c 100644
> --- a/tests/acceptance/avocado_qemu/__init__.py
> +++ b/tests/acceptance/avocado_qemu/__init__.py
> @@ -14,6 +14,7 @@ import sys
>   import uuid
>   
>   import avocado
> +from avocado.utils import process
>   
>   SRC_ROOT_DIR = os.path.join(os.path.dirname(__file__), '..', '..', '..')
>   sys.path.append(os.path.join(SRC_ROOT_DIR, 'python'))
> @@ -138,3 +139,11 @@ class MachineTest(Test):
>       def tearDown(self):
>           for vm in self._vms.values():
>               vm.shutdown()
> +
> +
> +class LinuxUserTest(Test):
> +    def setUp(self):
> +        self.base_setUp("%s-linux-user", "qemu-%s")
> +
> +    def run(self, cmd):
> +        return process.run("%s %s" % (self.qemu_bin, cmd))
>
diff mbox series

Patch

diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
index d23681818d..2611a5146c 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -14,6 +14,7 @@  import sys
 import uuid
 
 import avocado
+from avocado.utils import process
 
 SRC_ROOT_DIR = os.path.join(os.path.dirname(__file__), '..', '..', '..')
 sys.path.append(os.path.join(SRC_ROOT_DIR, 'python'))
@@ -138,3 +139,11 @@  class MachineTest(Test):
     def tearDown(self):
         for vm in self._vms.values():
             vm.shutdown()
+
+
+class LinuxUserTest(Test):
+    def setUp(self):
+        self.base_setUp("%s-linux-user", "qemu-%s")
+
+    def run(self, cmd):
+        return process.run("%s %s" % (self.qemu_bin, cmd))