[PATCH v2 00/18] virschematest: Improve XML validation

Quite a few XMLs in examples/tests are not validated, many of them actually invalid. Improve schema validation. v2: - pushed ACK'd patches - rebased - added patch for schema validation of tests/cputestdata Peter Krempa (18): virschematest: Rewrite internals to allow increasing XML test coverage virschematest: Add regex filtering for directory contents examples: xml: Fix 'pool-netfs.xml' example examples: xml: Fix 'vol-raw.xml' and 'vol-sparse.xml' virschematest: Add coverage for 'examples/xml/storage' virschematest: Add coverage for 'examples/xml/test' virschematest: Fix testing of 'nwfilter' xmls domainconfdata/getfilesystem.xml: Remove <init> element schema: nwfilter: Allow all accepted values for 'ipsetflags' schema: nwfiter: Allow leading/trailing whitespace in 'variable-name-type' nwfilterxml2firewall: Fix schema compilance of 'tcp' test case nwfilterxml2xmltest: Rename cases with XMLs not conforming to schema schema: domain: Add definition for the 'vmware' private namespace schema: domain: Allow space in XML schema for bridge source tests: vmx: Add <name> element for all domain XMLs virschematest: Add directories containing domain XMLs virschematest: Validate more XMLs virschematest: Validate schema in tests/cputestdata docs/schemas/domaincommon.rng | 17 +- docs/schemas/nwfilter.rng | 4 +- examples/xml/storage/pool-netfs.xml | 2 +- examples/xml/storage/vol-raw.xml | 3 + examples/xml/storage/vol-sparse.xml | 3 + tests/domainconfdata/getfilesystem.xml | 1 - tests/nwfilterxml2firewalldata/tcp.xml | 2 +- ...ipv6-test.xml => ah-ipv6-test-invalid.xml} | 0 ...pv6-test.xml => all-ipv6-test-invalid.xml} | 0 .../{arp-test.xml => arp-test-invalid.xml} | 0 ...est1.xml => chain_prefixtest1-invalid.xml} | 0 ...ment-test.xml => comment-test-invalid.xml} | 0 ...pv6-test.xml => esp-ipv6-test-invalid.xml} | 0 ...ata-test.xml => hex-data-test-invalid.xml} | 0 .../{icmp-test.xml => icmp-test-invalid.xml} | 0 ...cmpv6-test.xml => icmpv6-test-invalid.xml} | 0 .../{ip-test.xml => ip-test-invalid.xml} | 0 .../{ipv6-test.xml => ipv6-test-invalid.xml} | 0 .../{mac-test.xml => mac-test-invalid.xml} | 0 .../{rarp-test.xml => rarp-test-invalid.xml} | 0 ...v6-test.xml => sctp-ipv6-test-invalid.xml} | 0 .../{sctp-test.xml => sctp-test-invalid.xml} | 0 ...pv6-test.xml => tcp-ipv6-test-invalid.xml} | 0 .../{tcp-test.xml => tcp-test-invalid.xml} | 0 ...pv6-test.xml => udp-ipv6-test-invalid.xml} | 0 .../{udp-test.xml => udp-test-invalid.xml} | 0 ...test.xml => udplite-ipv6-test-invalid.xml} | 0 .../{vlan-test.xml => vlan-test-invalid.xml} | 0 tests/nwfilterxml2xmltest.c | 44 +-- tests/virschematest.c | 371 ++++++++++++------ tests/vmx2xmldata/vmx2xml-annotation.vmx | 1 + tests/vmx2xmldata/vmx2xml-annotation.xml | 1 + .../vmx2xml-case-insensitive-1.vmx | 1 + .../vmx2xml-case-insensitive-2.vmx | 1 + .../vmx2xmldata/vmx2xml-cdrom-ide-device.vmx | 1 + .../vmx2xmldata/vmx2xml-cdrom-ide-device.xml | 1 + .../vmx2xmldata/vmx2xml-cdrom-ide-empty-2.vmx | 1 + .../vmx2xmldata/vmx2xml-cdrom-ide-empty-2.xml | 1 + tests/vmx2xmldata/vmx2xml-cdrom-ide-empty.vmx | 1 + tests/vmx2xmldata/vmx2xml-cdrom-ide-empty.xml | 1 + tests/vmx2xmldata/vmx2xml-cdrom-ide-file.vmx | 1 + tests/vmx2xmldata/vmx2xml-cdrom-ide-file.xml | 1 + .../vmx2xml-cdrom-ide-raw-auto-detect.vmx | 1 + .../vmx2xml-cdrom-ide-raw-auto-detect.xml | 1 + .../vmx2xml-cdrom-ide-raw-device.vmx | 1 + .../vmx2xml-cdrom-ide-raw-device.xml | 1 + .../vmx2xmldata/vmx2xml-cdrom-scsi-device.vmx | 1 + .../vmx2xmldata/vmx2xml-cdrom-scsi-device.xml | 1 + .../vmx2xmldata/vmx2xml-cdrom-scsi-empty.vmx | 1 + .../vmx2xmldata/vmx2xml-cdrom-scsi-empty.xml | 1 + tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.vmx | 1 + tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.xml | 1 + .../vmx2xml-cdrom-scsi-passthru.vmx | 1 + .../vmx2xml-cdrom-scsi-passthru.xml | 1 + .../vmx2xml-cdrom-scsi-raw-auto-detect.vmx | 1 + .../vmx2xml-cdrom-scsi-raw-auto-detect.xml | 1 + .../vmx2xml-cdrom-scsi-raw-device.vmx | 1 + .../vmx2xml-cdrom-scsi-raw-device.xml | 1 + tests/vmx2xmldata/vmx2xml-datacenterpath.vmx | 1 + tests/vmx2xmldata/vmx2xml-datacenterpath.xml | 1 + .../vmx2xmldata/vmx2xml-ethernet-bridged.vmx | 1 + .../vmx2xmldata/vmx2xml-ethernet-bridged.xml | 1 + tests/vmx2xmldata/vmx2xml-ethernet-custom.vmx | 1 + tests/vmx2xmldata/vmx2xml-ethernet-custom.xml | 1 + tests/vmx2xmldata/vmx2xml-ethernet-e1000.vmx | 1 + tests/vmx2xmldata/vmx2xml-ethernet-e1000.xml | 1 + .../vmx2xml-ethernet-generated.vmx | 1 + .../vmx2xml-ethernet-generated.xml | 1 + tests/vmx2xmldata/vmx2xml-ethernet-nat.vmx | 1 + tests/vmx2xmldata/vmx2xml-ethernet-nat.xml | 1 + tests/vmx2xmldata/vmx2xml-ethernet-other.vmx | 1 + tests/vmx2xmldata/vmx2xml-ethernet-other.xml | 1 + tests/vmx2xmldata/vmx2xml-ethernet-static.vmx | 1 + tests/vmx2xmldata/vmx2xml-ethernet-static.xml | 1 + .../vmx2xmldata/vmx2xml-ethernet-vmxnet2.vmx | 1 + .../vmx2xmldata/vmx2xml-ethernet-vmxnet2.xml | 1 + tests/vmx2xmldata/vmx2xml-ethernet-vpx.vmx | 1 + tests/vmx2xmldata/vmx2xml-ethernet-vpx.xml | 1 + tests/vmx2xmldata/vmx2xml-firmware-efi.vmx | 1 + tests/vmx2xmldata/vmx2xml-firmware-efi.xml | 1 + tests/vmx2xmldata/vmx2xml-floppy-device.vmx | 1 + tests/vmx2xmldata/vmx2xml-floppy-device.xml | 1 + tests/vmx2xmldata/vmx2xml-floppy-file.vmx | 1 + tests/vmx2xmldata/vmx2xml-floppy-file.xml | 1 + tests/vmx2xmldata/vmx2xml-graphics-vnc.vmx | 1 + tests/vmx2xmldata/vmx2xml-graphics-vnc.xml | 1 + .../vmx2xmldata/vmx2xml-harddisk-ide-file.vmx | 1 + .../vmx2xmldata/vmx2xml-harddisk-ide-file.xml | 1 + .../vmx2xml-harddisk-scsi-file.vmx | 1 + .../vmx2xml-harddisk-scsi-file.xml | 1 + .../vmx2xml-harddisk-transient.vmx | 1 + .../vmx2xml-harddisk-transient.xml | 1 + tests/vmx2xmldata/vmx2xml-minimal-64bit.vmx | 1 + tests/vmx2xmldata/vmx2xml-minimal-64bit.xml | 1 + tests/vmx2xmldata/vmx2xml-minimal.vmx | 1 + tests/vmx2xmldata/vmx2xml-minimal.xml | 1 + tests/vmx2xmldata/vmx2xml-parallel-device.vmx | 1 + tests/vmx2xmldata/vmx2xml-parallel-device.xml | 1 + tests/vmx2xmldata/vmx2xml-parallel-file.vmx | 1 + tests/vmx2xmldata/vmx2xml-parallel-file.xml | 1 + tests/vmx2xmldata/vmx2xml-scsi-driver.vmx | 1 + tests/vmx2xmldata/vmx2xml-scsi-driver.xml | 1 + .../vmx2xmldata/vmx2xml-scsi-writethrough.vmx | 1 + .../vmx2xmldata/vmx2xml-scsi-writethrough.xml | 1 + tests/vmx2xmldata/vmx2xml-serial-device.vmx | 1 + tests/vmx2xmldata/vmx2xml-serial-device.xml | 1 + tests/vmx2xmldata/vmx2xml-serial-file.vmx | 1 + tests/vmx2xmldata/vmx2xml-serial-file.xml | 1 + .../vmx2xml-serial-network-client.vmx | 1 + .../vmx2xml-serial-network-client.xml | 1 + .../vmx2xml-serial-network-server.vmx | 1 + .../vmx2xml-serial-network-server.xml | 1 + .../vmx2xml-serial-pipe-client-app.vmx | 1 + .../vmx2xml-serial-pipe-client-vm.vmx | 1 + .../vmx2xml-serial-pipe-server-app.vmx | 1 + .../vmx2xml-serial-pipe-server-vm.vmx | 1 + tests/vmx2xmldata/vmx2xml-serial-pipe.xml | 1 + tests/vmx2xmldata/vmx2xml-sharedfolder.vmx | 1 + tests/vmx2xmldata/vmx2xml-sharedfolder.xml | 1 + tests/vmx2xmldata/vmx2xml-smbios.vmx | 1 + tests/vmx2xmldata/vmx2xml-smbios.xml | 1 + tests/vmx2xmldata/vmx2xml-svga.vmx | 1 + tests/vmx2xmldata/vmx2xml-svga.xml | 1 + 123 files changed, 393 insertions(+), 147 deletions(-) rename tests/nwfilterxml2xmlin/{ah-ipv6-test.xml => ah-ipv6-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{all-ipv6-test.xml => all-ipv6-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{arp-test.xml => arp-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{chain_prefixtest1.xml => chain_prefixtest1-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{comment-test.xml => comment-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{esp-ipv6-test.xml => esp-ipv6-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{hex-data-test.xml => hex-data-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{icmp-test.xml => icmp-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{icmpv6-test.xml => icmpv6-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{ip-test.xml => ip-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{ipv6-test.xml => ipv6-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{mac-test.xml => mac-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{rarp-test.xml => rarp-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{sctp-ipv6-test.xml => sctp-ipv6-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{sctp-test.xml => sctp-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{tcp-ipv6-test.xml => tcp-ipv6-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{tcp-test.xml => tcp-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{udp-ipv6-test.xml => udp-ipv6-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{udp-test.xml => udp-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{udplite-ipv6-test.xml => udplite-ipv6-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{vlan-test.xml => vlan-test-invalid.xml} (100%) -- 2.26.2

