[PATCH v2 3/6] tests/acceptance: allow a "graceful" failing for virtio-gpu test

Alex Bennée posted 6 patches 4 years, 11 months ago
[PATCH v2 3/6] tests/acceptance: allow a "graceful" failing for virtio-gpu test
Posted by Alex Bennée 4 years, 11 months ago
This is a band-aid with a TODO for cases when QEMU doesn't start due
to missing VirGL. Longer term we could do with some proper feature
probing.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20210217121932.19986-7-alex.bennee@linaro.org>
---
 tests/acceptance/virtio-gpu.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/acceptance/virtio-gpu.py b/tests/acceptance/virtio-gpu.py
index ab1a4c1a71..ab18cddbb7 100644
--- a/tests/acceptance/virtio-gpu.py
+++ b/tests/acceptance/virtio-gpu.py
@@ -85,7 +85,12 @@ def test_virtio_vga_virgl(self):
             "-append",
             kernel_command_line,
         )
-        self.vm.launch()
+        try:
+            self.vm.launch()
+        except:
+            # TODO: probably fails because we are missing the VirGL features
+            self.cancel("VirGL not enabled?")
+
         self.wait_for_console_pattern("as init process")
         exec_command_and_wait_for_pattern(
             self, "/usr/sbin/modprobe virtio_gpu", ""
-- 
2.20.1


Probing Meson for build configurations (was: [PATCH v2 3/6] tests/acceptance: allow a "graceful" failing for virtio-gpu test)
Posted by Wainer dos Santos Moschetta 4 years, 11 months ago
Hi Paolo,

Last week I was chatting with Cleber about probing configured features 
so that tests could be skipped (just like on this case). He has a 
implementation which never landed in, and is based on the old build 
system. Now with Meson, I am wondering if it has some sort of API for 
probing, or parsing the JSON files in build/meson-info/ is the proper 
way to inspect the build configuration.

Thanks!

- Wainer

On 2/22/21 7:14 AM, Alex Bennée wrote:
> This is a band-aid with a TODO for cases when QEMU doesn't start due
> to missing VirGL. Longer term we could do with some proper feature
> probing.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Reviewed-by: Willian Rampazzo <willianr@redhat.com>
> Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
> Message-Id: <20210217121932.19986-7-alex.bennee@linaro.org>
> ---
>   tests/acceptance/virtio-gpu.py | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/tests/acceptance/virtio-gpu.py b/tests/acceptance/virtio-gpu.py
> index ab1a4c1a71..ab18cddbb7 100644
> --- a/tests/acceptance/virtio-gpu.py
> +++ b/tests/acceptance/virtio-gpu.py
> @@ -85,7 +85,12 @@ def test_virtio_vga_virgl(self):
>               "-append",
>               kernel_command_line,
>           )
> -        self.vm.launch()
> +        try:
> +            self.vm.launch()
> +        except:
> +            # TODO: probably fails because we are missing the VirGL features
> +            self.cancel("VirGL not enabled?")
> +
>           self.wait_for_console_pattern("as init process")
>           exec_command_and_wait_for_pattern(
>               self, "/usr/sbin/modprobe virtio_gpu", ""


Re: Probing Meson for build configurations (was: [PATCH v2 3/6] tests/acceptance: allow a "graceful" failing for virtio-gpu test)
Posted by Daniel P. Berrangé 4 years, 11 months ago
On Mon, Feb 22, 2021 at 12:44:37PM -0300, Wainer dos Santos Moschetta wrote:
> Hi Paolo,
> 
> Last week I was chatting with Cleber about probing configured features so
> that tests could be skipped (just like on this case). He has a
> implementation which never landed in, and is based on the old build system.
> Now with Meson, I am wondering if it has some sort of API for probing, or
> parsing the JSON files in build/meson-info/ is the proper way to inspect the
> build configuration.

Probing build configuration is the wrong approach.

We need to be querying the QEMU binary to ask if it has the logical
feature we need.  In this case

{
  "execute": "device-list-properties",
  "arguments": {
    "typename": "virtio-gpu-pci"
  },
}


the response will include "virgl" property, if QEMU was compiled
with VirGL. This is how libvirt detects VirGL support in QEMU
today.

> On 2/22/21 7:14 AM, Alex Bennée wrote:
> > This is a band-aid with a TODO for cases when QEMU doesn't start due
> > to missing VirGL. Longer term we could do with some proper feature
> > probing.
> > 
> > Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> > Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > Reviewed-by: Willian Rampazzo <willianr@redhat.com>
> > Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
> > Message-Id: <20210217121932.19986-7-alex.bennee@linaro.org>
> > ---
> >   tests/acceptance/virtio-gpu.py | 7 ++++++-
> >   1 file changed, 6 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tests/acceptance/virtio-gpu.py b/tests/acceptance/virtio-gpu.py
> > index ab1a4c1a71..ab18cddbb7 100644
> > --- a/tests/acceptance/virtio-gpu.py
> > +++ b/tests/acceptance/virtio-gpu.py
> > @@ -85,7 +85,12 @@ def test_virtio_vga_virgl(self):
> >               "-append",
> >               kernel_command_line,
> >           )
> > -        self.vm.launch()
> > +        try:
> > +            self.vm.launch()
> > +        except:
> > +            # TODO: probably fails because we are missing the VirGL features
> > +            self.cancel("VirGL not enabled?")
> > +
> >           self.wait_for_console_pattern("as init process")
> >           exec_command_and_wait_for_pattern(
> >               self, "/usr/sbin/modprobe virtio_gpu", ""

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|