[PATCH 22/51] tests/qtest: qmp-test: Skip running test_qmp_oob for win32

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 22/51] tests/qtest: qmp-test: Skip running test_qmp_oob for win32
Posted by Bin Meng 3 years, 5 months ago
From: Bin Meng <bin.meng@windriver.com>

The test_qmp_oob test case calls mkfifo() which does not exist on
win32. Exclude it.

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

 tests/qtest/qmp-test.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/qtest/qmp-test.c b/tests/qtest/qmp-test.c
index b950dbafaf..4a165447f8 100644
--- a/tests/qtest/qmp-test.c
+++ b/tests/qtest/qmp-test.c
@@ -159,6 +159,8 @@ static void test_qmp_protocol(void)
     qtest_quit(qts);
 }
 
+#ifndef _WIN32
+
 /* Out-of-band tests */
 
 char *tmpdir;
@@ -279,6 +281,8 @@ static void test_qmp_oob(void)
     qtest_quit(qts);
 }
 
+#endif /* _WIN32 */
+
 /* Preconfig tests */
 
 static void test_qmp_preconfig(void)
@@ -338,7 +342,9 @@ int main(int argc, char *argv[])
     g_test_init(&argc, &argv, NULL);
 
     qtest_add_func("qmp/protocol", test_qmp_protocol);
+#ifndef _WIN32
     qtest_add_func("qmp/oob", test_qmp_oob);
+#endif
     qtest_add_func("qmp/preconfig", test_qmp_preconfig);
     qtest_add_func("qmp/missing-any-arg", test_qmp_missing_any_arg);
 
-- 
2.34.1
Re: [PATCH 22/51] tests/qtest: qmp-test: Skip running test_qmp_oob for win32
Posted by Markus Armbruster 3 years, 5 months ago
Bin Meng <bmeng.cn@gmail.com> writes:

> From: Bin Meng <bin.meng@windriver.com>
>
> The test_qmp_oob test case calls mkfifo() which does not exist on
> win32. Exclude it.
>
> Signed-off-by: Bin Meng <bin.meng@windriver.com>
> ---
>
>  tests/qtest/qmp-test.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/tests/qtest/qmp-test.c b/tests/qtest/qmp-test.c
> index b950dbafaf..4a165447f8 100644
> --- a/tests/qtest/qmp-test.c
> +++ b/tests/qtest/qmp-test.c
> @@ -159,6 +159,8 @@ static void test_qmp_protocol(void)
>      qtest_quit(qts);
>  }
>  
> +#ifndef _WIN32
> +
>  /* Out-of-band tests */
>  
>  char *tmpdir;
> @@ -279,6 +281,8 @@ static void test_qmp_oob(void)
>      qtest_quit(qts);
>  }
>  
> +#endif /* _WIN32 */
> +
>  /* Preconfig tests */
>  
>  static void test_qmp_preconfig(void)
> @@ -338,7 +342,9 @@ int main(int argc, char *argv[])
>      g_test_init(&argc, &argv, NULL);
>  
>      qtest_add_func("qmp/protocol", test_qmp_protocol);
> +#ifndef _WIN32
>      qtest_add_func("qmp/oob", test_qmp_oob);
> +#endif
>      qtest_add_func("qmp/preconfig", test_qmp_preconfig);
>      qtest_add_func("qmp/missing-any-arg", test_qmp_missing_any_arg);

I'd appreciate a comment explaining why we have to disable this test on
Windows.
Re: [PATCH 22/51] tests/qtest: qmp-test: Skip running test_qmp_oob for win32
Posted by Bin Meng 3 years, 5 months ago
Hi Markus,

