Skip to content

Commit

Permalink
tests: Add storage volume XML 2 XML tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
crobinso committed Oct 16, 2009
1 parent 6d8331f commit caf8e91
Show file tree
Hide file tree
Showing 16 changed files with 343 additions and 9 deletions.
1 change: 1 addition & 0 deletions tests/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ qemuhelptest
networkxml2xmltest
nodedevxml2xmltest
interfacexml2xmltest
storagevolxml2xmltest
storagepoolxml2xmltest
nodeinfotest
statstest
Expand Down
12 changes: 9 additions & 3 deletions tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ EXTRA_DIST = \
storagepoolxml2xmlout \
storagepoolxml2xmlin \
storagevolschematest \
storagevolschemadata \
storagevolxml2xmlout \
storagevolxml2xmlin \
nodedevschematest \
nodedevschemadata \
$(patsubst %,qemuhelpdata/%,$(qemuhelpdata))
Expand Down Expand Up @@ -99,7 +100,7 @@ endif

noinst_PROGRAMS += networkxml2xmltest

noinst_PROGRAMS += storagepoolxml2xmltest
noinst_PROGRAMS += storagevolxml2xmltest storagepoolxml2xmltest

noinst_PROGRAMS += nodedevxml2xmltest

Expand Down Expand Up @@ -176,7 +177,7 @@ endif

TESTS += networkxml2xmltest

TESTS += storagepoolxml2xmltest
TESTS += storagevolxml2xmltest storagepoolxml2xmltest

TESTS += nodedevxml2xmltest

Expand Down Expand Up @@ -279,6 +280,11 @@ networkxml2xmltest_SOURCES = \
testutils.c testutils.h
networkxml2xmltest_LDADD = $(LDADDS)

storagevolxml2xmltest_SOURCES = \
storagevolxml2xmltest.c \
testutils.c testutils.h
storagevolxml2xmltest_LDADD = $(LDADDS)

storagepoolxml2xmltest_SOURCES = \
storagepoolxml2xmltest.c \
testutils.c testutils.h
Expand Down
3 changes: 1 addition & 2 deletions tests/storagevolschematest
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

source ./schematestutils.sh

DIRS="storagevolschemadata"
DIRS="storagevolxml2xmlin storagevolxml2xmlout"
SCHEMA="storagevol.rng"

check_schema "$DIRS" "$SCHEMA"

