[Pkg-libvirt-commits] [libguestfs] 75/179: tests: v2v: Check -i ova generates the same XML each time.
Hilko Bengen
bengen at moszumanska.debian.org
Fri Oct 31 19:08:25 UTC 2014
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to branch experimental
in repository libguestfs.
commit 4511137c054416f407ff4e05c82ca6b9abc62d8a
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Wed Oct 15 21:23:33 2014 +0200
tests: v2v: Check -i ova generates the same XML each time.
---
v2v/Makefile.am | 1 +
v2v/test-v2v-i-ova.sh | 11 +++++++++--
v2v/test-v2v-i-ova.xml | 38 ++++++++++++++++++++++++++++++++++++++
3 files changed, 48 insertions(+), 2 deletions(-)
diff --git a/v2v/Makefile.am b/v2v/Makefile.am
index dafe27e..09760b7 100644
--- a/v2v/Makefile.am
+++ b/v2v/Makefile.am
@@ -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
diff --git a/v2v/test-v2v-i-ova.sh b/v2v/test-v2v-i-ova.sh
index a0e35a3..ec9f4de 100755
--- a/v2v/test-v2v-i-ova.sh
+++ b/v2v/test-v2v-i-ova.sh
@@ -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
diff --git a/v2v/test-v2v-i-ova.xml b/v2v/test-v2v-i-ova.xml
new file mode 100644
index 0000000..ff83285
--- /dev/null
+++ b/v2v/test-v2v-i-ova.xml
@@ -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>
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list