From f45aff16351634a502699e948be18ea9e2abf1b8 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Tue, 4 Jul 2023 13:39:24 +0200 Subject: [PATCH] qemuagenttest: Use real x86_64 capabilities for parsing domain definitions Some test cases require a real definition and thus parse a XML with the definition to obtain it. Convert the code to use real capabilities and switch to x86_64. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- tests/qemuagentdata/fsinfo.xml | 4 ++-- tests/qemuagenttest.c | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/qemuagentdata/fsinfo.xml b/tests/qemuagentdata/fsinfo.xml index 233968fc29..914c2828c6 100644 --- a/tests/qemuagentdata/fsinfo.xml +++ b/tests/qemuagentdata/fsinfo.xml @@ -5,7 +5,7 @@ 219136 1 - hvm + hvm @@ -13,7 +13,7 @@ restart destroy - /usr/bin/qemu-system-i386 + /usr/bin/qemu-system-x86_64 diff --git a/tests/qemuagenttest.c b/tests/qemuagenttest.c index 3c24a3139f..3287880241 100644 --- a/tests/qemuagenttest.c +++ b/tests/qemuagenttest.c @@ -1359,11 +1359,19 @@ testQemuAgentTimezone(const void *data) static int mymain(void) { + g_autoptr(GHashTable) capslatest = testQemuGetLatestCaps(); + g_autoptr(GHashTable) capscache = virHashNew(virObjectUnref); int ret = 0; if (qemuTestDriverInit(&driver) < 0) return EXIT_FAILURE; + /* Some test cases need a real definition thus parse a XML. We need + * qemu capabilities for that. */ + if (testQemuInsertRealCaps(driver.qemuCapsCache, "x86_64", "latest", "", + capslatest, capscache, NULL, NULL) < 0) + return EXIT_FAILURE; + virEventRegisterDefaultImpl(); #define DO_TEST(name) \