tests: Create a smaller testsuite.xml

Right now, most test cases will create a libvirt test driver using
tests/testdriver.xml. This is problematic for 2 reasons:

1) testdriver.xml is 3500 lines of XML, and it's parsed hundreds of
   times. Opening it is responsible for about 25% of test suite time
2) Older libvirt chokes on testdriver.xml, meaning the test suite will
   be useless there. This is a recurring problem as new features are
   added to testdriver.xml

Most test cases don't actually need all the test state in testdriver.xml
though. So this creates a smaller testsuite.xml which has a lower
libvirt requirement and is much quicker to parse. New XML bits should
continue to go into testdriver.xml so we can keep testsuite.xml as
the more stripped down option.
This commit is contained in:
Cole Robinson 2018-02-20 15:00:46 -05:00
parent 47afa912b3
commit 62fecb09d3
6 changed files with 582 additions and 243 deletions

View File

@ -1,9 +1,10 @@
<panic>
<address type="isa" iobase="0x505"/>
</panic>
+ <hostdev mode="subsystem" type="pci" managed="yes">
+ <hostdev mode="subsystem" type="usb" managed="yes">
+ <source>
+ <address domain="0" bus="0" slot="25" function="0"/>
+ <vendor id="0x04b3"/>
+ <product id="0x4485"/>
+ </source>
+ </hostdev>
</devices>

View File

@ -1,10 +1,5 @@
</video>
<hostdev mode="subsystem" type="usb" managed="yes">
<source>
- <vendor id="0x04b3"/>
- <product id="0x4485"/>
+ <vendor id="0x0781"/>
+ <product id="0x5151"/>
<vendor id="0x04b3"/>
<product id="0x4485"/>
</source>
+ <driver name="vfio"/>
</hostdev>

View File

