[PATCH v2 18/18] virschematest: Validate schema in tests/cputestdata

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We now have a schema file for the 'cpu' elements. Use it to validate
files in 'tests/cputestdata'

Unfortunately the files in the directory are too disorganised and not
easy to split up to do something more straightforward.

The -baseline- input files are tested by the test internally and the
rest of the files are internal data feeding the tests so they don't
need validation.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 tests/virschematest.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tests/virschematest.c b/tests/virschematest.c
index 6ce09d4737..0e587c3ff0 100644
--- a/tests/virschematest.c
+++ b/tests/virschematest.c
@@ -323,6 +323,14 @@ static const struct testSchemaEntry schemaStorageVol[] = {
     { .file = "examples/xml/test/testvol.xml" },
 };

+static const struct testSchemaEntry schemaCpu[] = {
+    { . dir = "tests/cputestdata",
+      . dirRegex = "^[^-]+-cpuid-.*(-host|-guest|-json)\\.xml$" },
+    { . dir = "tests/cputestdata",
+      . dirRegex = "^[^-]+-baseline-.*-result\\.xml$" },
+    { . dir = "tests/cputestdata",
+      . dirRegex = "^[^-]+-(?!cpuid|baseline).*$" },
+};

 static int
 mymain(void)
@@ -349,6 +357,7 @@ mymain(void)
     DO_TEST("docs/schemas/storagepoolcaps.rng", schemaStoragepoolcaps);
     DO_TEST("docs/schemas/storagepool.rng", schemaStoragePool);
     DO_TEST("docs/schemas/storagevol.rng", schemaStorageVol);
+    DO_TEST("docs/schemas/cpu.rng", schemaCpu);

     return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
 }
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux