]> git.ipfire.org Git - thirdparty/libvirt.git/commit
schema: rewrite seclabel rng to match code
authorEric Blake <eblake@redhat.com>
Fri, 23 Dec 2011 00:47:46 +0000 (17:47 -0700)
committerDaniel Veillard <veillard@redhat.com>
Fri, 30 Dec 2011 02:38:37 +0000 (10:38 +0800)
commit116d6af9791cf535e7e4e501db54ad0266300be1
tree83778421b346120f99b9d74089c34c8c74c7ebb4
parentcbc7025942fa25048001ba1459a129495113cf06
schema: rewrite seclabel rng to match code

The RNG for <seclabel> was too strict - if it was present, then it
had to have sub-elements, even if those didn't make sense for the
given attributes.  Also, we didn't have any tests of <seclabel>
parsing or XML output.

In this patch, I added more parsing tests than output tests (since
the output populates and/or reorders fields not present in certain
inputs).  Making the RNG reliable is a precursor to using <seclabel>
variants in more places in the XML in later patches.

See also:
http://berrange.com/posts/2011/09/29/two-small-improvements-to-svirt-guest-configuration-flexibility-with-kvmlibvirt/

* docs/schemas/domaincommon.rng (seclabel): Tighten rules.
* tests/qemuxml2argvtest.c (mymain): New tests.
* tests/qemuxml2xmltest.c (mymain): Likewise.
* tests/qemuxml2argvdata/qemuxml2argv-seclabel-*.*: New files.
docs/schemas/domaincommon.rng
tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-baselabel.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-baselabel.xml [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic.xml [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-seclabel-static-relabel.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-seclabel-static-relabel.xml [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-seclabel-static.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-seclabel-static.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c
tests/qemuxml2xmltest.c