From 4511137c054416f407ff4e05c82ca6b9abc62d8a Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 15 Oct 2014 21:23:33 +0200 Subject: [PATCH] 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(-) create mode 100644 v2v/test-v2v-i-ova.xml diff --git a/v2v/Makefile.am b/v2v/Makefile.am index dafe27e02..09760b7b5 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 a0e35a387..ec9f4de8d 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 000000000..ff832859b --- /dev/null +++ b/v2v/test-v2v-i-ova.xml @@ -0,0 +1,38 @@ + + + TestOva + 2097152 + 2097152 + 1 + + hvm + + + destroy + restart + restart + + + + + + + + + + + + + + + + + + + +