[PATCH 02/15] testutilsqemuschema: Introduce testQEMUSchemaValidateCommand

Ján Tomko jtomko at redhat.com
Mon May 18 14:44:34 UTC 2020


On a Wednesday in 2020, Peter Krempa wrote:
>The new helper splits out all steps necessary to validate a QMP command
>against the schema.
>
>Signed-off-by: Peter Krempa <pkrempa at redhat.com>
>---
> tests/testutilsqemuschema.c | 44 +++++++++++++++++++++++++++++++++++++
> tests/testutilsqemuschema.h |  6 +++++
> 2 files changed, 50 insertions(+)
>
>diff --git a/tests/testutilsqemuschema.c b/tests/testutilsqemuschema.c
>index 7b82ff27b2..60409a0f91 100644
>--- a/tests/testutilsqemuschema.c
>+++ b/tests/testutilsqemuschema.c
>@@ -517,6 +517,50 @@ testQEMUSchemaValidate(virJSONValuePtr obj,
> }
>
>
>+/**
>+ * testQEMUSchemaValidateCommand:
>+ * @command: command to validate
>+ * @arguments: arguments of @command to validate
>+ * @schema: hash table containing schema entries
>+ * @debug: a virBuffer which will be filled with debug information if provided
>+ *
>+ * Validates whether @command and it's @arguments conforms to the QAPI schema

*its
*conform

>+ * passed in via @schema. Returns 0, if the command and args matches @schema,

*match

>+ * -1 if it does not and -2 if there is a problem with the schema or with
>+ *  internals.
>+ *
>+ * @debug is filled with information regarding the validation process
>+ */

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200518/502c83ae/attachment-0001.sig>


More information about the libvir-list mailing list