[PATCH 19/51] tests/qtest: Build test-filter-{mirror, redirector} cases for posix only

Bin Meng posted 51 patches 3 years, 5 months ago
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Thomas Huth <thuth@redhat.com>, Wainer dos Santos Moschetta <wainersm@redhat.com>, Beraldo Leal <bleal@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Stefan Berger <stefanb@linux.vnet.ibm.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Greg Kurz <groug@kaod.org>, Christian Schoenebeck <qemu_oss@crudebyte.com>, "Cédric Le Goater" <clg@kaod.org>, Daniel Henrique Barboza <danielhb413@gmail.com>, David Gibson <david@gibson.dropbear.id.au>, Gerd Hoffmann <kraxel@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Yanan Wang <wangyanan55@huawei.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Michael Roth <michael.roth@amd.com>, Konstantin Kostiuk <kkostiuk@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Juan Quintela <quintela@redhat.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, John Snow <jsnow@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Andrew Jeffery <andrew@aj.id.au>, Joel Stanley <joel@jms.id.au>, "Michael S. Tsirkin" <mst@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <ani@anisinha.ca>, Alexander Bulekov <alxndr@bu.edu>, Bandan Das <bsd@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Darren Kenny <darren.kenny@oracle.com>, Qiuhao Li <Qiuhao.Li@outlook.com>, Havard Skinnemoen <hskinnemoen@google.com>, Tyrone Ting <kfting@nuvoton.com>, Markus Armbruster <armbru@redhat.com>, Coiby Xu <Coiby.Xu@gmail.com>, Jason Wang <jasowang@redhat.com>, Fam Zheng <fam@euphon.net>
There is a newer version of this series
[PATCH 19/51] tests/qtest: Build test-filter-{mirror, redirector} cases for posix only
Posted by Bin Meng 3 years, 5 months ago
From: Bin Meng <bin.meng@windriver.com>

The test-filter-{mirror,redirector} cases use socketpair() API that
is only available on POSIX and should only be built for POSIX.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
---

 tests/qtest/meson.build | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
index 9e484e60ba..c97da5a062 100644
--- a/tests/qtest/meson.build
+++ b/tests/qtest/meson.build
@@ -42,6 +42,7 @@ qtests_cxl = \
 qtests_i386 = \
   (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) +             \
   (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +                     \
+  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) +                 \
   (have_tools ? ['ahci-test'] : []) +                                                       \
   (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) +           \
   (config_all_devices.has_key('CONFIG_SGA') ? ['boot-serial-test'] : []) +                  \
@@ -95,8 +96,7 @@ qtests_i386 = \
    'vmgenid-test',
    'migration-test',
    'test-x86-cpuid-compat',
-   'numa-test',
-   'test-filter-redirector'
+   'numa-test'
   ]
 
 if dbus_display
@@ -120,29 +120,34 @@ endif
 qtests_x86_64 = qtests_i386
 
 qtests_alpha = ['boot-serial-test'] + \
