qemuxml2argvtest: Add parsing of the input XML as separate test

Get clean separation between the parsing and argv conversion so that
it's obvious in the test output:

2409) QEMU XML def parse s390-async-teardown.s390x-6.0.0                ... libvirt: QEMU Driver error : unsupported configuration: asynchronous teardown is not available with this QEMU binary
OK
2410) QEMU XML def -> ARGV s390-async-teardown.s390x-6.0.0              ... SKIP

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2023-12-18 16:02:33 +01:00
parent 75f7105f5c
commit a6eed3bf27

View File

@ -904,6 +904,18 @@ testConfXMLEnumerate(GHashTable *existingTestCases)
}
static int
testXMLParse(const void *data)
{
testQemuInfo *info = (void *) data;
int rc = 0;
testQemuConfXMLCommon(info, &rc);
return rc;
}
static void
testRun(const char *name,
const char *suffix,
@ -911,7 +923,8 @@ testRun(const char *name,
struct testQemuConf *testConf,
...)
{
g_autofree char *testname = g_strdup_printf("QEMU XML-2-ARGV %s%s", name, suffix);
g_autofree char *name_parse = g_strdup_printf("QEMU XML def parse %s%s", name, suffix);
g_autofree char *name_argv = g_strdup_printf("QEMU XML def -> ARGV %s%s", name, suffix);
g_autoptr(testQemuInfo) info = g_new0(testQemuInfo, 1);
va_list ap;
@ -926,7 +939,8 @@ testRun(const char *name,
info->outfile = g_strdup_printf("%s/qemuxml2argvdata/%s%s.args", abs_srcdir, info->name, suffix);
info->errfile = g_strdup_printf("%s/qemuxml2argvdata/%s%s.err", abs_srcdir, info->name, suffix);
virTestRunLog(ret, testname, testCompareXMLToArgv, info);
virTestRunLog(ret, name_parse, testXMLParse, info);
virTestRunLog(ret, name_argv, testCompareXMLToArgv, info);
/* clear overriden host cpu */
if (info->args.capsHostCPUModel)