python: Fix regression test so it works when KVM is not available.

The test assumed (for no particular reason) that it could always run a
KVM guest.  When run on a machine without KVM, or in a VM without
nested KVM, you get this error:

libvirt: Domain Config error : internal error: no supported architecture for os type 'hvm'
Traceback (most recent call last):
  File "./t/820-rhbz912499.py", line 77, in <module>
    dom = conn.createXML (xml, libvirt.VIR_DOMAIN_START_AUTODESTROY)
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 3523, in createXML
    if ret is None:raise libvirtError('virDomainCreateXML() failed', conn=self)
libvirt.libvirtError: internal error: no supported architecture for os type 'hvm'
FAIL: ./t/820-rhbz912499.py

Use a qemu guest instead, which should have a better chance of working
on all hosts.
This commit is contained in:
Richard W.M. Jones
2014-12-16 13:16:07 +00:00
parent 974216f612
commit 8e0fc5fb46

View File

@@ -56,7 +56,7 @@ domname = ''.join (random.choice (string.ascii_uppercase) for _ in range (8))
domname = "tmp-" + domname
xml = """
<domain type='kvm'>
<domain type='qemu'>
<name>%s</name>
<memory>1048576</memory>
<vcpu>1</vcpu>