From a6eed3bf271a6b2f78450d8b16e0ea282c2bc856 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 18 Dec 2023 16:02:33 +0100 Subject: [PATCH] qemuxml2argvtest: Add parsing of the input XML as separate test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Ján Tomko --- tests/qemuxml2argvtest.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index a935dfa7b8..36135329e6 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -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)