From 6465a813d6aac5f5d8925a0dd3da64ff189796c4 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Tue, 8 Jul 2025 15:53:31 +0200 Subject: [PATCH] schema: Schema validate host '' XML test documents MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/conf/schemas/sysinfo.rng | 34 +++++++++++++++++ src/conf/schemas/sysinfocommon.rng | 61 ++++++++++++++++++++++++++++++ tests/virschematest.c | 5 +++ 3 files changed, 100 insertions(+) create mode 100644 src/conf/schemas/sysinfo.rng 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); -- 2.47.2