@ -68,7 +68,8 @@ clean_files = (new_images + exist_images)
test_files = {
'URI-TEST': utils.uri_test,
'URI-TEST-DEFAULT': utils.uri_test_default,
'URI-TEST-FULL': utils.uri_test_full,
'URI-TEST-SUITE': utils.uri_test_suite,
'URI-TEST-REMOTE': utils.uri_test_remote,
'URI-KVM': utils.uri_kvm,
'URI-KVM-Q35': utils.uri_kvm_q35,
@ -295,10 +296,12 @@ class _CategoryProxy(object):
class App(object):
def __init__(self, appname):
def __init__(self, appname, uri=None, compare_check=None):
self.appname = appname
self.categories = {}
self.cmds = []
self.compare_check = compare_check
self.uri = uri
def _default_args(self, cli, iscompare, auto_printarg):
args = ""
@ -306,7 +309,8 @@ class App(object):
args = "--debug"
if "--connect " not in cli:
args += " --connect %(URI-TEST)s"
uri = self.uri or "%(URI-TEST-SUITE)s"
args += " --connect %s" % uri
if self.appname in ["virt-install"]:
if "--name " not in cli:
@ -351,7 +355,9 @@ class App(object):
compfile = os.path.basename(self.appname) + "-" + compfile
cmd.compare_file = "%s/%s.xml" % (compare_xmldir, compfile)
cmd.skip_check = skip_check or category.skip_check
cmd.compare_check = compare_check or category.compare_check
cmd.compare_check = (compare_check or
category.compare_check or
self.compare_check)
cmd.input_file = input_file
self.cmds.append(cmd)
@ -654,12 +660,12 @@ c.add_invalid("--disk path=/dev/foo/bar/baz,format=qcow2,size=.0000001") # Unma
c.add_invalid("--disk path=%(MANAGEDDISKNEW1)s,format=raw,size=.0000001") # Managed disk using any format
c.add_invalid("--disk %(NEWIMG1)s") # Not specifying path= and non existent storage w/ no size
c.add_invalid("--disk %(NEWIMG1)s,sparse=true,size=100000000000") # Fail if fully allocated file would exceed disk space
c.add_invalid("--disk %(COLLIDE)s") # Colliding storage without --force
c.add_invalid("--disk %(COLLIDE)s --prompt") # Colliding storage with --prompt should still fail
c.add_invalid("--disk /dev/default-pool/backingl3.img") # Colliding storage via backing store
c.add_invalid("--connect %(URI-TEST-FULL)s --disk %(COLLIDE)s") # Colliding storage without --force
c.add_invalid("--connect %(URI-TEST-FULL)s --disk %(COLLIDE)s --prompt") # Colliding storage with --prompt should still fail
c.add_invalid("--connect %(URI-TEST-FULL)s --disk /dev/default-pool/backingl3.img") # Colliding storage via backing store
c.add_invalid("--disk %(DIR)s,device=cdrom") # Dir without floppy
c.add_invalid("--disk %(EXISTIMG1)s,driver_name=foobar,driver_type=foobaz") # Unknown driver name and type options (as of 1.0.0)
c.add_invalid("--disk source_pool=rbd-ceph,source_volume=vol1") # Collision with existing VM, via source pool/volume
c.add_invalid("--connect %(URI-TEST-FULL)s --disk source_pool=rbd-ceph,source_volume=vol1") # Collision with existing VM, via source pool/volume
c.add_invalid("--disk source_pool=default-pool,source_volume=idontexist") # trying to lookup non-existent volume, hit specific error code
c.add_invalid("--disk size=1 --security model=foo,type=bar") # Libvirt will error on the invalid security params, which should trigger the code path to clean up the disk images we created.
@ -685,8 +691,8 @@ c.add_compare("--panic default", "panic-s390x-default")
################################################
c = vinst.add_category("invalid-devices", "--noautoconsole --nodisks --pxe")
c.add_invalid("--host-device 1d6b:2") # multiple USB devices with identical vendorId and productId
c.add_invalid("--host-device pci_8086_2850_scsi_host_scsi_host") # Unsupported hostdev type
c.add_invalid("--connect %(URI-TEST-FULL)s --host-device 1d6b:2") # multiple USB devices with identical vendorId and productId
c.add_invalid("--connect %(URI-TEST-FULL)s --host-device pci_8086_2850_scsi_host_scsi_host") # Unsupported hostdev type
c.add_invalid("--host-device foobarhostdev") # Unknown hostdev
c.add_invalid("--host-device 300:400") # Parseable hostdev, but unknown digits
c.add_invalid("--graphics vnc,keymap=ZZZ") # Invalid keymap
@ -879,7 +885,7 @@ c.add_invalid("--graphics vnc --vnclisten 1.2.3.4") # mixing old and new
c.add_invalid("--network=FOO") # Nonexistent network
c.add_invalid("--mac 1234") # Invalid mac
c.add_invalid("--network user --bridge foo0") # Mixing bridge and network
c.add_invalid("--mac 22:22:33:12:34:AB") # Colliding macaddr
c.add_invalid("--connect %(URI-TEST-FULL)s --mac 22:22:33:12:34:AB") # Colliding macaddr
c = vinst.add_category("storage-back-compat", "--pxe --noautoconsole")
c.add_valid("--file %(EXISTIMG1)s --nonsparse --file-size 4") # Existing file, other opts
@ -899,7 +905,7 @@ c.add_valid("--nographics --transient") # --transient handling
# virt-xml tests #
##################
vixml = App("virt-xml")
vixml = App("virt-xml", compare_check="1.2.2") # compare_check for input type=keyboard output change
c = vixml.add_category("misc", "")
c.add_valid("--help") # basic --help test
c.add_valid("--sound=? --tpm=?") # basic introspection test
@ -908,7 +914,7 @@ c.add_invalid("test --edit --cpu host-passthrough --boot hd,network") # Specifi
c.add_invalid("test --edit") # specified no edit option
c.add_invalid("test --edit 2 --cpu host-passthrough") # specifing --edit number where it doesn't make sense
c.add_invalid("test-for-virtxml --edit 5 --tpm /dev/tpm") # device edit out of range
c.add_invalid("test-for-virtxml --add-device --host-device 0x0781:0x5151 --update") # test driver doesn't support attachdevice...
c.add_invalid("test-for-virtxml --add-device --host-device 0x04b3:0x4485 --update") # test driver doesn't support attachdevice...
c.add_invalid("test-for-virtxml --remove-device --host-device 1 --update") # test driver doesn't support detachdevice...
c.add_invalid("test-for-virtxml --edit --graphics password=foo --update") # test driver doesn't support updatdevice...
c.add_invalid("--build-xml --memory 10,maxmemory=20") # building XML for option that doesn't support it
@ -923,7 +929,7 @@ c.add_compare("--confirm test --edit --cpu host-passthrough", "prompt-response")
c.add_compare("--edit --print-diff --qemu-commandline clearxml=yes", "edit-clearxml-qemu-commandline", input_file=(xmldir + "/virtxml-qemu-commandline-clear.xml"))
c = vixml.add_category("simple edit diff", "test-for-virtxml --edit --print-diff --define", compare_check="1.2.2") # compare_check=input type=keyboard output
c = vixml.add_category("simple edit diff", "test-for-virtxml --edit --print-diff --define")
c.add_compare("""--metadata name=foo-my-new-name,uuid=12345678-12F4-1234-1234-123456789AFA,description="hey this is my
new
very,very=new desc\\\'",title="This is my,funky=new title" """, "edit-simple-metadata")
@ -960,9 +966,9 @@ c.add_compare("--console name=foo.bar.baz", "edit-simple-console")
c.add_compare("--filesystem /1/2/3,/4/5/6,mode=mapped", "edit-simple-filesystem")
c.add_compare("--video cirrus", "edit-simple-video", compare_check="1.3.3") # compare_check=video primary= attribute
c.add_compare("--sound pcspk", "edit-simple-soundhw", compare_check="1.3.5") # compare_check=new graphics listen output
c.add_compare("--host-device 0x0781:0x5151,driver_name=vfio", "edit-simple-host-device")
c.add_compare("--host-device 0x04b3:0x4485,driver_name=vfio", "edit-simple-host-device")
c = vixml.add_category("edit selection", "test-for-virtxml --print-diff --define", compare_check="1.2.2") # compare_check=input type=keyboard output
c = vixml.add_category("edit selection", "test-for-virtxml --print-diff --define")
c.add_invalid("--edit target=vvv --disk /dev/null") # no match found
c.add_invalid("--edit seclabel2.model=dac --disk /dev/null") # no match found
c.add_valid("--edit seclabel.model=dac --disk /dev/null") # match found
@ -974,7 +980,7 @@ c.add_compare("--edit target=hda --disk /dev/null", "edit-select-disk-target")
c.add_compare("--edit /tmp/foobar2 --disk shareable=off,readonly=on", "edit-select-disk-path")
c.add_compare("--edit mac=00:11:7f:33:44:55 --network target=nic55", "edit-select-network-mac")
c = vixml.add_category("edit clear", "test-for-virtxml --print-diff --define", compare_check="1.2.2") # compare_check=input type=keyboard output
c = vixml.add_category("edit clear", "test-for-virtxml --print-diff --define")
c.add_invalid("--edit --memory 200,clearxml=yes") # clear isn't wired up for memory
c.add_compare("--edit --disk path=/foo/bar,size=2,target=fda,bus=fdc,device=floppy,clearxml=yes", "edit-clear-disk")
c.add_compare("--edit --cpu host-passthrough,clearxml=yes", "edit-clear-cpu")
@ -982,11 +988,11 @@ c.add_compare("--edit --clock offset=utc,clearxml=yes", "edit-clear-clock")
c.add_compare("--edit --video clearxml=yes,model=virtio,accel3d=yes", "edit-video-virtio")
c.add_compare("--edit --graphics clearxml=yes,type=spice,gl=on,listen=none", "edit-graphics-spice-gl", compare_check="2.0.0") # compare_check=graphics listen=none support
c = vixml.add_category("add/rm devices", "test-for-virtxml --print-diff --define", compare_check="1.2.2") # compare_check=input type=keyboard output
c = vixml.add_category("add/rm devices", "test-for-virtxml --print-diff --define")
c.add_valid("--add-device --security model=dac") # --add-device works for seclabel
c.add_invalid("--add-device --pm suspend_to_disk=yes") # --add-device without a device
c.add_invalid("--remove-device --clock utc") # --remove-device without a dev
c.add_compare("--add-device --host-device net_00_1c_25_10_b1_e4", "add-host-device")
c.add_compare("--add-device --host-device usb_device_4b3_4485_noserial", "add-host-device")
c.add_compare("--add-device --sound pcspk", "add-sound")
c.add_compare("--add-device --disk %(EXISTIMG1)s,bus=virtio,target=vdf", "add-disk-basic")
c.add_compare("--add-device --disk %(EXISTIMG1)s", "add-disk-notarget") # filling in acceptable target
@ -1013,16 +1019,16 @@ c.add_invalid("--original-xml %(CLONE_DISK_XML)s --auto-clone") # Auto flag w/
c = vclon.add_category("misc", "")
c.add_compare("--connect %(URI-KVM)s -o test-clone --auto-clone --clone-running", "clone-auto1", compare_check="1.2.15")
c.add_compare("-o test-clone-simple --name newvm --auto-clone --clone-running", "clone-auto2", compare_check="1.2.15")
c.add_compare("--connect %(URI-TEST-FULL)s -o test-clone-simple --name newvm --auto-clone --clone-running", "clone-auto2", compare_check="1.2.15")
c.add_valid("-o test --auto-clone") # Auto flag, no storage
c.add_valid("--original-xml %(CLONE_STORAGE_XML)s --auto-clone") # Auto flag w/ managed storage
c.add_valid("--original-xml %(CLONE_DISK_XML)s --auto-clone") # Auto flag w/ local storage
c.add_valid("-o test-clone --auto-clone --clone-running") # Auto flag, actual VM, skip state check
c.add_valid("-o test-clone-simple -n newvm --preserve-data --file %(EXISTIMG1)s") # Preserve data shouldn't complain about existing volume
c.add_valid("--connect %(URI-TEST-FULL)s -o test-clone --auto-clone --clone-running") # Auto flag, actual VM, skip state check
c.add_valid("--connect %(URI-TEST-FULL)s -o test-clone-simple -n newvm --preserve-data --file %(EXISTIMG1)s") # Preserve data shouldn't complain about existing volume
c.add_valid("-n clonetest --original-xml %(CLONE_DISK_XML)s --file %(EXISTIMG3)s --file %(EXISTIMG4)s --check path_exists=off") # Skip existing file check
c.add_invalid("--auto-clone") # Just the auto flag
c.add_invalid("-o test-many-devices --auto-clone") # VM is running, but --clone-running isn't passed
c.add_invalid("-o test-clone-simple -n newvm --file %(EXISTIMG1)s --clone-running") # Should complain about overwriting existing file
c.add_invalid("--connect %(URI-TEST-FULL)s -o test-many-devices --auto-clone") # VM is running, but --clone-running isn't passed
c.add_invalid("--connect %(URI-TEST-FULL)s -o test-clone-simple -n newvm --file %(EXISTIMG1)s --clone-running") # Should complain about overwriting existing file
c = vclon.add_category("general", "-n clonetest")
@ -1035,7 +1041,7 @@ c.add_valid("--original-xml %(CLONE_DISK_XML)s --file %(NEWCLONEIMG1)s --file %(
c.add_valid("--original-xml %(CLONE_DISK_XML)s --file %(NEWCLONEIMG1)s --file %(NEWCLONEIMG2)s --force-copy=fda") # XML w/ disks, force copy a target with no media
c.add_valid("--original-xml %(CLONE_STORAGE_XML)s --file %(MANAGEDNEW1)s") # XML w/ managed storage, specify managed path
c.add_valid("--original-xml %(CLONE_NOEXIST_XML)s --file %(EXISTIMG1)s --preserve") # XML w/ managed storage, specify managed path across pools# Libvirt test driver doesn't support cloning across pools# XML w/ non-existent storage, with --preserve
c.add_valid("-o test -n test-clone --auto-clone --replace") # Overwriting existing VM
c.add_valid("--connect %(URI-TEST-FULL)s -o test -n test-clone --auto-clone --replace") # Overwriting existing VM
c.add_invalid("-o test foobar") # Positional arguments error
c.add_invalid("-o idontexist") # Non-existent vm name
c.add_invalid("-o idontexist --auto-clone") # Non-existent vm name with auto flag,

View File

@ -54,214 +54,6 @@
</os>
</domain>
<domain type='test'>
<name>test-for-virtxml</name>
<currentMemory>204800</currentMemory>
<memory>409600</memory>
<blkiotune>
<weight>100</weight>
<device>
<path>/dev/sdd</path>
<weight>200</weight>
</device>
</blkiotune>
<memoryBacking>
<hugepages/>
</memoryBacking>
<uuid>12345678-12F4-1234-1234-123456789012</uuid>
<os>
<type arch='i686'>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
</os>
<idmap>
<uid start='0' target='1000' count='10'/>
<gid start='0' target='1000' count='10'/>
</idmap>
<description>Test VM for virtxml cli tests
</description>
<features>
<acpi/>
<apic eoi='off'/>
<hyperv>
<relaxed state='on'/>
<vapic state='on'/>
<spinlocks state='on' retries='12287'/>
</hyperv>
</features>
<clock offset="utc">
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
<timer name="hpet" present="no"/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<vcpu cpuset="1,2,5-9,11,13-14">9</vcpu>
<numatune>
<memory mode='interleave' placement='auto'/>
</numatune>
<cpu match="exact">
<model>core2duo</model>
<vendor>Intel</vendor>
<feature policy="require" name="pbe"/>
<feature policy="require" name="tm2"/>
<feature policy="require" name="est"/>
<feature policy="require" name="ss"/>
<feature policy="require" name="ht"/>
<feature policy="require" name="ds"/>
<feature policy="require" name="lahf_lm"/>
<feature policy="require" name="tm"/>
<feature policy="require" name="cx16"/>
<feature policy="require" name="vmx"/>
<feature policy="require" name="ds_cpl"/>
<feature policy="require" name="xtpr"/>
<feature policy="require" name="acpi"/>
<numa>
<cell id='0' cpus='0' memory='1048576' unit='KiB'/>
<cell id='1' cpus='1' memory='1048576' unit='KiB'/>
<cell id='2' cpus='2' memory='1048576' unit='KiB'/>
<cell id='3' cpus='3' memory='1048576' unit='KiB'/>
</numa>
</cpu>
<pm>
<suspend-to-mem enabled='no'/>
</pm>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='floppy'>
<source dev='/dev/null'/>
<target dev='fda' bus='fdc'/>
<boot order='5'/>
</disk>
<disk type='file' device='disk'>
<source file='/tmp/foobar'/>
<target dev='hda' bus='ide'/>
<iotune>
<read_bytes_sec>5242880</read_bytes_sec>
<total_iops_sec>50</total_iops_sec>
</iotune>
</disk>
<disk type='file' device='disk'>
<driver name="qemu" type="qcow2" cache="none"/>
<source file='/tmp/foobar2'>
<seclabel model='dac' relabel='no'/>
</source>
<target dev='sda' bus='scsi'/>
<boot order='1'/>
<address type='drive' controller='9'/>
<shareable/>
</disk>
<controller type='scsi' index='9' model='virtio-scsi'/>
<controller type='usb'/>
<interface type='network'>
<source network='default'/>
<mac address='22:22:33:54:32:10'/>
<model type='e1000'/>
</interface>
<interface type='bridge'>
<source bridge='br0'/>
<mac address='22:00:00:44:AA:BF'/>
<model type='e1000'/>
</interface>
<interface type='ethernet'>
<mac address='00:11:7f:33:44:55'/>
<script path='/etc/qemu-ifup'/>
<target dev='nic02'/>
</interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' display=':3.4' xauth='/testdir/.Xauthority' fullscreen='yes'/>
<sound model='sb16'/>
<sound model='es1370'/>
<sound model='ich6'/>
<video>
<model type='vmvga'/>
</video>
<video>
<model type='cirrus' vram='10240' heads='3'/>
</video>
<hostdev mode='subsystem' type='usb' managed='yes'>
<source>
<vendor id='0x04b3'/>
<product id='0x4485'/>
</source>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address bus='0x00' slot='0x19' function="0x0"/>
</source>
<rom bar='off'/>
</hostdev>
<serial type='null'/>
<parallel type='file'>
<source path='/tmp/foo.log'/>
</parallel>
<console type='null'>
<target type='serial'/>
</console>
<console type='pty'>
<target type='virtio'/>
</console>
<channel type='pipe'>
<source path='/tmp/guestfwd'/>
<target type='guestfwd' address='10.0.2.1' port='4600'/>
</channel>
<watchdog model='ib700' action='poweroff'/>
<smartcard mode='host'>
<address type='ccid' controller='0' slot='0'/>
</smartcard>
<redirdev bus='usb' type='tcp'>
<source mode='connect' host='localhost' service='4000'/>
<protocol type='raw'/>
</redirdev>
<filesystem>
<driver type='handle'/>
<source dir='/foo/bar'/>
<target dir='/bar/baz'/>
</filesystem>
<tpm model='tpm-tis'>
<backend type='passthrough'>
<device path='/dev/tzz'/>
</backend>
</tpm>
<rng model='virtio'>
<rate period='2000' bytes='1234'/>
<backend model='egd' type='tcp'>
<source mode='connect' host='1.2.3.4' service='1234'/>
</backend>
</rng>
<panic>
<address type='isa' iobase='0x505'/>
</panic>
<memballoon model='virtio'/>
</devices>
<seclabel model='selinux' type='dynamic'/>
</domain>
<domain type='test'>
<name>test-many-devices</name>
<currentMemory>204800</currentMemory>

543
tests/testsuite.xml Normal file
View File

@ -0,0 +1,543 @@
<node>
<cpu>
<nodes>1</nodes>
<sockets>4</sockets>
<cores>4</cores>
<threads>1</threads>
<active>4</active>
<mhz>4000</mhz>
<model>i686</model>
</cpu>
<memory>10000000</memory>
<!-- ####### -->
<!-- Domains -->
<!-- ####### -->
<domain type='test'>
<name>test</name>
<uuid>4a64cc71-19c4-2fd0-2323-3050941ea3c3</uuid>
<memory>8388608</memory>
<currentMemory>2097152</currentMemory>
<vcpu>2</vcpu>
<os>
<type arch='i686'>hvm</type>
<boot dev='hd'/>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
</devices>
</domain>
<domain type='test'>
<name>test-collide</name>
<currentMemory>204800</currentMemory>
<memory>409600</memory>
<uuid>12345678-1234-FFFF-1234-12345678FFFF</uuid>
<os>
<type arch='i686'>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
<boot dev='hd'/>
</os>
<features>
<acpi/><apic/>
</features>
<clock offset="utc"/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<vcpu>5</vcpu>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='file' device='disk'>
<source file='/dev/default-pool/collidevol1.img'/>
<target dev='hda' bus='ide'/>
<driver type="qcow2"/>
</disk>
<interface type='user'>
<mac address='22:11:11:11:11:11'/>
</interface>
<parallel type='file'>
<source path='/tmp/foo.log'/>
</parallel>
</devices>
</domain>
<domain type='test'>
<name>test-for-virtxml</name>
<currentMemory>204800</currentMemory>
<memory>409600</memory>
<blkiotune>
<weight>100</weight>
<device>
<path>/dev/sdd</path>
<weight>200</weight>
</device>
</blkiotune>
<memoryBacking>
<hugepages/>
</memoryBacking>
<uuid>12345678-12F4-1234-1234-123456789012</uuid>
<os>
<type arch='i686'>hvm</type>
<loader>/usr/lib/xen/boot/hvmloader</loader>
</os>
<idmap>
<uid start='0' target='1000' count='10'/>
<gid start='0' target='1000' count='10'/>
</idmap>
<description>Test VM for virtxml cli tests
</description>
<features>
<acpi/>
<apic eoi='off'/>
<hyperv>
<relaxed state='on'/>
<vapic state='on'/>
<spinlocks state='on' retries='12287'/>
</hyperv>
</features>
<clock offset="utc">
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
<timer name="hpet" present="no"/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<vcpu cpuset="1,2,5-9,11,13-14">9</vcpu>
<numatune>
<memory mode='interleave' placement='auto'/>
</numatune>
<cpu match="exact">
<model>core2duo</model>
<vendor>Intel</vendor>
<feature policy="require" name="pbe"/>
<feature policy="require" name="tm2"/>
<feature policy="require" name="est"/>
<feature policy="require" name="ss"/>
<feature policy="require" name="ht"/>
<feature policy="require" name="ds"/>
<feature policy="require" name="lahf_lm"/>
<feature policy="require" name="tm"/>
<feature policy="require" name="cx16"/>
<feature policy="require" name="vmx"/>
<feature policy="require" name="ds_cpl"/>
<feature policy="require" name="xtpr"/>
<feature policy="require" name="acpi"/>
<numa>
<cell id='0' cpus='0' memory='1048576' unit='KiB'/>
<cell id='1' cpus='1' memory='1048576' unit='KiB'/>
<cell id='2' cpus='2' memory='1048576' unit='KiB'/>
<cell id='3' cpus='3' memory='1048576' unit='KiB'/>
</numa>
</cpu>
<pm>
<suspend-to-mem enabled='no'/>
</pm>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='floppy'>
<source dev='/dev/null'/>
<target dev='fda' bus='fdc'/>
<boot order='5'/>
</disk>
<disk type='file' device='disk'>
<source file='/tmp/foobar'/>
<target dev='hda' bus='ide'/>
<iotune>
<read_bytes_sec>5242880</read_bytes_sec>
<total_iops_sec>50</total_iops_sec>
</iotune>
</disk>
<disk type='file' device='disk'>
<driver name="qemu" type="qcow2" cache="none"/>
<source file='/tmp/foobar2'>
<seclabel model='dac' relabel='no'/>
</source>
<target dev='sda' bus='scsi'/>
<boot order='1'/>
<address type='drive' controller='9'/>
<shareable/>
</disk>
<controller type='scsi' index='9' model='virtio-scsi'/>
<controller type='usb'/>
<interface type='network'>
<source network='default'/>
<mac address='22:22:33:54:32:10'/>
<model type='e1000'/>
</interface>
<interface type='bridge'>
<source bridge='br0'/>
<mac address='22:00:00:44:AA:BF'/>
<model type='e1000'/>
</interface>
<interface type='ethernet'>
<mac address='00:11:7f:33:44:55'/>
<script path='/etc/qemu-ifup'/>
<target dev='nic02'/>
</interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' display=':3.4' xauth='/testdir/.Xauthority' fullscreen='yes'/>
<sound model='sb16'/>
<sound model='es1370'/>
<sound model='ich6'/>
<video>
<model type='vmvga'/>
</video>
<video>
<model type='cirrus' vram='10240' heads='3'/>
</video>
<hostdev mode='subsystem' type='usb' managed='yes'>
<source>
<vendor id='0x04b3'/>
<product id='0x4485'/>
</source>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address bus='0x00' slot='0x19' function="0x0"/>
</source>
<rom bar='off'/>
</hostdev>
<serial type='null'/>
<parallel type='file'>
<source path='/tmp/foo.log'/>
</parallel>
<console type='null'>
<target type='serial'/>
</console>
<console type='pty'>
<target type='virtio'/>
</console>
<channel type='pipe'>
<source path='/tmp/guestfwd'/>
<target type='guestfwd' address='10.0.2.1' port='4600'/>
</channel>
<watchdog model='ib700' action='poweroff'/>
<smartcard mode='host'>
<address type='ccid' controller='0' slot='0'/>
</smartcard>
<redirdev bus='usb' type='tcp'>
<source mode='connect' host='localhost' service='4000'/>
<protocol type='raw'/>
</redirdev>
<filesystem>
<driver type='handle'/>
<source dir='/foo/bar'/>
<target dir='/bar/baz'/>
</filesystem>
<tpm model='tpm-tis'>
<backend type='passthrough'>
<device path='/dev/tzz'/>
</backend>
</tpm>
<rng model='virtio'>
<rate period='2000' bytes='1234'/>
<backend model='egd' type='tcp'>
<source mode='connect' host='1.2.3.4' service='1234'/>
</backend>
</rng>
<panic>
<address type='isa' iobase='0x505'/>
</panic>
<memballoon model='virtio'/>
</devices>
<seclabel model='selinux' type='dynamic'/>
</domain>
<!-- ######## -->
<!-- Networks -->
<!-- ######## -->
<network>
<name>default</name>
<uuid>715666b7-dbd4-6c78-fa55-94863da09f2d</uuid>
<forward mode='nat'/>
<bridge name='virbr0' stp='on' forwardDelay='0' />
<ip address='192.168.122.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.122.2' end='192.168.122.254' />
</dhcp>
</ip>
</network>
<!-- ####### -->
<!-- Storage -->
<!-- ####### -->
<pool type='dir'>
<name>default-pool</name>
<uuid>35bb2ad9-388a-cdfe-461a-b8907f6e53fe</uuid>
<capacity>107374182400</capacity>
<allocation>0</allocation>
<available>107374182400</available>
<source>
</source>
<target>
<path>/dev/default-pool</path>
<permissions>
<mode>0700</mode>
<owner>10736</owner>
<group>10736</group>
</permissions>
</target>
<volume type='file'>
<name>default-vol</name>
<capacity>1000000</capacity>
<allocation>50000</allocation>
<target>
<format type='qcow2'/>
<permissions>
<mode>0700</mode>
<owner>10736</owner>
<group>10736</group>
</permissions>
</target>
</volume>
<volume type='file'>
<name>dir-vol</name>
<capacity>1000000</capacity>
<allocation>50000</allocation>
<target>
<format type='dir'/>
<permissions>
<mode>0700</mode>
<owner>10736</owner>
<group>10736</group>
</permissions>
</target>
</volume>
<volume type='file'>
<name>iso-vol</name>
<capacity>1000000</capacity>
<allocation>50000</allocation>
<target>
<format type='iso'/>
<permissions>
<mode>0700</mode>
<owner>10736</owner>
<group>10736</group>
</permissions>
</target>
</volume>
<volume type='file'>
<name>bochs-vol</name>
<capacity>1000000</capacity>
<allocation>50000</allocation>
<target>
<format type='bochs'/>
<permissions>
<mode>0700</mode>
<owner>10736</owner>
<group>10736</group>
</permissions>
</target>
</volume>
<volume type='file'>
<name>testvol1.img</name>
<capacity>1000000</capacity>
<allocation>50000</allocation>
<target>
<format type='qcow2'/>
<permissions>
<mode>0700</mode>
<owner>10736</owner>
<group>10736</group>
</permissions>
</target>
</volume>
<volume type='file'>
<name>testvol2.img</name>
<capacity>1000000</capacity>
<allocation>50000</allocation>
<target>
<format type='qcow2'/>
<permissions>
<mode>0700</mode>
<owner>10736</owner>
<group>10736</group>
</permissions>
</target>
</volume>
<volume type='file'>
<name>UPPER</name>
<capacity>1000000</capacity>
<allocation>50000</allocation>
<target>
<permissions>
<mode>0700</mode>
<owner>10736</owner>
<group>10736</group>
</permissions>
</target>
</volume>
<volume type='file'>
<name>test-clone-simple.img</name>
<capacity>1000000</capacity>
<allocation>50000</allocation>
<target>
<permissions>
<mode>0700</mode>
<owner>10736</owner>
<group>10736</group>
</permissions>
</target>
</volume>
<volume type='file'>
<name>collidevol1.img</name>
<capacity>1000000</capacity>
<allocation>50000</allocation>
<target/>
</volume>
<volume type='file'>
<name>sharevol.img</name>
<capacity>1000000</capacity>
<allocation>50000</allocation>
<target/>
</volume>
<volume type='file'>
<name>backingl3.img</name>
<capacity>1000000</capacity>
<allocation>50000</allocation>
<target>
<format type='raw'/>
</target>
</volume>
<volume type='file'>
<name>backingl2.img</name>
<capacity>1000000</capacity>
<allocation>50000</allocation>
<target>
<format type='qcow2'/>
</target>
<backingStore>
<path>/dev/default-pool/backingl3.img</path>
</backingStore>
</volume>
<volume type='file'>
<name>backingl1.img</name>
<capacity>1000000</capacity>
<allocation>50000</allocation>
<target>
<format type='qcow2'/>
</target>
<backingStore>
<path>/dev/default-pool/backingl2.img</path>
</backingStore>
</volume>
<volume type='file'>
<name>overlay.img</name>
<capacity>1000000</capacity>
<allocation>50000</allocation>
<target>
<format type='qcow2'/>
</target>
<backingStore>
<path>/dev/default-pool/backingl1.img</path>
</backingStore>
</volume>
<!-- fake arm media -->
<volume type='file'>
<name>test-arm-kernel</name>
<capacity>1000000</capacity>
<allocation>50000</allocation>
<target>
<format type='raw'/>
</target>
</volume>
<volume type='file'>
<name>test-arm-initrd</name>
<capacity>1000000</capacity>
<allocation>50000</allocation>
<target>
<format type='raw'/>
</target>
</volume>
<volume type='file'>
<name>test-arm-dtb</name>
<capacity>1000000</capacity>
<allocation>50000</allocation>
<target>
<format type='raw'/>
</target>
</volume>
</pool>
<!-- ####### -->
<!-- Devices -->
<!-- ####### -->
<device>
<name>usb_device_4b3_4485_noserial</name>
<parent>usb_device_1d6b_2_0000_00_1a_7</parent>
<driver>
<name>usb</name>
</driver>
<capability type='usb_device'>
<bus>1</bus>
<device>3</device>
<product id='0x4485'>Serial Converter</product>
<vendor id='0x04b3'>IBM Corp.</vendor>
</capability>
</device>
</node>

View File

@ -41,7 +41,9 @@ _capsprefix = ",caps=%s/tests/capabilities-xml/" % os.getcwd()
_domcapsprefix = ",domcaps=%s/tests/capabilities-xml/" % os.getcwd()
uri_test_default = "__virtinst_test__test:///default,predictable"
uri_test = "__virtinst_test__test:///%s/tests/testdriver.xml,predictable" % os.getcwd()
uri_test_full = "__virtinst_test__test:///%s/tests/testdriver.xml,predictable" % os.getcwd()
uri_test_suite = "__virtinst_test__test:///%s/tests/testsuite.xml,predictable" % os.getcwd()
uri_test = uri_test_full
uri_test_remote = uri_test + ",remote"
_uri_qemu = "%s,qemu" % uri_test