From: Peter Krempa Date: Tue, 8 Jul 2025 13:53:31 +0000 (+0200) Subject: schema: Schema validate host '' XML test documents X-Git-Tag: v11.6.0-rc1~110 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6465a813d6aac5f5d8925a0dd3da64ff189796c4;p=thirdparty%2Flibvirt.git schema: Schema validate host '' XML test documents Introduce schema for the host '' output XMLs and validate our test data against the schema. This requires introduction of schema for '' and '' elements which are not supported when sysinfo is set explicitly for a domian definition. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- diff --git a/src/conf/schemas/sysinfo.rng b/src/conf/schemas/sysinfo.rng new file mode 100644 index 0000000000..01d305b9d6 --- /dev/null +++ b/src/conf/schemas/sysinfo.rng @@ -0,0 +1,34 @@ + + + + + + + + smbios + + + + + + + + + + + + + + fwcfg + + + + + + + + + + + + diff --git a/src/conf/schemas/sysinfocommon.rng b/src/conf/schemas/sysinfocommon.rng index dc3b761206..41296ea95e 100644 --- a/src/conf/schemas/sysinfocommon.rng +++ b/src/conf/schemas/sysinfocommon.rng @@ -63,6 +63,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -136,6 +166,37 @@ + + + socket_destination + type + family + manufacturer + signature + version + external_clock + max_speed + status + serial_number + part_number + + + + + + size + form_factor + locator + bank_locator + type + type_detail + speed + manufacturer + serial_number + part_number + + + diff --git a/tests/virschematest.c b/tests/virschematest.c index e08ae21738..57a49c270c 100644 --- a/tests/virschematest.c +++ b/tests/virschematest.c @@ -369,6 +369,10 @@ static const struct testSchemaEntry testDevice[] = { { .dir = "tests/qemublocktestdata/xml2json" }, }; +static const struct testSchemaEntry schemaSysinfo[] = { + { .dir = "tests/sysinfodata" }, +}; + static int mymain(void) { @@ -397,6 +401,7 @@ mymain(void) DO_TEST(SCHEMAS_PATH "storagepoolcaps.rng", schemaStoragepoolcaps); DO_TEST(SCHEMAS_PATH "storagepool.rng", schemaStoragePool); DO_TEST(SCHEMAS_PATH "storagevol.rng", schemaStorageVol); + DO_TEST(SCHEMAS_PATH "sysinfo.rng", schemaSysinfo); DO_TEST(INTERNAL_SCHEMAS_PATH "cpu-baseline.rng", testsCpuBaseline); DO_TEST(INTERNAL_SCHEMAS_PATH "device.rng", testDevice);