-  ['test-filter-mirror', 'test-filter-redirector'] + \
+  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +     \
+  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \
   (slirp.found() ? ['test-netfilter'] : []) + \
   (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
 
 qtests_avr = [ 'boot-serial-test' ]
 
 qtests_hppa = ['boot-serial-test'] + \
-  ['test-filter-mirror', 'test-filter-redirector'] + \
+  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +     \
+  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \
   (slirp.found() ? ['test-netfilter'] : []) + \
   (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
 
 qtests_m68k = ['boot-serial-test'] + \
-  ['test-filter-mirror', 'test-filter-redirector'] + \
+  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +     \
+  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \
   (slirp.found() ? ['test-netfilter'] : [])
 
 qtests_microblaze = ['boot-serial-test'] + \
-  ['test-filter-mirror', 'test-filter-redirector'] + \
+  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +     \
+  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \
   (slirp.found() ? ['test-netfilter'] : [])
 
 qtests_microblazeel = qtests_microblaze
 
 qtests_mips = \
-  ['test-filter-mirror', 'test-filter-redirector'] + \
+  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +     \
+  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \
   (slirp.found() ? ['test-netfilter'] : []) + \
   (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) +            \
   (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
@@ -152,7 +157,8 @@ qtests_mips64 = qtests_mips
 qtests_mips64el = qtests_mips
 
 qtests_ppc = \
-  ['test-filter-mirror', 'test-filter-redirector'] + \
+  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +     \
+  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \
   (slirp.found() ? ['test-netfilter'] : []) + \
   (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) +            \
   (config_all_devices.has_key('CONFIG_M48T59') ? ['m48t59-test'] : []) +                     \
@@ -174,13 +180,15 @@ qtests_sh4 = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-te
 qtests_sh4eb = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : [])
 
 qtests_sparc = ['prom-env-test', 'm48t59-test', 'boot-serial-test'] + \
-  ['test-filter-mirror', 'test-filter-redirector'] + \
+  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +     \
+  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \
   (slirp.found() ? ['test-netfilter'] : [])
 
 qtests_sparc64 = \
   (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) +            \
   (slirp.found() ? ['test-netfilter'] : []) + \
-  ['test-filter-mirror', 'test-filter-redirector'] + \
+  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +     \
+  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \
   ['prom-env-test', 'boot-serial-test']
 
 qtests_npcm7xx = \
-- 
2.34.1
Re: [PATCH 19/51] tests/qtest: Build test-filter-{mirror, redirector} cases for posix only
Posted by Marc-André Lureau 3 years, 5 months ago
On Wed, Aug 24, 2022 at 2:10 PM Bin Meng <bmeng.cn@gmail.com> wrote:

> From: Bin Meng <bin.meng@windriver.com>
>
> The test-filter-{mirror,redirector} cases use socketpair() API that
> is only available on POSIX and should only be built for POSIX.
>

It is possible to implement a pretty good alternative, like I did for glib (
https://gitlab.gnome.org/GNOME/glib/-/blob/main/gio/tests/socket.c#L2193)

I intend to add that in another series (based on yours), we can enable more
tests later.



>
> Signed-off-by: Bin Meng <bin.meng@windriver.com>
>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>
>  tests/qtest/meson.build | 28 ++++++++++++++++++----------
>  1 file changed, 18 insertions(+), 10 deletions(-)
>
> diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
> index 9e484e60ba..c97da5a062 100644
> --- a/tests/qtest/meson.build
> +++ b/tests/qtest/meson.build
> @@ -42,6 +42,7 @@ qtests_cxl = \
>  qtests_i386 = \
>    (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) +             \
>    (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +
>                    \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : [])
> +                 \
>    (have_tools ? ['ahci-test'] : []) +
>                    \
>    (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test']
> : []) +           \
>    (config_all_devices.has_key('CONFIG_SGA') ? ['boot-serial-test'] : [])
> +                  \
> @@ -95,8 +96,7 @@ qtests_i386 = \
>     'vmgenid-test',
>     'migration-test',
>     'test-x86-cpuid-compat',
> -   'numa-test',
> -   'test-filter-redirector'
> +   'numa-test'
>    ]
>
>  if dbus_display
> @@ -120,29 +120,34 @@ endif
>  qtests_x86_64 = qtests_i386
>
>  qtests_alpha = ['boot-serial-test'] + \
> -  ['test-filter-mirror', 'test-filter-redirector'] + \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +
>    \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : [])
> + \
>    (slirp.found() ? ['test-netfilter'] : []) + \
>    (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
>
>  qtests_avr = [ 'boot-serial-test' ]
>
>  qtests_hppa = ['boot-serial-test'] + \
> -  ['test-filter-mirror', 'test-filter-redirector'] + \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +
>    \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : [])
> + \
>    (slirp.found() ? ['test-netfilter'] : []) + \
>    (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
>
>  qtests_m68k = ['boot-serial-test'] + \
> -  ['test-filter-mirror', 'test-filter-redirector'] + \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +
>    \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : [])
> + \
>    (slirp.found() ? ['test-netfilter'] : [])
>
>  qtests_microblaze = ['boot-serial-test'] + \
> -  ['test-filter-mirror', 'test-filter-redirector'] + \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +
>    \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : [])
> + \
>    (slirp.found() ? ['test-netfilter'] : [])
>
>  qtests_microblazeel = qtests_microblaze
>
>  qtests_mips = \
> -  ['test-filter-mirror', 'test-filter-redirector'] + \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +
>    \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : [])
> + \
>    (slirp.found() ? ['test-netfilter'] : []) + \
>    (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test']
> : []) +            \
>    (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
> @@ -152,7 +157,8 @@ qtests_mips64 = qtests_mips
>  qtests_mips64el = qtests_mips
>
>  qtests_ppc = \
> -  ['test-filter-mirror', 'test-filter-redirector'] + \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +
>    \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : [])
> + \
>    (slirp.found() ? ['test-netfilter'] : []) + \
>    (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test']
> : []) +            \
>    (config_all_devices.has_key('CONFIG_M48T59') ? ['m48t59-test'] : []) +
>                    \
> @@ -174,13 +180,15 @@ qtests_sh4 =
> (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-te
>  qtests_sh4eb = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ?
> ['endianness-test'] : [])
>
>  qtests_sparc = ['prom-env-test', 'm48t59-test', 'boot-serial-test'] + \
> -  ['test-filter-mirror', 'test-filter-redirector'] + \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +
>    \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : [])
> + \
>    (slirp.found() ? ['test-netfilter'] : [])
>
>  qtests_sparc64 = \
>    (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test']
> : []) +            \
>    (slirp.found() ? ['test-netfilter'] : []) + \
> -  ['test-filter-mirror', 'test-filter-redirector'] + \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +
>    \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : [])
> + \
>    ['prom-env-test', 'boot-serial-test']
>
>  qtests_npcm7xx = \
> --
> 2.34.1
>
>
>

