From 6f34a991c71c1325d01a66f1fa92838026850986 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 15 Oct 2021 12:21:06 +0200 Subject: [PATCH] testCompareXMLToArgvValidateSchemaCommand: Add validation for '-device' MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Now that we use JSON with -device we can validate it at least partially (since the schema for 'device_add' is for now incomplete) against the QMP schema. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- tests/qemuxml2argvtest.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index d6cc2a51c2..e209b48fce 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -490,13 +490,15 @@ testCompareXMLToArgvCreateArgs(virQEMUDriver *drv, struct testValidateSchemaCommandData { const char *name; const char *schema; + bool allowIncomplete; /* relax validator for commands with incomplete schema */ }; static const struct testValidateSchemaCommandData commands[] = { - { "-blockdev", "blockdev-add" }, - { "-netdev", "netdev_add" }, - { "-object", "object-add" }, + { "-blockdev", "blockdev-add", false }, + { "-netdev", "netdev_add", false }, + { "-object", "object-add", false }, + { "-device", "device_add", true }, }; static int @@ -535,7 +537,9 @@ testCompareXMLToArgvValidateSchemaCommand(GStrv args, return -1; if (testQEMUSchemaValidateCommand(command->schema, jsonargs, - schema, false, false, false, &debug) < 0) { + schema, false, false, + command->allowIncomplete, + &debug) < 0) { VIR_TEST_VERBOSE("failed to validate '%s %s' against QAPI schema: %s", command->name, curargs, virBufferCurrentContent(&debug)); return -1; -- 2.47.2