From: Peter Krempa Date: Thu, 26 Nov 2020 17:35:55 +0000 (+0100) Subject: tests: qemuxml2argv: Validate generation of JSON props for object-add X-Git-Tag: v7.2.0-rc1~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7dea29431ea3e323dc167bd19d10371be49cac72;p=thirdparty%2Flibvirt.git tests: qemuxml2argv: Validate generation of JSON props for object-add Similarly to the validation for blockdev-add and netdev_add, use the qemuxml2argv test repository to drive validation of props for object-add. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 44c2a316b0..1f53d95f13 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -603,6 +603,24 @@ testCompareXMLToArgvValidateSchema(virQEMUDriverPtr drv, return -1; } + i++; + } else if (STREQ(args[i], "-object")) { + + if (*args[i + 1] != '{') { + i++; + continue; + } + + if (!(jsonargs = virJSONValueFromString(args[i + 1]))) + return -1; + + if (testQEMUSchemaValidateCommand("object-add", jsonargs, + schema, false, false, &debug) < 0) { + VIR_TEST_VERBOSE("failed to validate -object '%s' against QAPI schema: %s", + args[i + 1], virBufferCurrentContent(&debug)); + return -1; + } + i++; } }