virschematest: Validate schema in tests/cputestdata

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@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2020-10-07 16:52:14 +02:00
parent f3bbaf3169
commit e257493441

View File

@ -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;
}