To allow greater variablitity of XML schema validation tests without needlessly reparsing the schema we need to refactor the internals to pass in structs rather than just paths to directory. This allows to directly implement testing of single files and will simplify further additions such as filtering of the list of XML files in a directory. The list of tested paths is directly ported for now and will be improved in follow-up patches. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- tests/virschematest.c | 317 ++++++++++++++++++++++++++---------------- 1 file changed, 199 insertions(+), 118 deletions(-) diff --git a/tests/virschematest.c b/tests/virschematest.c index 17eb2a4b34..e6e176eef3 100644 --- a/tests/virschematest.c +++ b/tests/virschematest.c @@ -30,36 +30,49 @@ VIR_LOG_INIT("tests.schematest"); +struct testSchemaEntry { + const char *dir; + const char *file; +}; + + struct testSchemaData { virXMLValidatorPtr validator; - const char *schema; const char *xml_path; }; static int -testSchemaFile(const void *args) +testSchemaValidateXML(const void *args) { const struct testSchemaData *data = args; bool shouldFail = virStringHasSuffix(data->xml_path, "-invalid.xml"); - xmlDocPtr xml = NULL; - int ret = -1; + g_autoptr(xmlDoc) xml = NULL; if (!(xml = virXMLParseFile(data->xml_path))) return -1; - if (virXMLValidatorValidate(data->validator, xml) < 0) { - if (!shouldFail) - goto cleanup; - } else { - if (shouldFail) - goto cleanup; - } + if ((virXMLValidatorValidate(data->validator, xml) < 0) != shouldFail) + return -1; - ret = 0; - cleanup: - xmlFreeDoc(xml); - return ret; + return 0; +} + + +static int +testSchemaFile(const char *schema, + virXMLValidatorPtr validator, + const char *path) +{ + g_autofree char *test_name = NULL; + struct testSchemaData data = { + .validator = validator, + .xml_path = path, + }; + + test_name = g_strdup_printf("Checking %s against %s", path, schema); + + return virTestRun(test_name, testSchemaValidateXML, &data); } @@ -72,9 +85,6 @@ testSchemaDir(const char *schema, struct dirent *ent; int ret = 0; int rc; - struct testSchemaData data = { - .validator = validator, - }; if (virDirOpen(&dir, dir_path) < 0) { virTestPropagateLibvirtError(); @@ -82,7 +92,6 @@ testSchemaDir(const char *schema, } while ((rc = virDirRead(dir, &ent, dir_path)) > 0) { - g_autofree char *test_name = NULL; g_autofree char *xml_path = NULL; if (!virStringHasSuffix(ent->d_name, ".xml")) @@ -92,10 +101,7 @@ testSchemaDir(const char *schema, xml_path = g_strdup_printf("%s/%s", dir_path, ent->d_name); - test_name = g_strdup_printf("Checking %s against %s", ent->d_name, schema); - - data.xml_path = xml_path; - if (virTestRun(test_name, testSchemaFile, &data) < 0) + if (testSchemaFile(schema, validator, xml_path) < 0) ret = -1; } @@ -109,122 +115,197 @@ testSchemaDir(const char *schema, } +/** + * testSchemaGrammarReport: + * + * We need to parse the schema regardless since it's necessary also when tests + * are skipped using VIR_TEST_RANGE so this function merely reports whether the + * schema was parsed successfully via virTestRun. + */ static int -testSchemaDirs(const char *schema, virXMLValidatorPtr validator, ...) +testSchemaGrammarReport(const void *opaque) { - va_list args; - int ret = 0; - const char *dir; + const virXMLValidator *validator = opaque; - va_start(args, validator); + if (!validator) + return -1; - while ((dir = va_arg(args, char *))) { - g_autofree char *dir_path = g_strdup_printf("%s/%s", abs_srcdir, dir); - if (testSchemaDir(schema, validator, dir_path) < 0) - ret = -1; - } + return 0; +} + +static virXMLValidatorPtr +testSchemaGrammarLoad(const char *schema) +{ + g_autofree char *schema_path = NULL; + g_autofree char *testname = NULL; + virXMLValidatorPtr ret; + + schema_path = g_strdup_printf("%s/%s", abs_top_srcdir, schema); + + ret = virXMLValidatorInit(schema_path); + + testname = g_strdup_printf("test schema grammar file: '%s'", schema); + + ignore_value(virTestRun(testname, testSchemaGrammarReport, ret)); - va_end(args); return ret; } static int -testSchemaGrammar(const void *opaque) +testSchemaEntries(const char *schema, + const struct testSchemaEntry *entries, + size_t nentries) { - struct testSchemaData *data = (struct testSchemaData *) opaque; - g_autofree char *schema_path = NULL; - - schema_path = g_strdup_printf("%s/docs/schemas/%s", abs_top_srcdir, - data->schema); + g_autoptr(virXMLValidator) validator = NULL; + size_t i; + int ret = 0; - if (!(data->validator = virXMLValidatorInit(schema_path))) + if (!(validator = testSchemaGrammarLoad(schema))) return -1; - return 0; + for (i = 0; i < nentries; i++) { + const struct testSchemaEntry *entry = entries + i; + + if (!entry->file == !entry->dir) { + VIR_TEST_VERBOSE("\nmust specify exactly one of 'dir' and 'file' for struct testSchemaEntry\n"); + ret = -1; + continue; + } + + if (entry->dir) { + g_autofree char *path = g_strdup_printf("%s/%s", abs_top_srcdir, entry->dir); + + if (testSchemaDir(schema, validator, path) < 0) + ret = -1; + } + + if (entry->file) { + g_autofree char *path = g_strdup_printf("%s/%s", abs_top_srcdir, entry->file); + + if (testSchemaFile(schema, validator, path) < 0) + ret = -1; + } + } + + return ret; } +static const struct testSchemaEntry schemaCapability[] = { + { .dir = "tests/capabilityschemadata" }, + { .dir = "tests/vircaps2xmldata" }, +}; + +static const struct testSchemaEntry schemaDomain[] = { + { .dir = "tests/domainschemadata" }, + { .dir = "tests/qemuxml2argvdata" }, + { .dir = "tests/xmconfigdata" }, + { .dir = "tests/qemuxml2xmloutdata" }, + { .dir = "tests/lxcxml2xmldata" }, + { .dir = "tests/lxcxml2xmloutdata" }, + { .dir = "tests/bhyvexml2argvdata" }, + { .dir = "tests/bhyvexml2xmloutdata" }, + { .dir = "tests/genericxml2xmlindata" }, + { .dir = "tests/genericxml2xmloutdata" }, + { .dir = "tests/xlconfigdata" }, + { .dir = "tests/libxlxml2domconfigdata" }, + { .dir = "tests/qemuhotplugtestdomains" }, +}; + +static const struct testSchemaEntry schemaDomainCaps[] = { + { .dir = "tests/domaincapsdata" }, +}; + +static const struct testSchemaEntry schemaDomainBackup[] = { + { .dir = "tests/domainbackupxml2xmlin" }, + { .dir = "tests/domainbackupxml2xmlout" }, +}; + +static const struct testSchemaEntry schemaDomainCheckpoint[] = { + { .dir = "tests/qemudomaincheckpointxml2xmlin" }, + { .dir = "tests/qemudomaincheckpointxml2xmlout" }, +}; + +static const struct testSchemaEntry schemaDomainSnapshot[] = { + { .dir = "tests/qemudomainsnapshotxml2xmlin" }, + { .dir = "tests/qemudomainsnapshotxml2xmlout" }, +}; + +static const struct testSchemaEntry schemaInterface[] = { + { .dir = "tests/interfaceschemadata" }, +}; + +static const struct testSchemaEntry schemaNetwork[] = { + { .dir = "src/network" }, + { .dir = "tests/networkxml2xmlin" }, + { .dir = "tests/networkxml2xmlout" }, + { .dir = "tests/networkxml2confdata" }, +}; + +static const struct testSchemaEntry schemaNetworkport[] = { + { .dir = "tests/virnetworkportxml2xmldata" }, +}; + +static const struct testSchemaEntry schemaNodedev[] = { + { .dir = "tests/nodedevschemadata" }, +}; + +static const struct testSchemaEntry schemaNwfilter[] = { + { .dir = "tests/nwfilterxml2xmlout" }, + { .dir = "src/nwfilter" }, +}; + +static const struct testSchemaEntry schemaNwfilterbinding[] = { + { .dir = "tests/virnwfilterbindingxml2xmldata" }, +}; + +static const struct testSchemaEntry schemaSecret[] = { + { .dir = "tests/secretxml2xmlin" }, +}; + +static const struct testSchemaEntry schemaStoragepoolcaps[] = { + { .dir = "tests/storagepoolcapsschemadata" }, +}; + +static const struct testSchemaEntry schemaStoragePool[] = { + { .dir = "tests/storagepoolxml2xmlin" }, + { .dir = "tests/storagepoolxml2xmlout" }, + { .dir = "tests/storagepoolschemadata" }, +}; + +static const struct testSchemaEntry schemaStorageVol[] = { + { .dir = "tests/storagevolxml2xmlin" }, + { .dir = "tests/storagevolxml2xmlout" }, + { .dir = "tests/storagevolschemadata" }, +}; + + static int mymain(void) { int ret = 0; - struct testSchemaData data; - - memset(&data, 0, sizeof(data)); - -#define DO_TEST_DIR(sch, ...) \ - do { \ - data.schema = sch; \ - if (virTestRun("test schema grammar file: " sch, \ - testSchemaGrammar, &data) == 0) { \ - /* initialize the validator even if the schema test \ - * was skipped because of VIR_TEST_RANGE */ \ - if (!data.validator && testSchemaGrammar(&data) < 0) { \ - ret = -1; \ - break; \ - } \ - if (testSchemaDirs(sch, data.validator, __VA_ARGS__, NULL) < 0) \ - ret = -1; \ - \ - virXMLValidatorFree(data.validator); \ - data.validator = NULL; \ - } else { \ - ret = -1; \ - } \ - } while (0) - -#define DO_TEST_FILE(sch, xmlfile) \ - do { \ - data.schema = sch; \ - data.xml_path = abs_srcdir "/" xmlfile; \ - if (virTestRun("test schema grammar file: " sch, \ - testSchemaGrammar, &data) == 0) { \ - /* initialize the validator even if the schema test \ - * was skipped because of VIR_TEST_RANGE */ \ - if (!data.validator && testSchemaGrammar(&data) < 0) { \ - ret = -1; \ - break; \ - } \ - if (virTestRun("Checking " xmlfile " against " sch, \ - testSchemaFile, &data) < 0) \ - ret = -1; \ - \ - virXMLValidatorFree(data.validator); \ - data.validator = NULL; \ - } else { \ - ret = -1; \ - } \ - } while (0) - - DO_TEST_DIR("capability.rng", "capabilityschemadata", "vircaps2xmldata"); - DO_TEST_DIR("domain.rng", "domainschemadata", - "qemuxml2argvdata", "xmconfigdata", - "qemuxml2xmloutdata", "lxcxml2xmldata", - "lxcxml2xmloutdata", "bhyvexml2argvdata", - "bhyvexml2xmloutdata", "genericxml2xmlindata", - "genericxml2xmloutdata", "xlconfigdata", "libxlxml2domconfigdata", - "qemuhotplugtestdomains"); - DO_TEST_DIR("domaincaps.rng", "domaincapsdata"); - DO_TEST_DIR("domainbackup.rng", "domainbackupxml2xmlin", - "domainbackupxml2xmlout"); - DO_TEST_DIR("domaincheckpoint.rng", "qemudomaincheckpointxml2xmlin", - "qemudomaincheckpointxml2xmlout"); - DO_TEST_DIR("domainsnapshot.rng", "qemudomainsnapshotxml2xmlin", - "qemudomainsnapshotxml2xmlout"); - DO_TEST_DIR("interface.rng", "interfaceschemadata"); - DO_TEST_DIR("network.rng", "../src/network", "networkxml2xmlin", - "networkxml2xmlout", "networkxml2confdata"); - DO_TEST_DIR("networkport.rng", "virnetworkportxml2xmldata"); - DO_TEST_DIR("nodedev.rng", "nodedevschemadata"); - DO_TEST_DIR("nwfilter.rng", "nwfilterxml2xmlout", "../src/nwfilter"); - DO_TEST_DIR("nwfilterbinding.rng", "virnwfilterbindingxml2xmldata"); - DO_TEST_DIR("secret.rng", "secretxml2xmlin"); - DO_TEST_DIR("storagepoolcaps.rng", "storagepoolcapsschemadata"); - DO_TEST_DIR("storagepool.rng", "storagepoolxml2xmlin", "storagepoolxml2xmlout", - "storagepoolschemadata"); - DO_TEST_DIR("storagevol.rng", "storagevolxml2xmlin", "storagevolxml2xmlout", - "storagevolschemadata"); + +#define DO_TEST(sch, ent) \ + if (testSchemaEntries((sch), (ent), G_N_ELEMENTS(ent)) < 0) \ + ret = -1; + + DO_TEST("docs/schemas/capability.rng", schemaCapability); + DO_TEST("docs/schemas/domain.rng", schemaDomain); + DO_TEST("docs/schemas/domaincaps.rng", schemaDomainCaps); + DO_TEST("docs/schemas/domainbackup.rng", schemaDomainBackup); + DO_TEST("docs/schemas/domaincheckpoint.rng", schemaDomainCheckpoint); + DO_TEST("docs/schemas/domainsnapshot.rng", schemaDomainSnapshot); + DO_TEST("docs/schemas/interface.rng", schemaInterface); + DO_TEST("docs/schemas/network.rng", schemaNetwork); + DO_TEST("docs/schemas/networkport.rng", schemaNetworkport); + DO_TEST("docs/schemas/nodedev.rng", schemaNodedev); + DO_TEST("docs/schemas/nwfilter.rng", schemaNwfilter); + DO_TEST("docs/schemas/nwfilterbinding.rng", schemaNwfilterbinding); + DO_TEST("docs/schemas/secret.rng", schemaSecret); + DO_TEST("docs/schemas/storagepoolcaps.rng", schemaStoragepoolcaps); + DO_TEST("docs/schemas/storagepool.rng", schemaStoragePool); + DO_TEST("docs/schemas/storagevol.rng", schemaStorageVol); return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; } -- 2.26.2

In some cases we have directories with mixed XML files in the test suite. Adding regex filtering will allow testing subsets of the XML files against schema. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- tests/virschematest.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tests/virschematest.c b/tests/virschematest.c index e6e176eef3..7d7db3e354 100644 --- a/tests/virschematest.c +++ b/tests/virschematest.c @@ -32,6 +32,10 @@ VIR_LOG_INIT("tests.schematest"); struct testSchemaEntry { const char *dir; + /* if dirRegex is non-NULL the provided regular expression is used to match + * the file names in a directory (without path prefixed) and only matching + * files are validated */ + const char *dirRegex; const char *file; }; @@ -79,18 +83,29 @@ testSchemaFile(const char *schema, static int testSchemaDir(const char *schema, virXMLValidatorPtr validator, - const char *dir_path) + const char *dir_path, + const char *filterstr) { DIR *dir = NULL; struct dirent *ent; int ret = 0; int rc; + g_autoptr(GRegex) filter = NULL; if (virDirOpen(&dir, dir_path) < 0) { virTestPropagateLibvirtError(); return -1; } + if (filterstr) { + g_autoptr(GError) err = NULL; + + if (!(filter = g_regex_new(filterstr, 0, 0, &err))) { + VIR_TEST_VERBOSE("\nfailed to compile regex '%s': %s", filterstr, err->message); + return -1; + } + } + while ((rc = virDirRead(dir, &ent, dir_path)) > 0) { g_autofree char *xml_path = NULL; @@ -98,6 +113,9 @@ testSchemaDir(const char *schema, continue; if (ent->d_name[0] == '.') continue; + if (filter && + !g_regex_match(filter, ent->d_name, 0, NULL)) + continue; xml_path = g_strdup_printf("%s/%s", dir_path, ent->d_name); @@ -176,7 +194,7 @@ testSchemaEntries(const char *schema, if (entry->dir) { g_autofree char *path = g_strdup_printf("%s/%s", abs_top_srcdir, entry->dir); - if (testSchemaDir(schema, validator, path) < 0) + if (testSchemaDir(schema, validator, path, entry->dirRegex) < 0) ret = -1; } -- 2.26.2

Schema mandates a '<dir>' element, not '<directory>'. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- examples/xml/storage/pool-netfs.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/xml/storage/pool-netfs.xml b/examples/xml/storage/pool-netfs.xml index d1df2e2b7c..446d4b41bd 100644 --- a/examples/xml/storage/pool-netfs.xml +++ b/examples/xml/storage/pool-netfs.xml @@ -2,7 +2,7 @@ <name>virtimages</name> <source> <host name="nfs.example.com"/> - <directory path="/var/lib/virt/images"/> + <dir path="/var/lib/virt/images"/> </source> <target> <path>/var/lib/virt/images</path> -- 2.26.2

Our schema forces a <target/> element which was not present in the files. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- examples/xml/storage/vol-raw.xml | 3 +++ examples/xml/storage/vol-sparse.xml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/examples/xml/storage/vol-raw.xml b/examples/xml/storage/vol-raw.xml index bc4e049a35..e6c5a28a25 100644 --- a/examples/xml/storage/vol-raw.xml +++ b/examples/xml/storage/vol-raw.xml @@ -2,4 +2,7 @@ <name>raw.img</name> <allocation unit="M">10</allocation> <capacity unit="M">1000</capacity> + <target> + <format type="raw"/> + </target> </volume> diff --git a/examples/xml/storage/vol-sparse.xml b/examples/xml/storage/vol-sparse.xml index 2ec9f0b748..21f14a4ac7 100644 --- a/examples/xml/storage/vol-sparse.xml +++ b/examples/xml/storage/vol-sparse.xml @@ -2,4 +2,7 @@ <name>sparse.img</name> <allocation>0</allocation> <capacity unit="T">1</capacity> + <target> + <format type="raw"/> + </target> </volume> -- 2.26.2

Match the correct subsets of the files via the 'dirRegex' property. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- tests/virschematest.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/virschematest.c b/tests/virschematest.c index 7d7db3e354..29cd5cc6e3 100644 --- a/tests/virschematest.c +++ b/tests/virschematest.c @@ -290,12 +290,16 @@ static const struct testSchemaEntry schemaStoragePool[] = { { .dir = "tests/storagepoolxml2xmlin" }, { .dir = "tests/storagepoolxml2xmlout" }, { .dir = "tests/storagepoolschemadata" }, + { .dir = "examples/xml/storage", + .dirRegex = "pool-.*" }, }; static const struct testSchemaEntry schemaStorageVol[] = { { .dir = "tests/storagevolxml2xmlin" }, { .dir = "tests/storagevolxml2xmlout" }, { .dir = "tests/storagevolschemadata" }, + { .dir = "examples/xml/storage", + .dirRegex = "vol-.*" }, }; -- 2.26.2

Add all appropriate file from our test driver example XML directory. Note that the two 'node.*' files are actually custom for the test driver to load full state. We don't have a schema for them. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- tests/virschematest.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/virschematest.c b/tests/virschematest.c index 29cd5cc6e3..816305d776 100644 --- a/tests/virschematest.c +++ b/tests/virschematest.c @@ -229,6 +229,8 @@ static const struct testSchemaEntry schemaDomain[] = { { .dir = "tests/xlconfigdata" }, { .dir = "tests/libxlxml2domconfigdata" }, { .dir = "tests/qemuhotplugtestdomains" }, + { .dir = "examples/xml/test/", + .dirRegex = "testdom.*" }, }; static const struct testSchemaEntry schemaDomainCaps[] = { @@ -259,6 +261,8 @@ static const struct testSchemaEntry schemaNetwork[] = { { .dir = "tests/networkxml2xmlin" }, { .dir = "tests/networkxml2xmlout" }, { .dir = "tests/networkxml2confdata" }, + { .dir = "examples/xml/test/", + .dirRegex = "testnet.*" }, }; static const struct testSchemaEntry schemaNetworkport[] = { @@ -267,6 +271,7 @@ static const struct testSchemaEntry schemaNetworkport[] = { static const struct testSchemaEntry schemaNodedev[] = { { .dir = "tests/nodedevschemadata" }, + { .file = "examples/xml/test/testdev.xml" }, }; static const struct testSchemaEntry schemaNwfilter[] = { @@ -292,6 +297,7 @@ static const struct testSchemaEntry schemaStoragePool[] = { { .dir = "tests/storagepoolschemadata" }, { .dir = "examples/xml/storage", .dirRegex = "pool-.*" }, + { .file = "examples/xml/test/testpool.xml" }, }; static const struct testSchemaEntry schemaStorageVol[] = { @@ -300,6 +306,7 @@ static const struct testSchemaEntry schemaStorageVol[] = { { .dir = "tests/storagevolschemadata" }, { .dir = "examples/xml/storage", .dirRegex = "vol-.*" }, + { .file = "examples/xml/test/testvol.xml" }, }; -- 2.26.2

The files are under 'src/nwfilter/xml' Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- tests/virschematest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/virschematest.c b/tests/virschematest.c index 816305d776..0a1639bf44 100644 --- a/tests/virschematest.c +++ b/tests/virschematest.c @@ -276,7 +276,7 @@ static const struct testSchemaEntry schemaNodedev[] = { static const struct testSchemaEntry schemaNwfilter[] = { { .dir = "tests/nwfilterxml2xmlout" }, - { .dir = "src/nwfilter" }, + { .dir = "src/nwfilter/xml" }, }; static const struct testSchemaEntry schemaNwfilterbinding[] = { -- 2.26.2

The element is not needed for the test and doesn't conform to the domain XML schema. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- tests/domainconfdata/getfilesystem.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/domainconfdata/getfilesystem.xml b/tests/domainconfdata/getfilesystem.xml index 2ee78b4eb9..2d8c963eaf 100644 --- a/tests/domainconfdata/getfilesystem.xml +++ b/tests/domainconfdata/getfilesystem.xml @@ -6,7 +6,6 @@ <vcpu placement='static'>1</vcpu> <os> <type arch='x86_64'>hvm</type> - <init>/bin/sh</init> </os> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> -- 2.26.2

The parser for the 'ipsetflags' accepts the 'src' and 'dst' values stripping case. Express the same in the schema to pass validation of any accepted string. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/schemas/nwfilter.rng | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/schemas/nwfilter.rng b/docs/schemas/nwfilter.rng index 75caf61b89..64a607e62f 100644 --- a/docs/schemas/nwfilter.rng +++ b/docs/schemas/nwfilter.rng @@ -980,7 +980,7 @@ <define name="ipset-flags-type"> <data type="string"> - <param name="pattern">(src|dst)(,(src|dst)){0,5}</param> + <param name="pattern">([Ss][Rr][Cc]|[Dd][Ss][Tt])(,([Ss][Rr][Cc]|[Dd][Ss][Tt])){0,5}</param> </data> </define> </grammar> -- 2.26.2

The reference string parser tolerates some leading/trailing whitespace for the reference strings as witnessed by tests/nwfilterxml2xmlin/iter-test3.xml Allow them in the schema so that the test passes schema validation. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/schemas/nwfilter.rng | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/schemas/nwfilter.rng b/docs/schemas/nwfilter.rng index 64a607e62f..a75de7ed3e 100644 --- a/docs/schemas/nwfilter.rng +++ b/docs/schemas/nwfilter.rng @@ -725,7 +725,7 @@ <define name="variable-name-type"> <data type="string"> - <param name="pattern">$[a-zA-Z0-9_]+(\[[ ]*[@]?[0-9]+[ ]*\])?</param> + <param name="pattern">$[ ]*[a-zA-Z0-9_]+(\[[ ]*[@]?[0-9]+[ ]*\])?[ ]*</param> </data> </define> -- 2.26.2

Fix the 'flags' of the last rule to conform to the RNG schema. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- tests/nwfilterxml2firewalldata/tcp.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/nwfilterxml2firewalldata/tcp.xml b/tests/nwfilterxml2firewalldata/tcp.xml index 14ebd35d38..1321f1a513 100644 --- a/tests/nwfilterxml2firewalldata/tcp.xml +++ b/tests/nwfilterxml2firewalldata/tcp.xml @@ -29,6 +29,6 @@ <tcp state='NONE' flags='RST/NONE'/> </rule> <rule action='accept' direction='in'> - <tcp state='NONE' flags='PSH/'/> + <tcp state='NONE' flags='PSH/NONE'/> </rule> </filter> -- 2.26.2

There's quite a few negative tests. In anticipation of schema testing of the 'nwfilterxml2xmlin' directory rename all negative/non-conformant XMLs with the -invalid suffix. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- ...ipv6-test.xml => ah-ipv6-test-invalid.xml} | 0 ...pv6-test.xml => all-ipv6-test-invalid.xml} | 0 .../{arp-test.xml => arp-test-invalid.xml} | 0 ...est1.xml => chain_prefixtest1-invalid.xml} | 0 ...ment-test.xml => comment-test-invalid.xml} | 0 ...pv6-test.xml => esp-ipv6-test-invalid.xml} | 0 ...ata-test.xml => hex-data-test-invalid.xml} | 0 .../{icmp-test.xml => icmp-test-invalid.xml} | 0 ...cmpv6-test.xml => icmpv6-test-invalid.xml} | 0 .../{ip-test.xml => ip-test-invalid.xml} | 0 .../{ipv6-test.xml => ipv6-test-invalid.xml} | 0 .../{mac-test.xml => mac-test-invalid.xml} | 0 .../{rarp-test.xml => rarp-test-invalid.xml} | 0 ...v6-test.xml => sctp-ipv6-test-invalid.xml} | 0 .../{sctp-test.xml => sctp-test-invalid.xml} | 0 ...pv6-test.xml => tcp-ipv6-test-invalid.xml} | 0 .../{tcp-test.xml => tcp-test-invalid.xml} | 0 ...pv6-test.xml => udp-ipv6-test-invalid.xml} | 0 .../{udp-test.xml => udp-test-invalid.xml} | 0 ...test.xml => udplite-ipv6-test-invalid.xml} | 0 .../{vlan-test.xml => vlan-test-invalid.xml} | 0 tests/nwfilterxml2xmltest.c | 44 +++++++++---------- 22 files changed, 22 insertions(+), 22 deletions(-) rename tests/nwfilterxml2xmlin/{ah-ipv6-test.xml => ah-ipv6-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{all-ipv6-test.xml => all-ipv6-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{arp-test.xml => arp-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{chain_prefixtest1.xml => chain_prefixtest1-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{comment-test.xml => comment-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{esp-ipv6-test.xml => esp-ipv6-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{hex-data-test.xml => hex-data-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{icmp-test.xml => icmp-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{icmpv6-test.xml => icmpv6-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{ip-test.xml => ip-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{ipv6-test.xml => ipv6-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{mac-test.xml => mac-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{rarp-test.xml => rarp-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{sctp-ipv6-test.xml => sctp-ipv6-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{sctp-test.xml => sctp-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{tcp-ipv6-test.xml => tcp-ipv6-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{tcp-test.xml => tcp-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{udp-ipv6-test.xml => udp-ipv6-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{udp-test.xml => udp-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{udplite-ipv6-test.xml => udplite-ipv6-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{vlan-test.xml => vlan-test-invalid.xml} (100%) diff --git a/tests/nwfilterxml2xmlin/ah-ipv6-test.xml b/tests/nwfilterxml2xmlin/ah-ipv6-test-invalid.xml similarity index 100% rename from tests/nwfilterxml2xmlin/ah-ipv6-test.xml rename to tests/nwfilterxml2xmlin/ah-ipv6-test-invalid.xml diff --git a/tests/nwfilterxml2xmlin/all-ipv6-test.xml b/tests/nwfilterxml2xmlin/all-ipv6-test-invalid.xml similarity index 100% rename from tests/nwfilterxml2xmlin/all-ipv6-test.xml rename to tests/nwfilterxml2xmlin/all-ipv6-test-invalid.xml diff --git a/tests/nwfilterxml2xmlin/arp-test.xml b/tests/nwfilterxml2xmlin/arp-test-invalid.xml similarity index 100% rename from tests/nwfilterxml2xmlin/arp-test.xml rename to tests/nwfilterxml2xmlin/arp-test-invalid.xml diff --git a/tests/nwfilterxml2xmlin/chain_prefixtest1.xml b/tests/nwfilterxml2xmlin/chain_prefixtest1-invalid.xml similarity index 100% rename from tests/nwfilterxml2xmlin/chain_prefixtest1.xml rename to tests/nwfilterxml2xmlin/chain_prefixtest1-invalid.xml diff --git a/tests/nwfilterxml2xmlin/comment-test.xml b/tests/nwfilterxml2xmlin/comment-test-invalid.xml similarity index 100% rename from tests/nwfilterxml2xmlin/comment-test.xml rename to tests/nwfilterxml2xmlin/comment-test-invalid.xml diff --git a/tests/nwfilterxml2xmlin/esp-ipv6-test.xml b/tests/nwfilterxml2xmlin/esp-ipv6-test-invalid.xml similarity index 100% rename from tests/nwfilterxml2xmlin/esp-ipv6-test.xml rename to tests/nwfilterxml2xmlin/esp-ipv6-test-invalid.xml diff --git a/tests/nwfilterxml2xmlin/hex-data-test.xml b/tests/nwfilterxml2xmlin/hex-data-test-invalid.xml similarity index 100% rename from tests/nwfilterxml2xmlin/hex-data-test.xml rename to tests/nwfilterxml2xmlin/hex-data-test-invalid.xml diff --git a/tests/nwfilterxml2xmlin/icmp-test.xml b/tests/nwfilterxml2xmlin/icmp-test-invalid.xml similarity index 100% rename from tests/nwfilterxml2xmlin/icmp-test.xml rename to tests/nwfilterxml2xmlin/icmp-test-invalid.xml diff --git a/tests/nwfilterxml2xmlin/icmpv6-test.xml b/tests/nwfilterxml2xmlin/icmpv6-test-invalid.xml similarity index 100% rename from tests/nwfilterxml2xmlin/icmpv6-test.xml rename to tests/nwfilterxml2xmlin/icmpv6-test-invalid.xml diff --git a/tests/nwfilterxml2xmlin/ip-test.xml b/tests/nwfilterxml2xmlin/ip-test-invalid.xml similarity index 100% rename from tests/nwfilterxml2xmlin/ip-test.xml rename to tests/nwfilterxml2xmlin/ip-test-invalid.xml diff --git a/tests/nwfilterxml2xmlin/ipv6-test.xml b/tests/nwfilterxml2xmlin/ipv6-test-invalid.xml similarity index 100% rename from tests/nwfilterxml2xmlin/ipv6-test.xml rename to tests/nwfilterxml2xmlin/ipv6-test-invalid.xml diff --git a/tests/nwfilterxml2xmlin/mac-test.xml b/tests/nwfilterxml2xmlin/mac-test-invalid.xml similarity index 100% rename from tests/nwfilterxml2xmlin/mac-test.xml rename to tests/nwfilterxml2xmlin/mac-test-invalid.xml diff --git a/tests/nwfilterxml2xmlin/rarp-test.xml b/tests/nwfilterxml2xmlin/rarp-test-invalid.xml similarity index 100% rename from tests/nwfilterxml2xmlin/rarp-test.xml rename to tests/nwfilterxml2xmlin/rarp-test-invalid.xml diff --git a/tests/nwfilterxml2xmlin/sctp-ipv6-test.xml b/tests/nwfilterxml2xmlin/sctp-ipv6-test-invalid.xml similarity index 100% rename from tests/nwfilterxml2xmlin/sctp-ipv6-test.xml rename to tests/nwfilterxml2xmlin/sctp-ipv6-test-invalid.xml diff --git a/tests/nwfilterxml2xmlin/sctp-test.xml b/tests/nwfilterxml2xmlin/sctp-test-invalid.xml similarity index 100% rename from tests/nwfilterxml2xmlin/sctp-test.xml rename to tests/nwfilterxml2xmlin/sctp-test-invalid.xml diff --git a/tests/nwfilterxml2xmlin/tcp-ipv6-test.xml b/tests/nwfilterxml2xmlin/tcp-ipv6-test-invalid.xml similarity index 100% rename from tests/nwfilterxml2xmlin/tcp-ipv6-test.xml rename to tests/nwfilterxml2xmlin/tcp-ipv6-test-invalid.xml diff --git a/tests/nwfilterxml2xmlin/tcp-test.xml b/tests/nwfilterxml2xmlin/tcp-test-invalid.xml similarity index 100% rename from tests/nwfilterxml2xmlin/tcp-test.xml rename to tests/nwfilterxml2xmlin/tcp-test-invalid.xml diff --git a/tests/nwfilterxml2xmlin/udp-ipv6-test.xml b/tests/nwfilterxml2xmlin/udp-ipv6-test-invalid.xml similarity index 100% rename from tests/nwfilterxml2xmlin/udp-ipv6-test.xml rename to tests/nwfilterxml2xmlin/udp-ipv6-test-invalid.xml diff --git a/tests/nwfilterxml2xmlin/udp-test.xml b/tests/nwfilterxml2xmlin/udp-test-invalid.xml similarity index 100% rename from tests/nwfilterxml2xmlin/udp-test.xml rename to tests/nwfilterxml2xmlin/udp-test-invalid.xml diff --git a/tests/nwfilterxml2xmlin/udplite-ipv6-test.xml b/tests/nwfilterxml2xmlin/udplite-ipv6-test-invalid.xml similarity index 100% rename from tests/nwfilterxml2xmlin/udplite-ipv6-test.xml rename to tests/nwfilterxml2xmlin/udplite-ipv6-test-invalid.xml diff --git a/tests/nwfilterxml2xmlin/vlan-test.xml b/tests/nwfilterxml2xmlin/vlan-test-invalid.xml similarity index 100% rename from tests/nwfilterxml2xmlin/vlan-test.xml rename to tests/nwfilterxml2xmlin/vlan-test-invalid.xml diff --git a/tests/nwfilterxml2xmltest.c b/tests/nwfilterxml2xmltest.c index 52a4af12cc..9def1e2634 100644 --- a/tests/nwfilterxml2xmltest.c +++ b/tests/nwfilterxml2xmltest.c @@ -89,32 +89,32 @@ mymain(void) ret = -1; \ } while (0) - DO_TEST("mac-test", true); - DO_TEST("vlan-test", true); + DO_TEST("mac-test-invalid", true); + DO_TEST("vlan-test-invalid", true); DO_TEST("stp-test", false); - DO_TEST("arp-test", true); - DO_TEST("rarp-test", true); - DO_TEST("ip-test", true); - DO_TEST("ipv6-test", true); - - DO_TEST("tcp-test", true); - DO_TEST("udp-test", true); - DO_TEST("icmp-test", true); + DO_TEST("arp-test-invalid", true); + DO_TEST("rarp-test-invalid", true); + DO_TEST("ip-test-invalid", true); + DO_TEST("ipv6-test-invalid", true); + + DO_TEST("tcp-test-invalid", true); + DO_TEST("udp-test-invalid", true); + DO_TEST("icmp-test-invalid", true); DO_TEST("igmp-test", false); - DO_TEST("sctp-test", true); + DO_TEST("sctp-test-invalid", true); DO_TEST("udplite-test", false); DO_TEST("esp-test", false); DO_TEST("ah-test", false); DO_TEST("all-test", false); - DO_TEST("tcp-ipv6-test", true); - DO_TEST("udp-ipv6-test", true); - DO_TEST("icmpv6-test", true); - DO_TEST("sctp-ipv6-test", true); - DO_TEST("udplite-ipv6-test", true); - DO_TEST("esp-ipv6-test", true); - DO_TEST("ah-ipv6-test", true); - DO_TEST("all-ipv6-test", true); + DO_TEST("tcp-ipv6-test-invalid", true); + DO_TEST("udp-ipv6-test-invalid", true); + DO_TEST("icmpv6-test-invalid", true); + DO_TEST("sctp-ipv6-test-invalid", true); + DO_TEST("udplite-ipv6-test-invalid", true); + DO_TEST("esp-ipv6-test-invalid", true); + DO_TEST("ah-ipv6-test-invalid", true); + DO_TEST("all-ipv6-test-invalid", true); DO_TEST("ref-test", false); DO_TEST("ref-rule-test", false); @@ -125,14 +125,14 @@ mymain(void) DO_TEST("conntrack-test", false); - DO_TEST("hex-data-test", true); + DO_TEST("hex-data-test-invalid", true); - DO_TEST("comment-test", true); + DO_TEST("comment-test-invalid", true); DO_TEST("example-1", false); DO_TEST("example-2", false); - DO_TEST("chain_prefixtest1", true); /* derived from arp-test */ + DO_TEST("chain_prefixtest1-invalid", true); /* derived from arp-test */ DO_TEST("attr-value-test", false); DO_TEST("iter-test1", false); -- 2.26.2

The 'vmware' private namespace wasn't present in our schema definition making all XMLs having the <datacenterpath> element invalid. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/schemas/domaincommon.rng | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 50d8aa9155..41803c8f99 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -90,6 +90,9 @@ <optional> <ref name="xencmdline"/> </optional> + <optional> + <ref name="vmwaredatacenterpath"/> + </optional> </interleave> </element> </define> @@ -6835,6 +6838,16 @@ </element> </define> + <!-- + Optional hypervisor extensions in their own namespace: + vmware + --> + <define name="vmwaredatacenterpath"> + <element name="datacenterpath" ns="http://libvirt.org/schemas/domain/vmware/1.0"> + <text/> + </element> + </define> + <!-- Type library --> -- 2.26.2

vmware's network names can contain space and they are used as bridge source. Modify the schema to allow it. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/schemas/domaincommon.rng | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 41803c8f99..c25a742581 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2886,7 +2886,9 @@ <define name="interface-bridge-attributes"> <attribute name="bridge"> - <ref name="deviceName"/> + <data type="string"> + <param name="pattern">[a-zA-Z0-9_\.\-\\:/ ]*</param> + </data> </attribute> <optional> <attribute name="macTableManager"> -- 2.26.2

<name> is mandatory for a domain XML. Add 'displayName' for all the test cases which were missing them so that <name> is parsed correctly. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- tests/vmx2xmldata/vmx2xml-annotation.vmx | 1 + tests/vmx2xmldata/vmx2xml-annotation.xml | 1 + tests/vmx2xmldata/vmx2xml-case-insensitive-1.vmx | 1 + tests/vmx2xmldata/vmx2xml-case-insensitive-2.vmx | 1 + tests/vmx2xmldata/vmx2xml-cdrom-ide-device.vmx | 1 + tests/vmx2xmldata/vmx2xml-cdrom-ide-device.xml | 1 + tests/vmx2xmldata/vmx2xml-cdrom-ide-empty-2.vmx | 1 + tests/vmx2xmldata/vmx2xml-cdrom-ide-empty-2.xml | 1 + tests/vmx2xmldata/vmx2xml-cdrom-ide-empty.vmx | 1 + tests/vmx2xmldata/vmx2xml-cdrom-ide-empty.xml | 1 + tests/vmx2xmldata/vmx2xml-cdrom-ide-file.vmx | 1 + tests/vmx2xmldata/vmx2xml-cdrom-ide-file.xml | 1 + tests/vmx2xmldata/vmx2xml-cdrom-ide-raw-auto-detect.vmx | 1 + tests/vmx2xmldata/vmx2xml-cdrom-ide-raw-auto-detect.xml | 1 + tests/vmx2xmldata/vmx2xml-cdrom-ide-raw-device.vmx | 1 + tests/vmx2xmldata/vmx2xml-cdrom-ide-raw-device.xml | 1 + tests/vmx2xmldata/vmx2xml-cdrom-scsi-device.vmx | 1 + tests/vmx2xmldata/vmx2xml-cdrom-scsi-device.xml | 1 + tests/vmx2xmldata/vmx2xml-cdrom-scsi-empty.vmx | 1 + tests/vmx2xmldata/vmx2xml-cdrom-scsi-empty.xml | 1 + tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.vmx | 1 + tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.xml | 1 + tests/vmx2xmldata/vmx2xml-cdrom-scsi-passthru.vmx | 1 + tests/vmx2xmldata/vmx2xml-cdrom-scsi-passthru.xml | 1 + tests/vmx2xmldata/vmx2xml-cdrom-scsi-raw-auto-detect.vmx | 1 + tests/vmx2xmldata/vmx2xml-cdrom-scsi-raw-auto-detect.xml | 1 + tests/vmx2xmldata/vmx2xml-cdrom-scsi-raw-device.vmx | 1 + tests/vmx2xmldata/vmx2xml-cdrom-scsi-raw-device.xml | 1 + tests/vmx2xmldata/vmx2xml-datacenterpath.vmx | 1 + tests/vmx2xmldata/vmx2xml-datacenterpath.xml | 1 + tests/vmx2xmldata/vmx2xml-ethernet-bridged.vmx | 1 + tests/vmx2xmldata/vmx2xml-ethernet-bridged.xml | 1 + tests/vmx2xmldata/vmx2xml-ethernet-custom.vmx | 1 + tests/vmx2xmldata/vmx2xml-ethernet-custom.xml | 1 + tests/vmx2xmldata/vmx2xml-ethernet-e1000.vmx | 1 + tests/vmx2xmldata/vmx2xml-ethernet-e1000.xml | 1 + tests/vmx2xmldata/vmx2xml-ethernet-generated.vmx | 1 + tests/vmx2xmldata/vmx2xml-ethernet-generated.xml | 1 + tests/vmx2xmldata/vmx2xml-ethernet-nat.vmx | 1 + tests/vmx2xmldata/vmx2xml-ethernet-nat.xml | 1 + tests/vmx2xmldata/vmx2xml-ethernet-other.vmx | 1 + tests/vmx2xmldata/vmx2xml-ethernet-other.xml | 1 + tests/vmx2xmldata/vmx2xml-ethernet-static.vmx | 1 + tests/vmx2xmldata/vmx2xml-ethernet-static.xml | 1 + tests/vmx2xmldata/vmx2xml-ethernet-vmxnet2.vmx | 1 + tests/vmx2xmldata/vmx2xml-ethernet-vmxnet2.xml | 1 + tests/vmx2xmldata/vmx2xml-ethernet-vpx.vmx | 1 + tests/vmx2xmldata/vmx2xml-ethernet-vpx.xml | 1 + tests/vmx2xmldata/vmx2xml-firmware-efi.vmx | 1 + tests/vmx2xmldata/vmx2xml-firmware-efi.xml | 1 + tests/vmx2xmldata/vmx2xml-floppy-device.vmx | 1 + tests/vmx2xmldata/vmx2xml-floppy-device.xml | 1 + tests/vmx2xmldata/vmx2xml-floppy-file.vmx | 1 + tests/vmx2xmldata/vmx2xml-floppy-file.xml | 1 + tests/vmx2xmldata/vmx2xml-graphics-vnc.vmx | 1 + tests/vmx2xmldata/vmx2xml-graphics-vnc.xml | 1 + tests/vmx2xmldata/vmx2xml-harddisk-ide-file.vmx | 1 + tests/vmx2xmldata/vmx2xml-harddisk-ide-file.xml | 1 + tests/vmx2xmldata/vmx2xml-harddisk-scsi-file.vmx | 1 + tests/vmx2xmldata/vmx2xml-harddisk-scsi-file.xml | 1 + tests/vmx2xmldata/vmx2xml-harddisk-transient.vmx | 1 + tests/vmx2xmldata/vmx2xml-harddisk-transient.xml | 1 + tests/vmx2xmldata/vmx2xml-minimal-64bit.vmx | 1 + tests/vmx2xmldata/vmx2xml-minimal-64bit.xml | 1 + tests/vmx2xmldata/vmx2xml-minimal.vmx | 1 + tests/vmx2xmldata/vmx2xml-minimal.xml | 1 + tests/vmx2xmldata/vmx2xml-parallel-device.vmx | 1 + tests/vmx2xmldata/vmx2xml-parallel-device.xml | 1 + tests/vmx2xmldata/vmx2xml-parallel-file.vmx | 1 + tests/vmx2xmldata/vmx2xml-parallel-file.xml | 1 + tests/vmx2xmldata/vmx2xml-scsi-driver.vmx | 1 + tests/vmx2xmldata/vmx2xml-scsi-driver.xml | 1 + tests/vmx2xmldata/vmx2xml-scsi-writethrough.vmx | 1 + tests/vmx2xmldata/vmx2xml-scsi-writethrough.xml | 1 + tests/vmx2xmldata/vmx2xml-serial-device.vmx | 1 + tests/vmx2xmldata/vmx2xml-serial-device.xml | 1 + tests/vmx2xmldata/vmx2xml-serial-file.vmx | 1 + tests/vmx2xmldata/vmx2xml-serial-file.xml | 1 + tests/vmx2xmldata/vmx2xml-serial-network-client.vmx | 1 + tests/vmx2xmldata/vmx2xml-serial-network-client.xml | 1 + tests/vmx2xmldata/vmx2xml-serial-network-server.vmx | 1 + tests/vmx2xmldata/vmx2xml-serial-network-server.xml | 1 + tests/vmx2xmldata/vmx2xml-serial-pipe-client-app.vmx | 1 + tests/vmx2xmldata/vmx2xml-serial-pipe-client-vm.vmx | 1 + tests/vmx2xmldata/vmx2xml-serial-pipe-server-app.vmx | 1 + tests/vmx2xmldata/vmx2xml-serial-pipe-server-vm.vmx | 1 + tests/vmx2xmldata/vmx2xml-serial-pipe.xml | 1 + tests/vmx2xmldata/vmx2xml-sharedfolder.vmx | 1 + tests/vmx2xmldata/vmx2xml-sharedfolder.xml | 1 + tests/vmx2xmldata/vmx2xml-smbios.vmx | 1 + tests/vmx2xmldata/vmx2xml-smbios.xml | 1 + tests/vmx2xmldata/vmx2xml-svga.vmx | 1 + tests/vmx2xmldata/vmx2xml-svga.xml | 1 + 93 files changed, 93 insertions(+) diff --git a/tests/vmx2xmldata/vmx2xml-annotation.vmx b/tests/vmx2xmldata/vmx2xml-annotation.vmx index 405b73cbfa..35dbc1335e 100644 --- a/tests/vmx2xmldata/vmx2xml-annotation.vmx +++ b/tests/vmx2xmldata/vmx2xml-annotation.vmx @@ -1,3 +1,4 @@ config.version = "8" virtualHW.version = "4" annotation = "Some |7Ctext|7C to test the |22escaping|22: |7C|7C|22|22|7C|7C|22|7C |45|73|63|61|70|65|64|21" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-annotation.xml b/tests/vmx2xmldata/vmx2xml-annotation.xml index 9d99fd288b..3e7a0e129a 100644 --- a/tests/vmx2xmldata/vmx2xml-annotation.xml +++ b/tests/vmx2xmldata/vmx2xml-annotation.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <description>Some |text| to test the "escaping": ||""||"| Escaped!</description> <memory unit='KiB'>32768</memory> diff --git a/tests/vmx2xmldata/vmx2xml-case-insensitive-1.vmx b/tests/vmx2xmldata/vmx2xml-case-insensitive-1.vmx index 8641c5c01b..dd069b378d 100644 --- a/tests/vmx2xmldata/vmx2xml-case-insensitive-1.vmx +++ b/tests/vmx2xmldata/vmx2xml-case-insensitive-1.vmx @@ -49,3 +49,4 @@ UUID.LOCATION = "56 4D B5 06 A2 BD FB EB-AE 86 F7 D8 49 27 D0 C4" SCHED.CPU.MAX = "UNLIMITED" SCHED.SWAP.DERIVEDNAME = "/VMFS/VOLUMES/498076B2-02796C1A-EF5B-000AE484A6A3/FEDORA11/FEDORA11-7DE040D8.VSWP" TOOLS.REMINDINSTALL = "TRUE" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-case-insensitive-2.vmx b/tests/vmx2xmldata/vmx2xml-case-insensitive-2.vmx index a485d03cd9..e37e0b9369 100644 --- a/tests/vmx2xmldata/vmx2xml-case-insensitive-2.vmx +++ b/tests/vmx2xmldata/vmx2xml-case-insensitive-2.vmx @@ -49,3 +49,4 @@ uuid.location = "56 4d b5 06 a2 bd fb eb-ae 86 f7 d8 49 27 d0 c4" sched.cpu.max = "unlimited" sched.swap.derivedname = "/vmfs/volumes/498076b2-02796c1a-ef5b-000ae484a6a3/fedora11/fedora11-7de040d8.vswp" tools.remindinstall = "true" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-ide-device.vmx b/tests/vmx2xmldata/vmx2xml-cdrom-ide-device.vmx index dc789d257e..3b60bd18f5 100644 --- a/tests/vmx2xmldata/vmx2xml-cdrom-ide-device.vmx +++ b/tests/vmx2xmldata/vmx2xml-cdrom-ide-device.vmx @@ -4,3 +4,4 @@ guestOS = "other" ide0:0.present = "true" ide0:0.deviceType = "atapi-cdrom" ide0:0.fileName = "/dev/scd0" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-ide-device.xml b/tests/vmx2xmldata/vmx2xml-cdrom-ide-device.xml index d8bba13385..e5a242d1f4 100644 --- a/tests/vmx2xmldata/vmx2xml-cdrom-ide-device.xml +++ b/tests/vmx2xmldata/vmx2xml-cdrom-ide-device.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-ide-empty-2.vmx b/tests/vmx2xmldata/vmx2xml-cdrom-ide-empty-2.vmx index 36286cb20f..7ea8fb96de 100644 --- a/tests/vmx2xmldata/vmx2xml-cdrom-ide-empty-2.vmx +++ b/tests/vmx2xmldata/vmx2xml-cdrom-ide-empty-2.vmx @@ -2,3 +2,4 @@ config.version = "8" virtualHW.version = "4" ide0:0.present = "true" ide0:0.deviceType = "atapi-cdrom" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-ide-empty-2.xml b/tests/vmx2xmldata/vmx2xml-cdrom-ide-empty-2.xml index af4a5ff9f6..6af0ee0704 100644 --- a/tests/vmx2xmldata/vmx2xml-cdrom-ide-empty-2.xml +++ b/tests/vmx2xmldata/vmx2xml-cdrom-ide-empty-2.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-ide-empty.vmx b/tests/vmx2xmldata/vmx2xml-cdrom-ide-empty.vmx index 62fdb3d18d..c61b0eeb10 100644 --- a/tests/vmx2xmldata/vmx2xml-cdrom-ide-empty.vmx +++ b/tests/vmx2xmldata/vmx2xml-cdrom-ide-empty.vmx @@ -3,3 +3,4 @@ virtualHW.version = "4" ide0:0.present = "true" ide0:0.deviceType = "cdrom-image" ide0:0.fileName = "emptyBackingString" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-ide-empty.xml b/tests/vmx2xmldata/vmx2xml-cdrom-ide-empty.xml index b11fe272b6..93670e7eb4 100644 --- a/tests/vmx2xmldata/vmx2xml-cdrom-ide-empty.xml +++ b/tests/vmx2xmldata/vmx2xml-cdrom-ide-empty.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-ide-file.vmx b/tests/vmx2xmldata/vmx2xml-cdrom-ide-file.vmx index edd3999d0e..adc57f4374 100644 --- a/tests/vmx2xmldata/vmx2xml-cdrom-ide-file.vmx +++ b/tests/vmx2xmldata/vmx2xml-cdrom-ide-file.vmx @@ -3,3 +3,4 @@ virtualHW.version = "4" ide0:0.present = "true" ide0:0.deviceType = "cdrom-image" ide0:0.fileName = "cdrom.iso" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-ide-file.xml b/tests/vmx2xmldata/vmx2xml-cdrom-ide-file.xml index 7ca8ff729a..98548e9da8 100644 --- a/tests/vmx2xmldata/vmx2xml-cdrom-ide-file.xml +++ b/tests/vmx2xmldata/vmx2xml-cdrom-ide-file.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-ide-raw-auto-detect.vmx b/tests/vmx2xmldata/vmx2xml-cdrom-ide-raw-auto-detect.vmx index b2c4caf20f..0e24927960 100644 --- a/tests/vmx2xmldata/vmx2xml-cdrom-ide-raw-auto-detect.vmx +++ b/tests/vmx2xmldata/vmx2xml-cdrom-ide-raw-auto-detect.vmx @@ -3,3 +3,4 @@ virtualHW.version = "4" ide0:0.present = "true" ide0:0.deviceType = "cdrom-raw" ide0:0.fileName = "auto detect" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-ide-raw-auto-detect.xml b/tests/vmx2xmldata/vmx2xml-cdrom-ide-raw-auto-detect.xml index 68ad26dc6f..392d580ffa 100644 --- a/tests/vmx2xmldata/vmx2xml-cdrom-ide-raw-auto-detect.xml +++ b/tests/vmx2xmldata/vmx2xml-cdrom-ide-raw-auto-detect.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-ide-raw-device.vmx b/tests/vmx2xmldata/vmx2xml-cdrom-ide-raw-device.vmx index 164811140f..5ec66522c8 100644 --- a/tests/vmx2xmldata/vmx2xml-cdrom-ide-raw-device.vmx +++ b/tests/vmx2xmldata/vmx2xml-cdrom-ide-raw-device.vmx @@ -3,3 +3,4 @@ virtualHW.version = "4" ide0:0.present = "true" ide0:0.deviceType = "cdrom-raw" ide0:0.fileName = "/dev/scd0" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-ide-raw-device.xml b/tests/vmx2xmldata/vmx2xml-cdrom-ide-raw-device.xml index 679cdb154b..c7cba73aa8 100644 --- a/tests/vmx2xmldata/vmx2xml-cdrom-ide-raw-device.xml +++ b/tests/vmx2xmldata/vmx2xml-cdrom-ide-raw-device.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-device.vmx b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-device.vmx index 721068aded..5991b71b16 100644 --- a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-device.vmx +++ b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-device.vmx @@ -4,3 +4,4 @@ scsi0.present = "true" scsi0:0.present = "true" scsi0:0.deviceType = "atapi-cdrom" scsi0:0.fileName = "/dev/scd0" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-device.xml b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-device.xml index cf1275c829..9e5a985788 100644 --- a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-device.xml +++ b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-device.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-empty.vmx b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-empty.vmx index 3c6036ab2b..c08f4cc8ff 100644 --- a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-empty.vmx +++ b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-empty.vmx @@ -4,3 +4,4 @@ scsi0.present = "true" scsi0:0.present = "true" scsi0:0.deviceType = "cdrom-image" scsi0:0.fileName = "emptyBackingString" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-empty.xml b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-empty.xml index 20452522d8..3678ef38b0 100644 --- a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-empty.xml +++ b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-empty.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.vmx b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.vmx index 3422e0b6d9..91acf931aa 100644 --- a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.vmx +++ b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.vmx @@ -4,3 +4,4 @@ scsi0.present = "true" scsi0:0.present = "true" scsi0:0.deviceType = "cdrom-image" scsi0:0.fileName = "cdrom.iso" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.xml b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.xml index 5765232bc1..e79927ada8 100644 --- a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.xml +++ b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-passthru.vmx b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-passthru.vmx index fb7ea724ab..7898304fef 100644 --- a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-passthru.vmx +++ b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-passthru.vmx @@ -4,3 +4,4 @@ scsi0.present = "true" scsi0:0.present = "true" scsi0:0.deviceType = "scsi-passthru" scsi0:0.fileName = "/vmfs/devices/cdrom/mpx.vmhba32:C0:T0:L0" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-passthru.xml b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-passthru.xml index 46e27bce71..b851e73b3b 100644 --- a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-passthru.xml +++ b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-passthru.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-raw-auto-detect.vmx b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-raw-auto-detect.vmx index 0209b291e6..d92af1fd1d 100644 --- a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-raw-auto-detect.vmx +++ b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-raw-auto-detect.vmx @@ -4,3 +4,4 @@ scsi0.present = "true" scsi0:0.present = "true" scsi0:0.deviceType = "cdrom-raw" scsi0:0.fileName = "auto detect" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-raw-auto-detect.xml b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-raw-auto-detect.xml index 9d706b5d04..497066972d 100644 --- a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-raw-auto-detect.xml +++ b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-raw-auto-detect.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-raw-device.vmx b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-raw-device.vmx index 773b7432ea..42817946fc 100644 --- a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-raw-device.vmx +++ b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-raw-device.vmx @@ -4,3 +4,4 @@ scsi0.present = "true" scsi0:0.present = "true" scsi0:0.deviceType = "cdrom-raw" scsi0:0.fileName = "/dev/scd0" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-raw-device.xml b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-raw-device.xml index 9052327dcd..d7d881e4a6 100644 --- a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-raw-device.xml +++ b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-raw-device.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-datacenterpath.vmx b/tests/vmx2xmldata/vmx2xml-datacenterpath.vmx index a8e5db3746..bc17daa772 100644 --- a/tests/vmx2xmldata/vmx2xml-datacenterpath.vmx +++ b/tests/vmx2xmldata/vmx2xml-datacenterpath.vmx @@ -1,2 +1,3 @@ config.version = "8" virtualHW.version = "4" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-datacenterpath.xml b/tests/vmx2xmldata/vmx2xml-datacenterpath.xml index 7d458c5c8e..19920f81f7 100644 --- a/tests/vmx2xmldata/vmx2xml-datacenterpath.xml +++ b/tests/vmx2xmldata/vmx2xml-datacenterpath.xml @@ -1,4 +1,5 @@ <domain type='vmware' xmlns:vmware='http://libvirt.org/schemas/domain/vmware/1.0'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-bridged.vmx b/tests/vmx2xmldata/vmx2xml-ethernet-bridged.vmx index 8b7a5b3bf3..2c80db33b0 100644 --- a/tests/vmx2xmldata/vmx2xml-ethernet-bridged.vmx +++ b/tests/vmx2xmldata/vmx2xml-ethernet-bridged.vmx @@ -5,3 +5,4 @@ ethernet0.networkName = "VM Network" ethernet0.connectionType = "bridged" ethernet0.addressType = "static" ethernet0.address = "00:50:56:11:22:33" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-bridged.xml b/tests/vmx2xmldata/vmx2xml-ethernet-bridged.xml index fac5cd7bd5..84dc0d2ba2 100644 --- a/tests/vmx2xmldata/vmx2xml-ethernet-bridged.xml +++ b/tests/vmx2xmldata/vmx2xml-ethernet-bridged.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-custom.vmx b/tests/vmx2xmldata/vmx2xml-ethernet-custom.vmx index bab8aa1784..9dca6bbf7f 100644 --- a/tests/vmx2xmldata/vmx2xml-ethernet-custom.vmx +++ b/tests/vmx2xmldata/vmx2xml-ethernet-custom.vmx @@ -6,3 +6,4 @@ ethernet0.connectionType = "custom" ethernet0.vnet = "vmnet7" ethernet0.addressType = "static" ethernet0.address = "00:50:56:11:22:33" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-custom.xml b/tests/vmx2xmldata/vmx2xml-ethernet-custom.xml index ce63c24127..a3c6f03f31 100644 --- a/tests/vmx2xmldata/vmx2xml-ethernet-custom.xml +++ b/tests/vmx2xmldata/vmx2xml-ethernet-custom.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-e1000.vmx b/tests/vmx2xmldata/vmx2xml-ethernet-e1000.vmx index eb7c4844db..e31dc2c674 100644 --- a/tests/vmx2xmldata/vmx2xml-ethernet-e1000.vmx +++ b/tests/vmx2xmldata/vmx2xml-ethernet-e1000.vmx @@ -6,3 +6,4 @@ ethernet0.networkName = "VM Network" ethernet0.connectionType = "bridged" ethernet0.addressType = "static" ethernet0.address = "00:50:56:11:22:33" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-e1000.xml b/tests/vmx2xmldata/vmx2xml-ethernet-e1000.xml index 534d35e352..6ab739a0ba 100644 --- a/tests/vmx2xmldata/vmx2xml-ethernet-e1000.xml +++ b/tests/vmx2xmldata/vmx2xml-ethernet-e1000.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-generated.vmx b/tests/vmx2xmldata/vmx2xml-ethernet-generated.vmx index f27e0a008f..15c374b001 100644 --- a/tests/vmx2xmldata/vmx2xml-ethernet-generated.vmx +++ b/tests/vmx2xmldata/vmx2xml-ethernet-generated.vmx @@ -6,3 +6,4 @@ ethernet0.connectionType = "bridged" ethernet0.addressType = "generated" ethernet0.generatedAddress = "00:0C:29:11:22:33" ethernet0.generatedAddressOffset = "0" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-generated.xml b/tests/vmx2xmldata/vmx2xml-ethernet-generated.xml index 3fbc013f21..2d7cf93b54 100644 --- a/tests/vmx2xmldata/vmx2xml-ethernet-generated.xml +++ b/tests/vmx2xmldata/vmx2xml-ethernet-generated.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-nat.vmx b/tests/vmx2xmldata/vmx2xml-ethernet-nat.vmx index 701c3851fb..33aaf2b882 100644 --- a/tests/vmx2xmldata/vmx2xml-ethernet-nat.vmx +++ b/tests/vmx2xmldata/vmx2xml-ethernet-nat.vmx @@ -4,3 +4,4 @@ ethernet0.present = "true" ethernet0.connectionType = "nat" ethernet0.addressType = "static" ethernet0.address = "00:50:56:11:22:33" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-nat.xml b/tests/vmx2xmldata/vmx2xml-ethernet-nat.xml index af721e3059..f9939223be 100644 --- a/tests/vmx2xmldata/vmx2xml-ethernet-nat.xml +++ b/tests/vmx2xmldata/vmx2xml-ethernet-nat.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-other.vmx b/tests/vmx2xmldata/vmx2xml-ethernet-other.vmx index da46a70d46..4d1bf8fe41 100644 --- a/tests/vmx2xmldata/vmx2xml-ethernet-other.vmx +++ b/tests/vmx2xmldata/vmx2xml-ethernet-other.vmx @@ -6,3 +6,4 @@ ethernet0.connectionType = "bridged" ethernet0.checkMACAddress = "false" ethernet0.addressType = "static" ethernet0.address = "00:12:34:56:78:90" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-other.xml b/tests/vmx2xmldata/vmx2xml-ethernet-other.xml index ef324405d7..9cecc262fb 100644 --- a/tests/vmx2xmldata/vmx2xml-ethernet-other.xml +++ b/tests/vmx2xmldata/vmx2xml-ethernet-other.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-static.vmx b/tests/vmx2xmldata/vmx2xml-ethernet-static.vmx index 8b7a5b3bf3..2c80db33b0 100644 --- a/tests/vmx2xmldata/vmx2xml-ethernet-static.vmx +++ b/tests/vmx2xmldata/vmx2xml-ethernet-static.vmx @@ -5,3 +5,4 @@ ethernet0.networkName = "VM Network" ethernet0.connectionType = "bridged" ethernet0.addressType = "static" ethernet0.address = "00:50:56:11:22:33" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-static.xml b/tests/vmx2xmldata/vmx2xml-ethernet-static.xml index fac5cd7bd5..84dc0d2ba2 100644 --- a/tests/vmx2xmldata/vmx2xml-ethernet-static.xml +++ b/tests/vmx2xmldata/vmx2xml-ethernet-static.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-vmxnet2.vmx b/tests/vmx2xmldata/vmx2xml-ethernet-vmxnet2.vmx index 1c3f063365..3306925c07 100644 --- a/tests/vmx2xmldata/vmx2xml-ethernet-vmxnet2.vmx +++ b/tests/vmx2xmldata/vmx2xml-ethernet-vmxnet2.vmx @@ -7,3 +7,4 @@ ethernet0.networkName = "VM Network" ethernet0.connectionType = "bridged" ethernet0.addressType = "static" ethernet0.address = "00:50:56:11:22:33" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-vmxnet2.xml b/tests/vmx2xmldata/vmx2xml-ethernet-vmxnet2.xml index 54c9283989..8ba8f3d465 100644 --- a/tests/vmx2xmldata/vmx2xml-ethernet-vmxnet2.xml +++ b/tests/vmx2xmldata/vmx2xml-ethernet-vmxnet2.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-vpx.vmx b/tests/vmx2xmldata/vmx2xml-ethernet-vpx.vmx index b4d9172764..6ffefe2f76 100644 --- a/tests/vmx2xmldata/vmx2xml-ethernet-vpx.vmx +++ b/tests/vmx2xmldata/vmx2xml-ethernet-vpx.vmx @@ -5,3 +5,4 @@ ethernet0.networkName = "VM Network" ethernet0.connectionType = "bridged" ethernet0.addressType = "vpx" ethernet0.generatedAddress = "00:50:56:87:65:43" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-ethernet-vpx.xml b/tests/vmx2xmldata/vmx2xml-ethernet-vpx.xml index c75d52f5b2..3f10934359 100644 --- a/tests/vmx2xmldata/vmx2xml-ethernet-vpx.xml +++ b/tests/vmx2xmldata/vmx2xml-ethernet-vpx.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-firmware-efi.vmx b/tests/vmx2xmldata/vmx2xml-firmware-efi.vmx index dbb215a5db..93453b56f5 100644 --- a/tests/vmx2xmldata/vmx2xml-firmware-efi.vmx +++ b/tests/vmx2xmldata/vmx2xml-firmware-efi.vmx @@ -1,3 +1,4 @@ config.version = "8" virtualHW.version = "13" firmware = "efi" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-firmware-efi.xml b/tests/vmx2xmldata/vmx2xml-firmware-efi.xml index e21158cebf..fee707fe71 100644 --- a/tests/vmx2xmldata/vmx2xml-firmware-efi.xml +++ b/tests/vmx2xmldata/vmx2xml-firmware-efi.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-floppy-device.vmx b/tests/vmx2xmldata/vmx2xml-floppy-device.vmx index 6c6358d468..323a399b4e 100644 --- a/tests/vmx2xmldata/vmx2xml-floppy-device.vmx +++ b/tests/vmx2xmldata/vmx2xml-floppy-device.vmx @@ -3,3 +3,4 @@ virtualHW.version = "4" floppy0.present = "true" floppy0.fileType = "device" floppy0.fileName = "/dev/fd0" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-floppy-device.xml b/tests/vmx2xmldata/vmx2xml-floppy-device.xml index 3b1317249d..a1264f98a8 100644 --- a/tests/vmx2xmldata/vmx2xml-floppy-device.xml +++ b/tests/vmx2xmldata/vmx2xml-floppy-device.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-floppy-file.vmx b/tests/vmx2xmldata/vmx2xml-floppy-file.vmx index ff50117d16..71b63a1b5d 100644 --- a/tests/vmx2xmldata/vmx2xml-floppy-file.vmx +++ b/tests/vmx2xmldata/vmx2xml-floppy-file.vmx @@ -6,3 +6,4 @@ floppy0.fileName = "floppy.flp" floppy1.present = "true" floppy1.fileType = "file" floppy1.fileName = "floppy" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-floppy-file.xml b/tests/vmx2xmldata/vmx2xml-floppy-file.xml index 6699f15602..6ae11e7f54 100644 --- a/tests/vmx2xmldata/vmx2xml-floppy-file.xml +++ b/tests/vmx2xmldata/vmx2xml-floppy-file.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-graphics-vnc.vmx b/tests/vmx2xmldata/vmx2xml-graphics-vnc.vmx index bd3e55f7ab..9cba21f4f1 100644 --- a/tests/vmx2xmldata/vmx2xml-graphics-vnc.vmx +++ b/tests/vmx2xmldata/vmx2xml-graphics-vnc.vmx @@ -4,3 +4,4 @@ RemoteDisplay.vnc.enabled = "true" RemoteDisplay.vnc.port = "5903" RemoteDisplay.vnc.keymap = "de" RemoteDisplay.vnc.password = "password" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-graphics-vnc.xml b/tests/vmx2xmldata/vmx2xml-graphics-vnc.xml index 3c575798f4..15a9766403 100644 --- a/tests/vmx2xmldata/vmx2xml-graphics-vnc.xml +++ b/tests/vmx2xmldata/vmx2xml-graphics-vnc.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-harddisk-ide-file.vmx b/tests/vmx2xmldata/vmx2xml-harddisk-ide-file.vmx index a8c71f189b..480b5cd354 100644 --- a/tests/vmx2xmldata/vmx2xml-harddisk-ide-file.vmx +++ b/tests/vmx2xmldata/vmx2xml-harddisk-ide-file.vmx @@ -3,3 +3,4 @@ virtualHW.version = "4" ide0:0.present = "true" ide0:0.deviceType = "ata-hardDisk" ide0:0.fileName = "harddisk.vmdk" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-harddisk-ide-file.xml b/tests/vmx2xmldata/vmx2xml-harddisk-ide-file.xml index d452e6ed99..9b2431baac 100644 --- a/tests/vmx2xmldata/vmx2xml-harddisk-ide-file.xml +++ b/tests/vmx2xmldata/vmx2xml-harddisk-ide-file.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-harddisk-scsi-file.vmx b/tests/vmx2xmldata/vmx2xml-harddisk-scsi-file.vmx index 933707c984..b3f5a8c803 100644 --- a/tests/vmx2xmldata/vmx2xml-harddisk-scsi-file.vmx +++ b/tests/vmx2xmldata/vmx2xml-harddisk-scsi-file.vmx @@ -4,3 +4,4 @@ scsi0.present = "true" scsi0:0.present = "true" scsi0:0.deviceType = "scsi-hardDisk" scsi0:0.fileName = "harddisk.vmdk" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-harddisk-scsi-file.xml b/tests/vmx2xmldata/vmx2xml-harddisk-scsi-file.xml index 64b89c6530..0750d4f8c8 100644 --- a/tests/vmx2xmldata/vmx2xml-harddisk-scsi-file.xml +++ b/tests/vmx2xmldata/vmx2xml-harddisk-scsi-file.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-harddisk-transient.vmx b/tests/vmx2xmldata/vmx2xml-harddisk-transient.vmx index 68ef3827f7..434a580f41 100644 --- a/tests/vmx2xmldata/vmx2xml-harddisk-transient.vmx +++ b/tests/vmx2xmldata/vmx2xml-harddisk-transient.vmx @@ -4,3 +4,4 @@ ide0:0.present = "true" ide0:0.deviceType = "ata-hardDisk" ide0:0.fileName = "harddisk.vmdk" ide0:0.mode = "independent-nonpersistent" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-harddisk-transient.xml b/tests/vmx2xmldata/vmx2xml-harddisk-transient.xml index f61fb21773..97c5653862 100644 --- a/tests/vmx2xmldata/vmx2xml-harddisk-transient.xml +++ b/tests/vmx2xmldata/vmx2xml-harddisk-transient.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-minimal-64bit.vmx b/tests/vmx2xmldata/vmx2xml-minimal-64bit.vmx index 73d3972591..d83f2e2644 100644 --- a/tests/vmx2xmldata/vmx2xml-minimal-64bit.vmx +++ b/tests/vmx2xmldata/vmx2xml-minimal-64bit.vmx @@ -1,3 +1,4 @@ config.version = "8" virtualHW.version = "4" guestOS = "other-64" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-minimal-64bit.xml b/tests/vmx2xmldata/vmx2xml-minimal-64bit.xml index 42245d4ba0..d883116f27 100644 --- a/tests/vmx2xmldata/vmx2xml-minimal-64bit.xml +++ b/tests/vmx2xmldata/vmx2xml-minimal-64bit.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-minimal.vmx b/tests/vmx2xmldata/vmx2xml-minimal.vmx index a8e5db3746..bc17daa772 100644 --- a/tests/vmx2xmldata/vmx2xml-minimal.vmx +++ b/tests/vmx2xmldata/vmx2xml-minimal.vmx @@ -1,2 +1,3 @@ config.version = "8" virtualHW.version = "4" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-minimal.xml b/tests/vmx2xmldata/vmx2xml-minimal.xml index 122d59cd77..3d47fa972e 100644 --- a/tests/vmx2xmldata/vmx2xml-minimal.xml +++ b/tests/vmx2xmldata/vmx2xml-minimal.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-parallel-device.vmx b/tests/vmx2xmldata/vmx2xml-parallel-device.vmx index ee2eb749b6..4b499abaf0 100644 --- a/tests/vmx2xmldata/vmx2xml-parallel-device.vmx +++ b/tests/vmx2xmldata/vmx2xml-parallel-device.vmx @@ -3,3 +3,4 @@ virtualHW.version = "4" parallel0.present = "true" parallel0.fileType = "device" parallel0.fileName = "/dev/parallel0" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-parallel-device.xml b/tests/vmx2xmldata/vmx2xml-parallel-device.xml index 3c69198b93..bdf9cfd9d0 100644 --- a/tests/vmx2xmldata/vmx2xml-parallel-device.xml +++ b/tests/vmx2xmldata/vmx2xml-parallel-device.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-parallel-file.vmx b/tests/vmx2xmldata/vmx2xml-parallel-file.vmx index e91906a9d7..6c34c6b454 100644 --- a/tests/vmx2xmldata/vmx2xml-parallel-file.vmx +++ b/tests/vmx2xmldata/vmx2xml-parallel-file.vmx @@ -3,3 +3,4 @@ virtualHW.version = "4" parallel0.present = "true" parallel0.fileType = "file" parallel0.fileName = "parallel0.file" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-parallel-file.xml b/tests/vmx2xmldata/vmx2xml-parallel-file.xml index d7ec0cf1a2..7fda5877c6 100644 --- a/tests/vmx2xmldata/vmx2xml-parallel-file.xml +++ b/tests/vmx2xmldata/vmx2xml-parallel-file.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-scsi-driver.vmx b/tests/vmx2xmldata/vmx2xml-scsi-driver.vmx index 64d7c99d3a..91a76d2dd1 100644 --- a/tests/vmx2xmldata/vmx2xml-scsi-driver.vmx +++ b/tests/vmx2xmldata/vmx2xml-scsi-driver.vmx @@ -20,3 +20,4 @@ scsi2:0.fileName = "harddisk3.vmdk" scsi3:0.present = "true" scsi3:0.deviceType = "scsi-hardDisk" scsi3:0.fileName = "harddisk4.vmdk" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-scsi-driver.xml b/tests/vmx2xmldata/vmx2xml-scsi-driver.xml index 1a057df428..e5b73420c3 100644 --- a/tests/vmx2xmldata/vmx2xml-scsi-driver.xml +++ b/tests/vmx2xmldata/vmx2xml-scsi-driver.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-scsi-writethrough.vmx b/tests/vmx2xmldata/vmx2xml-scsi-writethrough.vmx index 54ac49c914..a4a61b5fde 100644 --- a/tests/vmx2xmldata/vmx2xml-scsi-writethrough.vmx +++ b/tests/vmx2xmldata/vmx2xml-scsi-writethrough.vmx @@ -6,3 +6,4 @@ scsi0:0.present = "true" scsi0:0.deviceType = "scsi-hardDisk" scsi0:0.fileName = "harddisk.vmdk" scsi0:0.writeThrough = "true" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-scsi-writethrough.xml b/tests/vmx2xmldata/vmx2xml-scsi-writethrough.xml index 95accb104e..5f6869852a 100644 --- a/tests/vmx2xmldata/vmx2xml-scsi-writethrough.xml +++ b/tests/vmx2xmldata/vmx2xml-scsi-writethrough.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-serial-device.vmx b/tests/vmx2xmldata/vmx2xml-serial-device.vmx index 927f408fbb..131c0de498 100644 --- a/tests/vmx2xmldata/vmx2xml-serial-device.vmx +++ b/tests/vmx2xmldata/vmx2xml-serial-device.vmx @@ -5,3 +5,4 @@ serial0.fileType = "device" serial0.fileName = "/dev/ttyS0" serial1.present = "true" serial1.fileName = "/dev/ttyS1" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-serial-device.xml b/tests/vmx2xmldata/vmx2xml-serial-device.xml index df25d66b98..165db89c8e 100644 --- a/tests/vmx2xmldata/vmx2xml-serial-device.xml +++ b/tests/vmx2xmldata/vmx2xml-serial-device.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-serial-file.vmx b/tests/vmx2xmldata/vmx2xml-serial-file.vmx index 2c3bc39628..e1ed2dd4db 100644 --- a/tests/vmx2xmldata/vmx2xml-serial-file.vmx +++ b/tests/vmx2xmldata/vmx2xml-serial-file.vmx @@ -3,3 +3,4 @@ virtualHW.version = "4" serial0.present = "true" serial0.fileType = "file" serial0.fileName = "serial0.file" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-serial-file.xml b/tests/vmx2xmldata/vmx2xml-serial-file.xml index 84618c321c..40bf7ecddc 100644 --- a/tests/vmx2xmldata/vmx2xml-serial-file.xml +++ b/tests/vmx2xmldata/vmx2xml-serial-file.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-serial-network-client.vmx b/tests/vmx2xmldata/vmx2xml-serial-network-client.vmx index 18cfc57c61..fefc27a586 100644 --- a/tests/vmx2xmldata/vmx2xml-serial-network-client.vmx +++ b/tests/vmx2xmldata/vmx2xml-serial-network-client.vmx @@ -4,3 +4,4 @@ serial0.present = "true" serial0.fileType = "network" serial0.fileName = "tcp://192.168.0.17:42001" serial0.network.endPoint = "client" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-serial-network-client.xml b/tests/vmx2xmldata/vmx2xml-serial-network-client.xml index 2e096434f5..19ec90a023 100644 --- a/tests/vmx2xmldata/vmx2xml-serial-network-client.xml +++ b/tests/vmx2xmldata/vmx2xml-serial-network-client.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-serial-network-server.vmx b/tests/vmx2xmldata/vmx2xml-serial-network-server.vmx index d4a9c41310..d7dd20f7f6 100644 --- a/tests/vmx2xmldata/vmx2xml-serial-network-server.vmx +++ b/tests/vmx2xmldata/vmx2xml-serial-network-server.vmx @@ -4,3 +4,4 @@ serial0.present = "true" serial0.fileType = "network" serial0.fileName = "telnets://0.0.0.0:42001" serial0.network.endPoint = "server" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-serial-network-server.xml b/tests/vmx2xmldata/vmx2xml-serial-network-server.xml index 65950e8cea..229ca10fb2 100644 --- a/tests/vmx2xmldata/vmx2xml-serial-network-server.xml +++ b/tests/vmx2xmldata/vmx2xml-serial-network-server.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-serial-pipe-client-app.vmx b/tests/vmx2xmldata/vmx2xml-serial-pipe-client-app.vmx index f104aab099..164502f08b 100644 --- a/tests/vmx2xmldata/vmx2xml-serial-pipe-client-app.vmx +++ b/tests/vmx2xmldata/vmx2xml-serial-pipe-client-app.vmx @@ -5,3 +5,4 @@ serial0.fileType = "pipe" serial0.fileName = "serial0.pipe" serial0.pipe.endPoint = "client" serial0.tryNoRxLoss = "true" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-serial-pipe-client-vm.vmx b/tests/vmx2xmldata/vmx2xml-serial-pipe-client-vm.vmx index 3b487ee5e3..1aeb9152d5 100644 --- a/tests/vmx2xmldata/vmx2xml-serial-pipe-client-vm.vmx +++ b/tests/vmx2xmldata/vmx2xml-serial-pipe-client-vm.vmx @@ -4,3 +4,4 @@ serial0.present = "true" serial0.fileType = "pipe" serial0.fileName = "serial0.pipe" serial0.pipe.endPoint = "client" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-serial-pipe-server-app.vmx b/tests/vmx2xmldata/vmx2xml-serial-pipe-server-app.vmx index 27ee3bc216..4a1bfe22a5 100644 --- a/tests/vmx2xmldata/vmx2xml-serial-pipe-server-app.vmx +++ b/tests/vmx2xmldata/vmx2xml-serial-pipe-server-app.vmx @@ -5,3 +5,4 @@ serial0.fileType = "pipe" serial0.fileName = "serial0.pipe" serial0.pipe.endPoint = "server" serial0.tryNoRxLoss = "true" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-serial-pipe-server-vm.vmx b/tests/vmx2xmldata/vmx2xml-serial-pipe-server-vm.vmx index b99c627eb6..b8f57d7068 100644 --- a/tests/vmx2xmldata/vmx2xml-serial-pipe-server-vm.vmx +++ b/tests/vmx2xmldata/vmx2xml-serial-pipe-server-vm.vmx @@ -4,3 +4,4 @@ serial0.present = "true" serial0.fileType = "pipe" serial0.fileName = "serial0.pipe" serial0.pipe.endPoint = "server" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-serial-pipe.xml b/tests/vmx2xmldata/vmx2xml-serial-pipe.xml index bd425e603e..59a5b978c2 100644 --- a/tests/vmx2xmldata/vmx2xml-serial-pipe.xml +++ b/tests/vmx2xmldata/vmx2xml-serial-pipe.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-sharedfolder.vmx b/tests/vmx2xmldata/vmx2xml-sharedfolder.vmx index e60fcd493b..6053c9dd89 100644 --- a/tests/vmx2xmldata/vmx2xml-sharedfolder.vmx +++ b/tests/vmx2xmldata/vmx2xml-sharedfolder.vmx @@ -7,3 +7,4 @@ sharedFolder0.enabled = "true" sharedFolder0.hostPath = "/path/to/shared" sharedFolder0.guestName = "shared" sharedFolder0.writeAccess = "true" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-sharedfolder.xml b/tests/vmx2xmldata/vmx2xml-sharedfolder.xml index 7fa3203161..f41ef71912 100644 --- a/tests/vmx2xmldata/vmx2xml-sharedfolder.xml +++ b/tests/vmx2xmldata/vmx2xml-sharedfolder.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-smbios.vmx b/tests/vmx2xmldata/vmx2xml-smbios.vmx index 16258b0bea..8fa9d3e08e 100644 --- a/tests/vmx2xmldata/vmx2xml-smbios.vmx +++ b/tests/vmx2xmldata/vmx2xml-smbios.vmx @@ -1,3 +1,4 @@ config.version = "8" virtualHW.version = "4" smbios.reflecthost = "true" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-smbios.xml b/tests/vmx2xmldata/vmx2xml-smbios.xml index 6773502633..53b5fd01b8 100644 --- a/tests/vmx2xmldata/vmx2xml-smbios.xml +++ b/tests/vmx2xmldata/vmx2xml-smbios.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> diff --git a/tests/vmx2xmldata/vmx2xml-svga.vmx b/tests/vmx2xmldata/vmx2xml-svga.vmx index 081d6cee0d..7ed953424c 100644 --- a/tests/vmx2xmldata/vmx2xml-svga.vmx +++ b/tests/vmx2xmldata/vmx2xml-svga.vmx @@ -1,3 +1,4 @@ config.version = "8" virtualHW.version = "4" svga.vramSize = "8388608" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-svga.xml b/tests/vmx2xmldata/vmx2xml-svga.xml index da0f1a30e2..96dff16d37 100644 --- a/tests/vmx2xmldata/vmx2xml-svga.xml +++ b/tests/vmx2xmldata/vmx2xml-svga.xml @@ -1,4 +1,5 @@ <domain type='vmware'> + <name>test</name> <uuid>00000000-0000-0000-0000-000000000000</uuid> <memory unit='KiB'>32768</memory> <currentMemory unit='KiB'>32768</currentMemory> -- 2.26.2

On Monday, 19 October 2020 14:22:24 CEST Peter Krempa wrote:
<name> is mandatory for a domain XML. Add 'displayName' for all the test cases which were missing them so that <name> is parsed correctly.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- [...] diff --git a/tests/vmx2xmldata/vmx2xml-case-insensitive-1.vmx b/tests/vmx2xmldata/vmx2xml-case-insensitive-1.vmx index 8641c5c01b..dd069b378d 100644 --- a/tests/vmx2xmldata/vmx2xml-case-insensitive-1.vmx +++ b/tests/vmx2xmldata/vmx2xml-case-insensitive-1.vmx @@ -49,3 +49,4 @@ UUID.LOCATION = "56 4D B5 06 A2 BD FB EB-AE 86 F7 D8 49 27 D0 C4" SCHED.CPU.MAX = "UNLIMITED" SCHED.SWAP.DERIVEDNAME = "/VMFS/VOLUMES/498076B2-02796C1A-EF5B-000AE484A6A3/FEDORA11/FEDORA11-7DE040D8.VSWP" TOOLS.REMINDINSTALL = "TRUE" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-case-insensitive-2.vmx b/tests/vmx2xmldata/vmx2xml-case-insensitive-2.vmx index a485d03cd9..e37e0b9369 100644 --- a/tests/vmx2xmldata/vmx2xml-case-insensitive-2.vmx +++ b/tests/vmx2xmldata/vmx2xml-case-insensitive-2.vmx @@ -49,3 +49,4 @@ uuid.location = "56 4d b5 06 a2 bd fb eb-ae 86 f7 d8 49 27 d0 c4" sched.cpu.max = "unlimited" sched.swap.derivedname = "/vmfs/volumes/498076b2-02796c1a-ef5b-000ae484a6a3/fedora11/fedora11-7de040d8.vswp" tools.remindinstall = "true" +displayName = "test"
Are you sure about these two? They have already displayName, albeit with a different captalization, and indeed this patch has no changes to their xml result files. With the above two removed: Reviewed-by: Pino Toscano <ptoscano@redhat.com> -- Pino Toscano

On Mon, Oct 19, 2020 at 14:45:47 +0200, Pino Toscano wrote:
On Monday, 19 October 2020 14:22:24 CEST Peter Krempa wrote:
<name> is mandatory for a domain XML. Add 'displayName' for all the test cases which were missing them so that <name> is parsed correctly.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- [...] diff --git a/tests/vmx2xmldata/vmx2xml-case-insensitive-1.vmx b/tests/vmx2xmldata/vmx2xml-case-insensitive-1.vmx index 8641c5c01b..dd069b378d 100644 --- a/tests/vmx2xmldata/vmx2xml-case-insensitive-1.vmx +++ b/tests/vmx2xmldata/vmx2xml-case-insensitive-1.vmx @@ -49,3 +49,4 @@ UUID.LOCATION = "56 4D B5 06 A2 BD FB EB-AE 86 F7 D8 49 27 D0 C4" SCHED.CPU.MAX = "UNLIMITED" SCHED.SWAP.DERIVEDNAME = "/VMFS/VOLUMES/498076B2-02796C1A-EF5B-000AE484A6A3/FEDORA11/FEDORA11-7DE040D8.VSWP" TOOLS.REMINDINSTALL = "TRUE" +displayName = "test" diff --git a/tests/vmx2xmldata/vmx2xml-case-insensitive-2.vmx b/tests/vmx2xmldata/vmx2xml-case-insensitive-2.vmx index a485d03cd9..e37e0b9369 100644 --- a/tests/vmx2xmldata/vmx2xml-case-insensitive-2.vmx +++ b/tests/vmx2xmldata/vmx2xml-case-insensitive-2.vmx @@ -49,3 +49,4 @@ uuid.location = "56 4d b5 06 a2 bd fb eb-ae 86 f7 d8 49 27 d0 c4" sched.cpu.max = "unlimited" sched.swap.derivedname = "/vmfs/volumes/498076b2-02796c1a-ef5b-000ae484a6a3/fedora11/fedora11-7de040d8.vswp" tools.remindinstall = "true" +displayName = "test"
Are you sure about these two? They have already displayName, albeit with a different captalization, and indeed this patch has no changes to their xml result files.
Oh, oops, I used a script, which checked just the proper capitalization. Those obviously need to be dropped.
With the above two removed: Reviewed-by: Pino Toscano <ptoscano@redhat.com>
Thanks!

Validate additional XML documents we use for internal testing. Specifically there's a lot of them belonging to the vmx and bhyve test suite which were not validated. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- tests/virschematest.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/virschematest.c b/tests/virschematest.c index 0a1639bf44..50dcc5d9d7 100644 --- a/tests/virschematest.c +++ b/tests/virschematest.c @@ -231,6 +231,15 @@ static const struct testSchemaEntry schemaDomain[] = { { .dir = "tests/qemuhotplugtestdomains" }, { .dir = "examples/xml/test/", .dirRegex = "testdom.*" }, + { .dir = "tests/qemuhotplugtestcpus" }, + { .dir = "tests/securityselinuxlabeldata" }, + { .dir = "tests/domainconfdata" }, + { .dir = "tests/lxcconf2xmldata" }, + { .dir = "tests/qemumemlockdata" }, + { .dir = "tests/vmx2xmldata" }, + { .dir = "tests/xml2vmxdata" }, + { .dir = "tests/bhyveargv2xmldata" }, + { .dir = "tests/qemuagentdata" }, }; static const struct testSchemaEntry schemaDomainCaps[] = { -- 2.26.2

We weren't validating certain directories containing nwfilter, network and capability XML test files. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- tests/virschematest.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/virschematest.c b/tests/virschematest.c index 50dcc5d9d7..6ce09d4737 100644 --- a/tests/virschematest.c +++ b/tests/virschematest.c @@ -213,6 +213,7 @@ testSchemaEntries(const char *schema, static const struct testSchemaEntry schemaCapability[] = { { .dir = "tests/capabilityschemadata" }, { .dir = "tests/vircaps2xmldata" }, + { .dir = "tests/qemucaps2xmloutdata" }, }; static const struct testSchemaEntry schemaDomain[] = { @@ -272,6 +273,8 @@ static const struct testSchemaEntry schemaNetwork[] = { { .dir = "tests/networkxml2confdata" }, { .dir = "examples/xml/test/", .dirRegex = "testnet.*" }, + { .dir = "tests/networkxml2xmlupdateout" }, + { .dir = "tests/networkxml2firewalldata" }, }; static const struct testSchemaEntry schemaNetworkport[] = { @@ -286,6 +289,8 @@ static const struct testSchemaEntry schemaNodedev[] = { static const struct testSchemaEntry schemaNwfilter[] = { { .dir = "tests/nwfilterxml2xmlout" }, { .dir = "src/nwfilter/xml" }, + { .dir = "tests/nwfilterxml2xmlin" }, + { .dir = "tests/nwfilterxml2firewalldata" }, }; static const struct testSchemaEntry schemaNwfilterbinding[] = { -- 2.26.2

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> --- 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

On 10/19/20 2:22 PM, Peter Krempa wrote:
Quite a few XMLs in examples/tests are not validated, many of them actually invalid. Improve schema validation.
v2: - pushed ACK'd patches - rebased - added patch for schema validation of tests/cputestdata
Peter Krempa (18): virschematest: Rewrite internals to allow increasing XML test coverage virschematest: Add regex filtering for directory contents examples: xml: Fix 'pool-netfs.xml' example examples: xml: Fix 'vol-raw.xml' and 'vol-sparse.xml' virschematest: Add coverage for 'examples/xml/storage' virschematest: Add coverage for 'examples/xml/test' virschematest: Fix testing of 'nwfilter' xmls domainconfdata/getfilesystem.xml: Remove <init> element schema: nwfilter: Allow all accepted values for 'ipsetflags' schema: nwfiter: Allow leading/trailing whitespace in 'variable-name-type' nwfilterxml2firewall: Fix schema compilance of 'tcp' test case nwfilterxml2xmltest: Rename cases with XMLs not conforming to schema schema: domain: Add definition for the 'vmware' private namespace schema: domain: Allow space in XML schema for bridge source tests: vmx: Add <name> element for all domain XMLs virschematest: Add directories containing domain XMLs virschematest: Validate more XMLs virschematest: Validate schema in tests/cputestdata
docs/schemas/domaincommon.rng | 17 +- docs/schemas/nwfilter.rng | 4 +- examples/xml/storage/pool-netfs.xml | 2 +- examples/xml/storage/vol-raw.xml | 3 + examples/xml/storage/vol-sparse.xml | 3 + tests/domainconfdata/getfilesystem.xml | 1 - tests/nwfilterxml2firewalldata/tcp.xml | 2 +- ...ipv6-test.xml => ah-ipv6-test-invalid.xml} | 0 ...pv6-test.xml => all-ipv6-test-invalid.xml} | 0 .../{arp-test.xml => arp-test-invalid.xml} | 0 ...est1.xml => chain_prefixtest1-invalid.xml} | 0 ...ment-test.xml => comment-test-invalid.xml} | 0 ...pv6-test.xml => esp-ipv6-test-invalid.xml} | 0 ...ata-test.xml => hex-data-test-invalid.xml} | 0 .../{icmp-test.xml => icmp-test-invalid.xml} | 0 ...cmpv6-test.xml => icmpv6-test-invalid.xml} | 0 .../{ip-test.xml => ip-test-invalid.xml} | 0 .../{ipv6-test.xml => ipv6-test-invalid.xml} | 0 .../{mac-test.xml => mac-test-invalid.xml} | 0 .../{rarp-test.xml => rarp-test-invalid.xml} | 0 ...v6-test.xml => sctp-ipv6-test-invalid.xml} | 0 .../{sctp-test.xml => sctp-test-invalid.xml} | 0 ...pv6-test.xml => tcp-ipv6-test-invalid.xml} | 0 .../{tcp-test.xml => tcp-test-invalid.xml} | 0 ...pv6-test.xml => udp-ipv6-test-invalid.xml} | 0 .../{udp-test.xml => udp-test-invalid.xml} | 0 ...test.xml => udplite-ipv6-test-invalid.xml} | 0 .../{vlan-test.xml => vlan-test-invalid.xml} | 0 tests/nwfilterxml2xmltest.c | 44 +-- tests/virschematest.c | 371 ++++++++++++------ tests/vmx2xmldata/vmx2xml-annotation.vmx | 1 + tests/vmx2xmldata/vmx2xml-annotation.xml | 1 + .../vmx2xml-case-insensitive-1.vmx | 1 + .../vmx2xml-case-insensitive-2.vmx | 1 + .../vmx2xmldata/vmx2xml-cdrom-ide-device.vmx | 1 + .../vmx2xmldata/vmx2xml-cdrom-ide-device.xml | 1 + .../vmx2xmldata/vmx2xml-cdrom-ide-empty-2.vmx | 1 + .../vmx2xmldata/vmx2xml-cdrom-ide-empty-2.xml | 1 + tests/vmx2xmldata/vmx2xml-cdrom-ide-empty.vmx | 1 + tests/vmx2xmldata/vmx2xml-cdrom-ide-empty.xml | 1 + tests/vmx2xmldata/vmx2xml-cdrom-ide-file.vmx | 1 + tests/vmx2xmldata/vmx2xml-cdrom-ide-file.xml | 1 + .../vmx2xml-cdrom-ide-raw-auto-detect.vmx | 1 + .../vmx2xml-cdrom-ide-raw-auto-detect.xml | 1 + .../vmx2xml-cdrom-ide-raw-device.vmx | 1 + .../vmx2xml-cdrom-ide-raw-device.xml | 1 + .../vmx2xmldata/vmx2xml-cdrom-scsi-device.vmx | 1 + .../vmx2xmldata/vmx2xml-cdrom-scsi-device.xml | 1 + .../vmx2xmldata/vmx2xml-cdrom-scsi-empty.vmx | 1 + .../vmx2xmldata/vmx2xml-cdrom-scsi-empty.xml | 1 + tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.vmx | 1 + tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.xml | 1 + .../vmx2xml-cdrom-scsi-passthru.vmx | 1 + .../vmx2xml-cdrom-scsi-passthru.xml | 1 + .../vmx2xml-cdrom-scsi-raw-auto-detect.vmx | 1 + .../vmx2xml-cdrom-scsi-raw-auto-detect.xml | 1 + .../vmx2xml-cdrom-scsi-raw-device.vmx | 1 + .../vmx2xml-cdrom-scsi-raw-device.xml | 1 + tests/vmx2xmldata/vmx2xml-datacenterpath.vmx | 1 + tests/vmx2xmldata/vmx2xml-datacenterpath.xml | 1 + .../vmx2xmldata/vmx2xml-ethernet-bridged.vmx | 1 + .../vmx2xmldata/vmx2xml-ethernet-bridged.xml | 1 + tests/vmx2xmldata/vmx2xml-ethernet-custom.vmx | 1 + tests/vmx2xmldata/vmx2xml-ethernet-custom.xml | 1 + tests/vmx2xmldata/vmx2xml-ethernet-e1000.vmx | 1 + tests/vmx2xmldata/vmx2xml-ethernet-e1000.xml | 1 + .../vmx2xml-ethernet-generated.vmx | 1 + .../vmx2xml-ethernet-generated.xml | 1 + tests/vmx2xmldata/vmx2xml-ethernet-nat.vmx | 1 + tests/vmx2xmldata/vmx2xml-ethernet-nat.xml | 1 + tests/vmx2xmldata/vmx2xml-ethernet-other.vmx | 1 + tests/vmx2xmldata/vmx2xml-ethernet-other.xml | 1 + tests/vmx2xmldata/vmx2xml-ethernet-static.vmx | 1 + tests/vmx2xmldata/vmx2xml-ethernet-static.xml | 1 + .../vmx2xmldata/vmx2xml-ethernet-vmxnet2.vmx | 1 + .../vmx2xmldata/vmx2xml-ethernet-vmxnet2.xml | 1 + tests/vmx2xmldata/vmx2xml-ethernet-vpx.vmx | 1 + tests/vmx2xmldata/vmx2xml-ethernet-vpx.xml | 1 + tests/vmx2xmldata/vmx2xml-firmware-efi.vmx | 1 + tests/vmx2xmldata/vmx2xml-firmware-efi.xml | 1 + tests/vmx2xmldata/vmx2xml-floppy-device.vmx | 1 + tests/vmx2xmldata/vmx2xml-floppy-device.xml | 1 + tests/vmx2xmldata/vmx2xml-floppy-file.vmx | 1 + tests/vmx2xmldata/vmx2xml-floppy-file.xml | 1 + tests/vmx2xmldata/vmx2xml-graphics-vnc.vmx | 1 + tests/vmx2xmldata/vmx2xml-graphics-vnc.xml | 1 + .../vmx2xmldata/vmx2xml-harddisk-ide-file.vmx | 1 + .../vmx2xmldata/vmx2xml-harddisk-ide-file.xml | 1 + .../vmx2xml-harddisk-scsi-file.vmx | 1 + .../vmx2xml-harddisk-scsi-file.xml | 1 + .../vmx2xml-harddisk-transient.vmx | 1 + .../vmx2xml-harddisk-transient.xml | 1 + tests/vmx2xmldata/vmx2xml-minimal-64bit.vmx | 1 + tests/vmx2xmldata/vmx2xml-minimal-64bit.xml | 1 + tests/vmx2xmldata/vmx2xml-minimal.vmx | 1 + tests/vmx2xmldata/vmx2xml-minimal.xml | 1 + tests/vmx2xmldata/vmx2xml-parallel-device.vmx | 1 + tests/vmx2xmldata/vmx2xml-parallel-device.xml | 1 + tests/vmx2xmldata/vmx2xml-parallel-file.vmx | 1 + tests/vmx2xmldata/vmx2xml-parallel-file.xml | 1 + tests/vmx2xmldata/vmx2xml-scsi-driver.vmx | 1 + tests/vmx2xmldata/vmx2xml-scsi-driver.xml | 1 + .../vmx2xmldata/vmx2xml-scsi-writethrough.vmx | 1 + .../vmx2xmldata/vmx2xml-scsi-writethrough.xml | 1 + tests/vmx2xmldata/vmx2xml-serial-device.vmx | 1 + tests/vmx2xmldata/vmx2xml-serial-device.xml | 1 + tests/vmx2xmldata/vmx2xml-serial-file.vmx | 1 + tests/vmx2xmldata/vmx2xml-serial-file.xml | 1 + .../vmx2xml-serial-network-client.vmx | 1 + .../vmx2xml-serial-network-client.xml | 1 + .../vmx2xml-serial-network-server.vmx | 1 + .../vmx2xml-serial-network-server.xml | 1 + .../vmx2xml-serial-pipe-client-app.vmx | 1 + .../vmx2xml-serial-pipe-client-vm.vmx | 1 + .../vmx2xml-serial-pipe-server-app.vmx | 1 + .../vmx2xml-serial-pipe-server-vm.vmx | 1 + tests/vmx2xmldata/vmx2xml-serial-pipe.xml | 1 + tests/vmx2xmldata/vmx2xml-sharedfolder.vmx | 1 + tests/vmx2xmldata/vmx2xml-sharedfolder.xml | 1 + tests/vmx2xmldata/vmx2xml-smbios.vmx | 1 + tests/vmx2xmldata/vmx2xml-smbios.xml | 1 + tests/vmx2xmldata/vmx2xml-svga.vmx | 1 + tests/vmx2xmldata/vmx2xml-svga.xml | 1 + 123 files changed, 393 insertions(+), 147 deletions(-) rename tests/nwfilterxml2xmlin/{ah-ipv6-test.xml => ah-ipv6-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{all-ipv6-test.xml => all-ipv6-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{arp-test.xml => arp-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{chain_prefixtest1.xml => chain_prefixtest1-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{comment-test.xml => comment-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{esp-ipv6-test.xml => esp-ipv6-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{hex-data-test.xml => hex-data-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{icmp-test.xml => icmp-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{icmpv6-test.xml => icmpv6-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{ip-test.xml => ip-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{ipv6-test.xml => ipv6-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{mac-test.xml => mac-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{rarp-test.xml => rarp-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{sctp-ipv6-test.xml => sctp-ipv6-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{sctp-test.xml => sctp-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{tcp-ipv6-test.xml => tcp-ipv6-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{tcp-test.xml => tcp-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{udp-ipv6-test.xml => udp-ipv6-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{udp-test.xml => udp-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{udplite-ipv6-test.xml => udplite-ipv6-test-invalid.xml} (100%) rename tests/nwfilterxml2xmlin/{vlan-test.xml => vlan-test-invalid.xml} (100%)
Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Michal
participants (3)
-
Michal Prívozník
-
Peter Krempa
-
Pino Toscano