diff --git a/libvirt/tests/cfg/virt_cmd/virt_xml_validate.cfg b/libvirt/tests/cfg/virt_cmd/virt_xml_validate.cfg index 45a5228c81..138a45cbda 100644 --- a/libvirt/tests/cfg/virt_cmd/virt_xml_validate.cfg +++ b/libvirt/tests/cfg/virt_cmd/virt_xml_validate.cfg @@ -28,3 +28,5 @@ secret_volume = "/var/lib/libvirt/images/virt_xml_validate.secret" - interface: schema = "interface" + - domcapabilities: + schema = "domcapabilities" diff --git a/libvirt/tests/src/virt_cmd/virt_xml_validate.py b/libvirt/tests/src/virt_cmd/virt_xml_validate.py index f05e14eaee..2ec11a2e46 100644 --- a/libvirt/tests/src/virt_cmd/virt_xml_validate.py +++ b/libvirt/tests/src/virt_cmd/virt_xml_validate.py @@ -183,6 +183,16 @@ def interface_validate(test, file=None, **virsh_dargs): test.error(str(e)) +def domcap_validate(file=None, **virsh_dargs): + """ + Prepare schema domcapabilities. + :param file: domcapabilities output file + :param virsh_dargs: virsh debug args. + """ + cmd_result = virsh.domcapabilities(options="> %s" % file, **virsh_dargs) + libvirt.check_exit_status(cmd_result) + + def run(test, params, env): """ Test for virt-xml-validate @@ -203,7 +213,7 @@ def run(test, params, env): valid_schemas = ['domain', 'domainsnapshot', 'network', 'storagepool', 'storagevol', 'nodedev', 'capability', - 'nwfilter', 'secret', 'interface'] + 'nwfilter', 'secret', 'interface', 'domcapabilities'] if schema not in valid_schemas: test.fail("invalid %s specified" % schema) @@ -230,6 +240,9 @@ def run(test, params, env): secret_validate(test, secret_volume, file=output_path, **virsh_dargs) elif schema == "interface": interface_validate(test, file=output_path, **virsh_dargs) + elif schema == "domcapabilities": + domcap_validate(file=output_path, **virsh_dargs) + schema = "" else: # domain virsh.dumpxml(vm_name, to_file=output_path)