Message ID | 20191028073441.6448-9-philmd@redhat.com |
---|---|
State | New |
Headers | show |
Series | tests/acceptance: Queue for 4.2 | expand |
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 --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))
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(+)