From: Peter Krempa Date: Wed, 7 Oct 2020 14:52:14 +0000 (+0200) Subject: virschematest: Validate schema in tests/cputestdata X-Git-Tag: v6.9.0-rc1~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e25749344186ec548d46a8d1dbd1d6a8dece5748;p=thirdparty%2Flibvirt.git 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 Reviewed-by: Michal Privoznik --- 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; }