Domain snapshot RNG and tests.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
This commit is contained in:
Chris Lalancette 2010-05-03 17:15:18 -04:00
parent 8749256d0b
commit 54971d9170
11 changed files with 114 additions and 1 deletions

View File

@ -0,0 +1,53 @@
<!-- A Relax NG schema for the libvirt domain snapshot properties XML format -->
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
<start>
<ref name='domainsnapshot'/>
</start>
<define name='domainsnapshot'>
<element name='domainsnapshot'>
<interleave>
<optional>
<element name='name'>
<text/>
</element>
</optional>
<optional>
<element name='description'>
<text/>
</element>
</optional>
<optional>
<element name='state'>
<text/>
</element>
</optional>
<optional>
<element name='creationTime'>
<text/>
</element>
</optional>
<optional>
<element name='active'>
<text/>
</element>
</optional>
<optional>
<element name='domain'>
<element name='uuid'>
<text/>
</element>
</element>
</optional>
<optional>
<element name='parent'>
<element name='name'>
<text/>
</element>
</element>
</optional>
</interleave>
</element>
</define>
</grammar>

View File

@ -76,6 +76,9 @@ EXTRA_DIST = \
nwfilterxml2xmlout \
nwfilterxml2xmlin \
nwfilterschematest \
domainsnapshotschematest \
domainsnapshotxml2xmlout \
domainsnapshotxml2xmlin \
$(patsubst %,qemuhelpdata/%,$(qemuhelpdata))
noinst_PROGRAMS = virshtest conftest \
@ -123,7 +126,8 @@ test_scripts = \
storagevolschematest \
domainschematest \
nodedevschematest \
nwfilterschematest
nwfilterschematest \
domainsnapshotschematest
if WITH_LIBVIRTD
test_scripts += \

10
tests/domainsnapshotschematest Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
: ${srcdir=.}
. $srcdir/test-lib.sh
. $abs_srcdir/schematestutils.sh
DIRS="domainsnapshotxml2xmlin domainsnapshotxml2xmlout"
SCHEMA="domainsnapshot.rng"
check_schema "$DIRS" "$SCHEMA"

View File

@ -0,0 +1,3 @@
<domainsnapshot>
<description>My description</description>
</domainsnapshot>

View File

@ -0,0 +1 @@
<domainsnapshot/>

View File

@ -0,0 +1,4 @@
<domainsnapshot>
<name>snap1</name>
<description>A longer description!</description>
</domainsnapshot>

View File

@ -0,0 +1,3 @@
<domainsnapshot>
<name>snapshot1</name>
</domainsnapshot>

View File

@ -0,0 +1,13 @@
<domainsnapshot>
<name>my snap name</name>
<description>!@#$%^</description>
<parent>
<name>earlier_snap</name>
</parent>
<state>running</state>
<creationTime>1272917631</creationTime>
<domain>
<uuid>9d37b878-a7cc-9f9a-b78f-49b3abad25a8</uuid>
</domain>
<active>1</active>
</domainsnapshot>

View File

@ -0,0 +1,9 @@
<domainsnapshot>
<name>my snap name</name>
<description>!@#$%^</description>
<state>running</state>
<creationTime>1272917631</creationTime>
<domain>
<uuid>9d37b878-a7cc-9f9a-b78f-49b3abad25a8</uuid>
</domain>
</domainsnapshot>

View File

@ -0,0 +1,7 @@
<domainsnapshot>
<name>my snap name</name>
<description>!@#$%^</description>
<state>running</state>
<creationTime>1272917631</creationTime>
<active>1</active>
</domainsnapshot>

View File

@ -0,0 +1,6 @@
<domainsnapshot>
<name>my snap name</name>
<description>!@#$%^</description>
<state>running</state>
<creationTime>1272917631</creationTime>
</domainsnapshot>