[libvirt] [PATCH 04/12] tests: qemuMonitorTestProcessCommandDefaultValidate: simplify condition

Ján Tomko posted 12 patches 6 years, 7 months ago
[libvirt] [PATCH 04/12] tests: qemuMonitorTestProcessCommandDefaultValidate: simplify condition
Posted by Ján Tomko 6 years, 7 months ago
This function is skipped for non-JSON monitor (which never happens now)
and for agent connections (which we currently do not test).

Only check for qapischema to simplify the condition.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
 tests/qemumonitortestutils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c
index bb30bed51e..cf4fec8873 100644
--- a/tests/qemumonitortestutils.c
+++ b/tests/qemumonitortestutils.c
@@ -546,7 +546,7 @@ qemuMonitorTestProcessCommandDefaultValidate(qemuMonitorTestPtr test,
     char *schemapath = NULL;
     int ret = -1;
 
-    if (!test->qapischema || !test->json || test->agent)
+    if (!test->qapischema)
         return 0;
 
     /* 'device_add' needs to be skipped as it does not have fully defined schema */
-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 04/12] tests: qemuMonitorTestProcessCommandDefaultValidate: simplify condition
Posted by Peter Krempa 6 years, 7 months ago
On Sat, Jun 15, 2019 at 13:54:02 +0200, Ján Tomko wrote:
> This function is skipped for non-JSON monitor (which never happens now)
> and for agent connections (which we currently do not test).
> 
> Only check for qapischema to simplify the condition.
> 
> Signed-off-by: Ján Tomko <jtomko@redhat.com>
> ---
>  tests/qemumonitortestutils.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c
> index bb30bed51e..cf4fec8873 100644
> --- a/tests/qemumonitortestutils.c
> +++ b/tests/qemumonitortestutils.c
> @@ -546,7 +546,7 @@ qemuMonitorTestProcessCommandDefaultValidate(qemuMonitorTestPtr test,
>      char *schemapath = NULL;
>      int ret = -1;
>  
> -    if (!test->qapischema || !test->json || test->agent)
> +    if (!test->qapischema)

The check for test->agent is necessary, since we don't know how to
validate the agent monitor schema.
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list