-- 
Marc-André Lureau
Re: [PATCH 19/51] tests/qtest: Build test-filter-{mirror, redirector} cases for posix only
Posted by Thomas Huth 3 years, 5 months ago
On 24/08/2022 11.39, Bin Meng wrote:
> From: Bin Meng <bin.meng@windriver.com>
> 
> The test-filter-{mirror,redirector} cases use socketpair() API that
> is only available on POSIX and should only be built for POSIX.
> 
> Signed-off-by: Bin Meng <bin.meng@windriver.com>
> ---
> 
>   tests/qtest/meson.build | 28 ++++++++++++++++++----------
>   1 file changed, 18 insertions(+), 10 deletions(-)
> 
> diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
> index 9e484e60ba..c97da5a062 100644
> --- a/tests/qtest/meson.build
> +++ b/tests/qtest/meson.build
> @@ -42,6 +42,7 @@ qtests_cxl = \
>   qtests_i386 = \
>     (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) +             \
>     (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +                     \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) +                 \
>     (have_tools ? ['ahci-test'] : []) +                                                       \
>     (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) +           \
>     (config_all_devices.has_key('CONFIG_SGA') ? ['boot-serial-test'] : []) +                  \
> @@ -95,8 +96,7 @@ qtests_i386 = \
>      'vmgenid-test',
>      'migration-test',
>      'test-x86-cpuid-compat',
> -   'numa-test',
> -   'test-filter-redirector'
> +   'numa-test'
>     ]
>   
>   if dbus_display
> @@ -120,29 +120,34 @@ endif
>   qtests_x86_64 = qtests_i386
>   
>   qtests_alpha = ['boot-serial-test'] + \
> -  ['test-filter-mirror', 'test-filter-redirector'] + \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +     \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \
>     (slirp.found() ? ['test-netfilter'] : []) + \
>     (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
>   
>   qtests_avr = [ 'boot-serial-test' ]
>   
>   qtests_hppa = ['boot-serial-test'] + \
> -  ['test-filter-mirror', 'test-filter-redirector'] + \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +     \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \
>     (slirp.found() ? ['test-netfilter'] : []) + \
>     (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
>   
>   qtests_m68k = ['boot-serial-test'] + \
> -  ['test-filter-mirror', 'test-filter-redirector'] + \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +     \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \
>     (slirp.found() ? ['test-netfilter'] : [])
>   
>   qtests_microblaze = ['boot-serial-test'] + \
> -  ['test-filter-mirror', 'test-filter-redirector'] + \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +     \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \
>     (slirp.found() ? ['test-netfilter'] : [])
>   
>   qtests_microblazeel = qtests_microblaze
>   
>   qtests_mips = \
> -  ['test-filter-mirror', 'test-filter-redirector'] + \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +     \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \
>     (slirp.found() ? ['test-netfilter'] : []) + \
>     (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) +            \
>     (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
> @@ -152,7 +157,8 @@ qtests_mips64 = qtests_mips
>   qtests_mips64el = qtests_mips
>   
>   qtests_ppc = \
> -  ['test-filter-mirror', 'test-filter-redirector'] + \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +     \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \
>     (slirp.found() ? ['test-netfilter'] : []) + \
>     (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) +            \
>     (config_all_devices.has_key('CONFIG_M48T59') ? ['m48t59-test'] : []) +                     \
> @@ -174,13 +180,15 @@ qtests_sh4 = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-te
>   qtests_sh4eb = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : [])
>   
>   qtests_sparc = ['prom-env-test', 'm48t59-test', 'boot-serial-test'] + \
> -  ['test-filter-mirror', 'test-filter-redirector'] + \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +     \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \
>     (slirp.found() ? ['test-netfilter'] : [])
>   
>   qtests_sparc64 = \
>     (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) +            \
>     (slirp.found() ? ['test-netfilter'] : []) + \
> -  ['test-filter-mirror', 'test-filter-redirector'] + \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) +     \
> +  (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \
>     ['prom-env-test', 'boot-serial-test']
>   
>   qtests_npcm7xx = \

It might be easier to introduce a new variable à la:

filter_qtests = \
   (slirp.found() ? ['test-netfilter'] : []) + \
   (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
   (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : [])

And then add that to the qtest_ARCH variables instead?

  Thomas