[PATCH 16/18] tests/qtest/meson.build: Run the net filter tests only with default devices

Thomas Huth posted 18 patches 2 years, 9 months ago
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Thomas Huth <thuth@redhat.com>, Wainer dos Santos Moschetta <wainersm@redhat.com>, Beraldo Leal <bleal@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Richard Henderson <richard.henderson@linaro.org>, Eduardo Habkost <eduardo@habkost.net>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, "Hervé Poussineau" <hpoussin@reactos.org>, David Hildenbrand <david@redhat.com>, Ilya Leoshkevich <iii@linux.ibm.com>, Halil Pasic <pasic@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Eric Farman <farman@linux.ibm.com>, Yoshinori Sato <ysato@users.sourceforge.jp>, Magnus Damm <magnus.damm@gmail.com>, Artyom Tarasenko <atar4qemu@gmail.com>, Yanan Wang <wangyanan55@huawei.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, John Snow <jsnow@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>
[PATCH 16/18] tests/qtest/meson.build: Run the net filter tests only with default devices
Posted by Thomas Huth 2 years, 9 months ago
These tests rely on a default NIC to be available. Skip them if we
used the "--without-default-devices" configure option.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/meson.build | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
index 48cd35b5b2..8fec3103b5 100644
--- a/tests/qtest/meson.build
+++ b/tests/qtest/meson.build
@@ -35,9 +35,9 @@ qtests_cxl = \
   (config_all_devices.has_key('CONFIG_CXL') ? ['cxl-test'] : [])
 
 qtests_filter = \
-  (slirp.found() ? ['test-netfilter'] : []) + \
-  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
-  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : [])
+  (get_option('default_devices') and slirp.found() ? ['test-netfilter'] : []) + \
+  (get_option('default_devices') and config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
+  (get_option('default_devices') and config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : [])
 
 qtests_i386 = \
   (slirp.found() ? ['pxe-test'] : []) + \
@@ -221,9 +221,7 @@ qtests_aarch64 = \
    'migration-test']
 
 qtests_s390x = \
-  (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) +                 \
-  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +                         \
-  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) +                     \
+  qtests_filter + \
   ['boot-serial-test',
    'drive_del-test',
    'device-plug-test',
-- 
2.31.1
Re: [PATCH 16/18] tests/qtest/meson.build: Run the net filter tests only with default devices
Posted by Paolo Bonzini 2 years, 9 months ago
Il ven 12 mag 2023, 14:41 Thomas Huth <thuth@redhat.com> ha scritto:

> These tests rely on a default NIC to be available. Skip them if we
> used the "--without-default-devices" configure option.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
>

This is the only patch I have some qualms about, because it reduces
coverage in legitimate setups where the default NIC _is_ included in the
binary.

Still a lot better than before, but please add a FIXME here. We can perhaps
try to use QMP to check if the machines have a usable default NIC, and if
not skip the test, but this should not block the bulk of your work from
being merged.

So, apart from this issue, series

Acked-by: Paolo Bonzini <pbonzini@redhat.com>

(Since I have only skimmed the contents of the individual patches but liked
them enough—or disliked for this one...—to reply already).

Paolo


---
>  tests/qtest/meson.build | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
> index 48cd35b5b2..8fec3103b5 100644
> --- a/tests/qtest/meson.build
> +++ b/tests/qtest/meson.build
> @@ -35,9 +35,9 @@ qtests_cxl = \
>    (config_all_devices.has_key('CONFIG_CXL') ? ['cxl-test'] : [])
>
>  qtests_filter = \
> -  (slirp.found() ? ['test-netfilter'] : []) + \
> -  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
> -  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : [])
> +  (get_option('default_devices') and slirp.found() ? ['test-netfilter'] :
> []) + \
> +  (get_option('default_devices') and config_host.has_key('CONFIG_POSIX')
> ? ['test-filter-mirror'] : []) + \
> +  (get_option('default_devices') and config_host.has_key('CONFIG_POSIX')
> ? ['test-filter-redirector'] : [])
>
>  qtests_i386 = \
>    (slirp.found() ? ['pxe-test'] : []) + \
> @@ -221,9 +221,7 @@ qtests_aarch64 = \
>     'migration-test']
>
>  qtests_s390x = \
> -  (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) +
>  \
> -  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +
>                        \
> -  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : [])
> +                     \
> +  qtests_filter + \
>    ['boot-serial-test',
>     'drive_del-test',
>     'device-plug-test',
> --
> 2.31.1
>
>
Re: [PATCH 16/18] tests/qtest/meson.build: Run the net filter tests only with default devices
Posted by Thomas Huth 2 years, 9 months ago
On 14/05/2023 22.31, Paolo Bonzini wrote:
> 
> 
> Il ven 12 mag 2023, 14:41 Thomas Huth <thuth@redhat.com 
> <mailto:thuth@redhat.com>> ha scritto:
> 
>     These tests rely on a default NIC to be available. Skip them if we
>     used the "--without-default-devices" configure option.
> 
>     Signed-off-by: Thomas Huth <thuth@redhat.com <mailto:thuth@redhat.com>>
> 
> 
> This is the only patch I have some qualms about, because it reduces coverage 
> in legitimate setups where the default NIC _is_ included in the binary.
> 
> Still a lot better than before, but please add a FIXME here.

Ok, will do.

> We can perhaps 
> try to use QMP to check if the machines have a usable default NIC, and if 
> not skip the test, but this should not block the bulk of your work from 
> being merged.

I'm currently not aware of a way to query the default NIC via QMP, so this 
might need some extensions there ... but I'll keep it in mind.

The alternative would be to hard-code the default NICs for each architecture 
in the tests again and check for the availability with that hard-coded list 
... but that's also ugly, I think.

> So, apart from this issue, series
> 
> Acked-by: Paolo Bonzini <pbonzini@redhat.com>

Thanks!

  Thomas
Re: [PATCH 16/18] tests/qtest/meson.build: Run the net filter tests only with default devices
Posted by Paolo Bonzini 2 years, 9 months ago
On Mon, May 15, 2023 at 11:46 AM Thomas Huth <thuth@redhat.com> wrote:
> On 14/05/2023 22.31, Paolo Bonzini wrote:
> > We can perhaps
> > try to use QMP to check if the machines have a usable default NIC, and if
> > not skip the test, but this should not block the bulk of your work from
> > being merged.
>
> I'm currently not aware of a way to query the default NIC via QMP, so this
> might need some extensions there ... but I'll keep it in mind.

Yes, it would need some changes to MachineInfo (in qapi/machine.json).

Paolo