]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: do not mangle real qemu caps in xml2argvtest
authorJán Tomko <jtomko@redhat.com>
Sat, 8 Sep 2018 22:13:23 +0000 (00:13 +0200)
committerJán Tomko <jtomko@redhat.com>
Wed, 12 Sep 2018 19:12:22 +0000 (21:12 +0200)
None of the things testUpdateQEMUCaps adjusts are applicable
for tests that use the DO_TEST_CAPS macros, i.e.
real QEMU capabilities parsed from the XML files:

The architecture must be chosen before we even open the caps
file, CPU models are already present and the expensive HostModel
computation was already done in virQEMUCapsLoadCache.

Introduce FLAG_REAL_CAPS and skip the whole testUpdateQEMUCaps
function for DO_TEST_CAPS.

This speeds up the test by 25 %

Signed-off-by: Ján Tomko <jtomko@redhat.com>
tests/qemuxml2argvtest.c

index 5f0bd87baab10343c2ef80c990a5b47b0e0f2022..3267edf60a6fe52c2ebb16dd8de50151fde32060 100644 (file)
@@ -294,6 +294,7 @@ typedef enum {
     FLAG_EXPECT_PARSE_ERROR = 1 << 1,
     FLAG_FIPS               = 1 << 2,
     FLAG_STEAL_VM           = 1 << 3,
+    FLAG_REAL_CAPS          = 1 << 4,
 } virQemuXML2ArgvTestFlags;
 
 struct testInfo {
@@ -470,6 +471,7 @@ testCheckExclusiveFlags(int flags)
                   FLAG_EXPECT_PARSE_ERROR |
                   FLAG_FIPS |
                   FLAG_STEAL_VM |
+                  FLAG_REAL_CAPS |
                   0, -1);
 
     VIR_EXCLUSIVE_FLAGS_RET(FLAG_STEAL_VM, FLAG_EXPECT_FAILURE, -1);
@@ -566,7 +568,8 @@ testCompareXMLToArgv(const void *data)
     if (qemuProcessPrepareMonitorChr(&monitor_chr, priv->libDir) < 0)
         goto cleanup;
 
-    if (testUpdateQEMUCaps(info, vm, driver.caps) < 0)
+    if (!(info->flags & FLAG_REAL_CAPS) &&
+        testUpdateQEMUCaps(info, vm, driver.caps) < 0)
         goto cleanup;
 
     log = virTestLogContentAndReset();
@@ -783,7 +786,7 @@ mymain(void)
     do { \
         static struct testInfo info = { \
             name, "." suffix, NULL, migrateFrom, migrateFrom ? 7 : -1,\
-            (flags), parseFlags, false, NULL \
+            (flags | FLAG_REAL_CAPS), parseFlags, false, NULL \
         }; \
         info.skipLegacyCPUs = skipLegacyCPUs; \
         if (!(info.qemuCaps = qemuTestParseCapabilitiesArch(virArchFromString(arch), \