]> xenbits.xensource.com Git - libvirt.git/commitdiff
testCompareXMLToArgvValidateSchema: Improve and fix helper for testing everything
authorPeter Krempa <pkrempa@redhat.com>
Fri, 19 Feb 2021 15:25:29 +0000 (16:25 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Sat, 20 Feb 2021 12:27:44 +0000 (13:27 +0100)
The schema validator has a comment which allows checking all xml2argv
input files for schema validity by forcing the latest schema onto files
which don't have any schema. Fix it so that it works properly with the
caching introduced in previous commit.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
tests/qemuxml2argvtest.c

index 647187404ccb298c037e8a6c6402fa5b0e078ccd..2d538bee9ce2c9b0e6e1e14a3f2304529cbcb3e1 100644 (file)
@@ -528,6 +528,11 @@ testCompareXMLToArgvValidateSchema(virQEMUDriverPtr drv,
     unsigned int parseFlags = info->parseFlags;
     bool netdevQAPIfied = false;
 
+    /* comment out with line comment to enable schema checking for non _CAPS tests
+    if (!info->schemafile)
+        info->schemafile =  testQemuGetLatestCapsForArch(virArchToString(info->arch), "replies");
+    // */
+
     if (info->schemafile) {
         /* lookup and insert into cache if not found */
         if (!g_hash_table_lookup_extended(info->qapiSchemaCache,
@@ -540,11 +545,6 @@ testCompareXMLToArgvValidateSchema(virQEMUDriverPtr drv,
         }
     }
 
-    /* comment out with line comment to enable schema checking for non _CAPS tests
-    if (!schema)
-        schema = testQEMUSchemaLoadLatest(virArchToString(info->arch));
-    // */
-
     if (!schema)
         return 0;