diff mbox series

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

Message ID 20220824094029.1634519-23-bmeng.cn@gmail.com (mailing list archive)
State New, archived
Headers show
Series tests/qtest: Enable running qtest on Windows | expand

Commit Message

Bin Meng Aug. 24, 2022, 9:40 a.m. UTC
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(+)

Comments

Thomas Huth Aug. 25, 2022, 11:45 a.m. UTC | #1
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>
Markus Armbruster Aug. 29, 2022, 1:14 p.m. UTC | #2
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.
Bin Meng Aug. 29, 2022, 2:23 p.m. UTC | #3
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
Markus Armbruster Aug. 29, 2022, 3:06 p.m. UTC | #4
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.
Philippe Mathieu-Daudé Sept. 4, 2022, 2:07 p.m. UTC | #5
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
diff mbox series

Patch

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);