On Mon, Aug 29, 2022 at 9:14 PM Markus Armbruster <armbru@redhat.com> wrote:
>
> Bin Meng <bmeng.cn@gmail.com> writes:
>
> > From: Bin Meng <bin.meng@windriver.com>
> >
> > The test_qmp_oob test case calls mkfifo() which does not exist on
> > win32. Exclude it.
> >
> > Signed-off-by: Bin Meng <bin.meng@windriver.com>
> > ---
> >
> >  tests/qtest/qmp-test.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/tests/qtest/qmp-test.c b/tests/qtest/qmp-test.c
> > index b950dbafaf..4a165447f8 100644
> > --- a/tests/qtest/qmp-test.c
> > +++ b/tests/qtest/qmp-test.c
> > @@ -159,6 +159,8 @@ static void test_qmp_protocol(void)
> >      qtest_quit(qts);
> >  }
> >
> > +#ifndef _WIN32
> > +
> >  /* Out-of-band tests */
> >
> >  char *tmpdir;
> > @@ -279,6 +281,8 @@ static void test_qmp_oob(void)
> >      qtest_quit(qts);
> >  }
> >
> > +#endif /* _WIN32 */
> > +
> >  /* Preconfig tests */
> >
> >  static void test_qmp_preconfig(void)
> > @@ -338,7 +342,9 @@ int main(int argc, char *argv[])
> >      g_test_init(&argc, &argv, NULL);
> >
> >      qtest_add_func("qmp/protocol", test_qmp_protocol);
> > +#ifndef _WIN32
> >      qtest_add_func("qmp/oob", test_qmp_oob);
> > +#endif
> >      qtest_add_func("qmp/preconfig", test_qmp_preconfig);
> >      qtest_add_func("qmp/missing-any-arg", test_qmp_missing_any_arg);
>
> I'd appreciate a comment explaining why we have to disable this test on
> Windows.

The reason is explained in the commit message.

Regards,
Bin
Re: [PATCH 22/51] tests/qtest: qmp-test: Skip running test_qmp_oob for win32
Posted by Markus Armbruster 3 years, 5 months ago
Bin Meng <bmeng.cn@gmail.com> writes:

> Hi Markus,
>
> On Mon, Aug 29, 2022 at 9:14 PM Markus Armbruster <armbru@redhat.com> wrote:
>>
>> Bin Meng <bmeng.cn@gmail.com> writes:
>>
>> > From: Bin Meng <bin.meng@windriver.com>
>> >
>> > The test_qmp_oob test case calls mkfifo() which does not exist on
>> > win32. Exclude it.
>> >
>> > Signed-off-by: Bin Meng <bin.meng@windriver.com>
>> > ---
>> >
>> >  tests/qtest/qmp-test.c | 6 ++++++
>> >  1 file changed, 6 insertions(+)
>> >
>> > diff --git a/tests/qtest/qmp-test.c b/tests/qtest/qmp-test.c
>> > index b950dbafaf..4a165447f8 100644
>> > --- a/tests/qtest/qmp-test.c
>> > +++ b/tests/qtest/qmp-test.c
>> > @@ -159,6 +159,8 @@ static void test_qmp_protocol(void)
>> >      qtest_quit(qts);
>> >  }
>> >
>> > +#ifndef _WIN32
>> > +
>> >  /* Out-of-band tests */
>> >
>> >  char *tmpdir;
>> > @@ -279,6 +281,8 @@ static void test_qmp_oob(void)
>> >      qtest_quit(qts);
>> >  }
>> >
>> > +#endif /* _WIN32 */
>> > +
>> >  /* Preconfig tests */
>> >
>> >  static void test_qmp_preconfig(void)
>> > @@ -338,7 +342,9 @@ int main(int argc, char *argv[])
>> >      g_test_init(&argc, &argv, NULL);
>> >
>> >      qtest_add_func("qmp/protocol", test_qmp_protocol);
>> > +#ifndef _WIN32
>> >      qtest_add_func("qmp/oob", test_qmp_oob);
>> > +#endif
>> >      qtest_add_func("qmp/preconfig", test_qmp_preconfig);
>> >      qtest_add_func("qmp/missing-any-arg", test_qmp_missing_any_arg);
>>
>> I'd appreciate a comment explaining why we have to disable this test on
>> Windows.
>
> The reason is explained in the commit message.