24 changes: 24 additions & 0 deletions tests/storagevolxml2xmlin/vol-file-backing.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<volume>
<name>sparse.img</name>
<source/>
<capacity>10000000000</capacity>
<allocation>0</allocation>
<target>
<path>/var/lib/libvirt/images/sparse.img</path>
<permissions>
<mode>0</mode>
<owner>0744</owner>
<group>0</group>
</permissions>
</target>
<backingStore>
<path>/var/lib/virt/images/master.img</path>
<format type='vmdk'/>
<permissions>
<mode>0744</mode>
<owner>1</owner>
<group>1</group>
<label>virt_image_t</label>
</permissions>
</backingStore>
</volume>
15 changes: 15 additions & 0 deletions tests/storagevolxml2xmlin/vol-file.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<volume>
<name>sparse.img</name>
<source/>
<capacity unit="T">1</capacity>
<allocation>0</allocation>
<target>
<path>/var/lib/libvirt/images/sparse.img</path>
<permissions>
<mode>0</mode>
<owner>0744</owner>
<group>0</group>
<label>virt_image_t</label>
</permissions>
</target>
</volume>
29 changes: 29 additions & 0 deletions tests/storagevolxml2xmlin/vol-logical-backing.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<volume>
<name>Swap</name>
<key>r4xkCv-MQhr-WKIT-R66x-Epn2-e8hG-1Z5gY0</key>
<source>
<device path='/dev/sda2'>
<extent start='31440502784' end='33520877568'/>
</device>
</source>
<capacity>2080374784</capacity>
<allocation>2080374784</allocation>
<target>
<path>/dev/HostVG/Swap</path>
<permissions>
<mode>0660</mode>
<owner>0</owner>
<group>6</group>
<label>system_u:object_r:fixed_disk_device_t:s0</label>
</permissions>
</target>
<backingStore>
<path>/dev/HostVG/snapshot</path>
<permissions>
<mode>0744</mode>
<owner>1</owner>
<group>1</group>
<label>virt_image_t</label>
</permissions>
</backingStore>
</volume>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<target>
<path>/dev/HostVG/Swap</path>
<permissions>
<mode>060660</mode>
<mode>0660</mode>
<owner>0</owner>
<group>6</group>
<label>system_u:object_r:fixed_disk_device_t:s0</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<path>/dev/sda1</path>
<format type='none'/>
<permissions>
<mode>060660</mode>
<mode>0660</mode>
<owner>0</owner>
<group>6</group>
<label>system_u:object_r:fixed_disk_device_t:s0</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<path>/var/lib/libvirt/images/OtherDemo.img</path>
<format type='qcow2'/>
<permissions>
<mode>0100644</mode>
<mode>0644</mode>
<owner>0</owner>
<group>0</group>
<label>unconfined_u:object_r:virt_image_t:s0</label>
Expand All @@ -22,7 +22,7 @@
<path>/var/lib/libvirt/images/BaseDemo.img</path>
<format type='raw'/>
<permissions>
<mode>0100644</mode>
<mode>0644</mode>
<owner>0</owner>
<group>0</group>
<label>unconfined_u:object_r:virt_image_t:s0</label>
Expand Down
27 changes: 27 additions & 0 deletions tests/storagevolxml2xmlout/vol-file-backing.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<volume>
<name>sparse.img</name>
<key>(null)</key>
<source>
</source>
<capacity>10000000000</capacity>
<allocation>0</allocation>
<target>
<path>/var/lib/libvirt/images/sparse.img</path>
<format type='raw'/>
<permissions>
<mode>00</mode>
<owner>744</owner>
<group>0</group>
</permissions>
</target>
<backingStore>
<path>/var/lib/virt/images/master.img</path>
<format type='vmdk'/>
<permissions>
<mode>0744</mode>
<owner>1</owner>
<group>1</group>
<label>virt_image_t</label>
</permissions>
</backingStore>
</volume>
18 changes: 18 additions & 0 deletions tests/storagevolxml2xmlout/vol-file.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<volume>
<name>sparse.img</name>
<key>(null)</key>
<source>
</source>
<capacity>1099511627776</capacity>
<allocation>0</allocation>
<target>
<path>/var/lib/libvirt/images/sparse.img</path>
<format type='raw'/>
<permissions>
<mode>00</mode>
<owner>744</owner>
<group>0</group>
<label>virt_image_t</label>
</permissions>
</target>
</volume>
26 changes: 26 additions & 0 deletions tests/storagevolxml2xmlout/vol-logical-backing.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<volume>
<name>Swap</name>
<key>(null)</key>
<source>
</source>
<capacity>2080374784</capacity>
<allocation>2080374784</allocation>
<target>
<path>/dev/HostVG/Swap</path>
<permissions>
<mode>0660</mode>
<owner>0</owner>
<group>6</group>
<label>system_u:object_r:fixed_disk_device_t:s0</label>
</permissions>
</target>
<backingStore>
<path>/dev/HostVG/snapshot</path>
<permissions>
<mode>0744</mode>
<owner>1</owner>
<group>1</group>
<label>virt_image_t</label>
</permissions>
</backingStore>
</volume>
17 changes: 17 additions & 0 deletions tests/storagevolxml2xmlout/vol-logical.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<volume>
<name>Swap</name>
<key>(null)</key>
<source>
</source>
<capacity>2080374784</capacity>
<allocation>2080374784</allocation>
<target>
<path>/dev/HostVG/Swap</path>
<permissions>
<mode>0660</mode>
<owner>0</owner>
<group>6</group>
<label>system_u:object_r:fixed_disk_device_t:s0</label>
</permissions>
</target>
</volume>
18 changes: 18 additions & 0 deletions tests/storagevolxml2xmlout/vol-partition.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<volume>
<name>sda1</name>
<key>(null)</key>
<source>
</source>
<capacity>106896384</capacity>
<allocation>106896384</allocation>
<target>
<path>/dev/sda1</path>
<format type='none'/>
<permissions>
<mode>0660</mode>
<owner>0</owner>
<group>6</group>
<label>system_u:object_r:fixed_disk_device_t:s0</label>
</permissions>
</target>
</volume>
31 changes: 31 additions & 0 deletions tests/storagevolxml2xmlout/vol-qcow2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<volume>
<name>OtherDemo.img</name>
<key>(null)</key>
<source>
</source>
<capacity>5368709120</capacity>
<allocation>294912</allocation>
<target>
<path>/var/lib/libvirt/images/OtherDemo.img</path>
<format type='qcow2'/>
<permissions>
<mode>0644</mode>
<owner>0</owner>
<group>0</group>
<label>unconfined_u:object_r:virt_image_t:s0</label>
</permissions>
<encryption format='qcow'>
<secret type='passphrase' uuid='e78d4b51-a2af-485f-b0f5-afca709a80f4'/>
</encryption>
</target>
<backingStore>
<path>/var/lib/libvirt/images/BaseDemo.img</path>
<format type='raw'/>
<permissions>
<mode>0644</mode>
<owner>0</owner>
<group>0</group>
<label>unconfined_u:object_r:virt_image_t:s0</label>
</permissions>
</backingStore>
</volume>
Loading

0 comments on commit caf8e91

Please sign in to comment.