[Libguestfs] [PATCH 3/3] v2v: test-v2v-conversion-of.sh: basic check for libvirt XML

Pino Toscano ptoscano at redhat.com
Tue Mar 26 13:24:16 UTC 2019


Use virt-xml-validate to check that the libvirt XML is actually valid,
at least regarding its schema.
---
 v2v/test-v2v-conversion-of.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/v2v/test-v2v-conversion-of.sh b/v2v/test-v2v-conversion-of.sh
index 48d7ce88d..c9a595b34 100755
--- a/v2v/test-v2v-conversion-of.sh
+++ b/v2v/test-v2v-conversion-of.sh
@@ -81,10 +81,13 @@ EOF
 virt-v2v --debug-gc -i libvirtxml "$xml" -o local -os "$os"
 
 # Test the libvirt XML metadata and a disk was created.
-# XXX We should check the XML.
 test -f "$os/$guestname.xml"
 test -f "$os/$guestname-sda"
 
+# Test the libvirt XML is valid.
+# XXX This does not check bits depending on the QEMU version.
+virt-xml-validate "$os/$guestname.xml"
+
 # Test the disk has a similar size to the original.
 size_before="$(du $disk | awk '{print $1}')"
 size_after="$(du $os/$guestname-sda | awk '{print $1}')"
-- 
2.20.1




More information about the Libguestfs mailing list