Yes, and putting it there is a good idea.  But I'd appreciate if you
*also* put it in the code, so future readers of the code don't have to
dig through git history.
Re: [PATCH 22/51] tests/qtest: qmp-test: Skip running test_qmp_oob for win32
Posted by Philippe Mathieu-Daudé via 3 years, 5 months ago
On 29/8/22 17:06, Markus Armbruster wrote:
> Bin Meng <bmeng.cn@gmail.com> writes:
> 
>> Hi Markus,
>>
>> On Mon, Aug 29, 2022 at 9:14 PM Markus Armbruster <armbru@redhat.com> wrote:
>>>
>>> Bin Meng <bmeng.cn@gmail.com> writes:
>>>
>>>> From: Bin Meng <bin.meng@windriver.com>
>>>>
>>>> The test_qmp_oob test case calls mkfifo() which does not exist on
>>>> win32. Exclude it.
>>>>
>>>> Signed-off-by: Bin Meng <bin.meng@windriver.com>
>>>> ---
>>>>
>>>>   tests/qtest/qmp-test.c | 6 ++++++
>>>>   1 file changed, 6 insertions(+)
>>>>
>>>> diff --git a/tests/qtest/qmp-test.c b/tests/qtest/qmp-test.c
>>>> index b950dbafaf..4a165447f8 100644
>>>> --- a/tests/qtest/qmp-test.c
>>>> +++ b/tests/qtest/qmp-test.c
>>>> @@ -159,6 +159,8 @@ static void test_qmp_protocol(void)
>>>>       qtest_quit(qts);
>>>>   }
>>>>
>>>> +#ifndef _WIN32
>>>> +
>>>>   /* Out-of-band tests */
>>>>
>>>>   char *tmpdir;
>>>> @@ -279,6 +281,8 @@ static void test_qmp_oob(void)
>>>>       qtest_quit(qts);
>>>>   }
>>>>
>>>> +#endif /* _WIN32 */
>>>> +
>>>>   /* Preconfig tests */
>>>>
>>>>   static void test_qmp_preconfig(void)
>>>> @@ -338,7 +342,9 @@ int main(int argc, char *argv[])
>>>>       g_test_init(&argc, &argv, NULL);
>>>>
>>>>       qtest_add_func("qmp/protocol", test_qmp_protocol);
>>>> +#ifndef _WIN32
>>>>       qtest_add_func("qmp/oob", test_qmp_oob);
>>>> +#endif
>>>>       qtest_add_func("qmp/preconfig", test_qmp_preconfig);
>>>>       qtest_add_func("qmp/missing-any-arg", test_qmp_missing_any_arg);
>>>
>>> I'd appreciate a comment explaining why we have to disable this test on
>>> Windows.
>>
>> The reason is explained in the commit message.
> 
> Yes, and putting it there is a good idea.  But I'd appreciate if you
> *also* put it in the code, so future readers of the code don't have to
> dig through git history.

This could be self-explicit using instead:

   #if HAVE_POSIX_MKFIFO
Re: [PATCH 22/51] tests/qtest: qmp-test: Skip running test_qmp_oob for win32
Posted by Thomas Huth 3 years, 5 months ago
On 24/08/2022 11.40, Bin Meng wrote:
> From: Bin Meng <bin.meng@windriver.com>
> 
> The test_qmp_oob test case calls mkfifo() which does not exist on
> win32. Exclude it.
> 
> Signed-off-by: Bin Meng <bin.meng@windriver.com>
> ---
> 
>   tests/qtest/qmp-test.c | 6 ++++++
>   1 file changed, 6 insertions(+)

Reviewed-by: Thomas Huth <thuth@redhat.com>