qemuxml2argvtest: Add QAPI/QMP schema validation for -blockdev and -netdev

Our hotplug test cases are weak in comparison to the qemuxml2argvtest.
Use all the the input data to also validate the arguments for -netdev
and -blockdev against the appropriate commands of the QMP schema.

Note that currently it's done just for the _CAPS versions of tests but
commenting out a line in the test file allows to validate even cases
which don't use real capabilities.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
Peter Krempa
2020-05-15 14:33:10 +02:00
parent b6246d9320
commit 576746d412
4 changed files with 83 additions and 1 deletions

View File

@@ -770,6 +770,10 @@ testQemuInfoSetArgs(struct testQemuInfo *info,
if (stripmachinealiases)
virQEMUCapsStripMachineAliases(qemuCaps);
info->flags |= FLAG_REAL_CAPS;
/* provide path to the replies file for schema testing */
capsfile[strlen(capsfile) - 3] = '\0';
info->schemafile = g_strdup_printf("%sreplies", capsfile);
}
if (!qemuCaps) {
@@ -796,5 +800,6 @@ testQemuInfoClear(struct testQemuInfo *info)
{
VIR_FREE(info->infile);
VIR_FREE(info->outfile);
VIR_FREE(info->schemafile);
virObjectUnref(info->qemuCaps);
}