tests: v2v: Check -i ova generates the same XML each time.

This commit is contained in:
Richard W.M. Jones
2014-10-15 21:23:33 +02:00
parent 717c73d22b
commit 4511137c05
3 changed files with 48 additions and 2 deletions

View File

@@ -22,6 +22,7 @@ EXTRA_DIST = \
$(TESTS) $(SLOW_TESTS) \
HACKING README.RHEV-M \
test-v2v-i-ova.ovf \
test-v2v-i-ova.xml \
test-v2v-networks-and-bridges-expected.xml \
test-v2v-networks-and-bridges.xml.in \
virt-v2v.pod

View File

@@ -52,7 +52,6 @@ vmdk=test-ova.vmdk
ovf=test-v2v-i-ova.ovf
mf=test-ova.mf
ova=test-ova.ova
xml=TestOva.xml
raw=TestOva-sda
qemu-img convert $f -O vmdk $d/$vmdk
@@ -74,6 +73,14 @@ $VG virt-v2v --debug-gc \
# Test the libvirt XML metadata and a disk was created.
test -f $d/$raw
test -f $d/$xml
test -f $d/TestOva.xml
# Normalize the XML output.
mv $d/TestOva.xml $d/TestOva.xml.old
sed "s,source file='.*TestOva-sda',source file='TestOva-sda'," \
< $d/TestOva.xml.old > $d/TestOva.xml
# Check the libvirt XML output.
diff -u test-v2v-i-ova.xml $d/TestOva.xml
rm -rf $d

38
v2v/test-v2v-i-ova.xml Normal file
View File

@@ -0,0 +1,38 @@
<?xml version='1.0' encoding='utf-8'?>
<domain type='kvm'>
<name>TestOva</name>
<memory unit='KiB'>2097152</memory>
<currentMemory unit='KiB'>2097152</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='x86_64'>hvm</type>
</os>
<features/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='none'/>
<source file='TestOva-sda'/>
<target dev='vda' bus='virtio'/>
</disk>
<disk device='cdrom' type='file'>
<driver name='qemu' type='raw'/>
<target dev='hda' bus='ide'/>
</disk>
<disk device='floppy' type='file'>
<driver name='qemu' type='raw'/>
<target dev='fda' bus='fdc'/>
</disk>
<interface type='network'>
<source network='Ethernet 1'/>
<model type='virtio'/>
</interface>
<video type='qxl' ram='65536' heads='1'/>
<graphics type='vnc' autoport='yes'/>
<input type='tablet' bus='usb'/>
<input type='mouse' bus='ps2'/>
<console type='pty'/>
</devices>
</domain>