]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: Add qemu test for multiple timers
authorCole Robinson <crobinso@redhat.com>
Tue, 8 Oct 2013 21:41:16 +0000 (17:41 -0400)
committerCole Robinson <crobinso@redhat.com>
Tue, 8 Oct 2013 21:41:51 +0000 (17:41 -0400)
The following XML is the recommended default clock configuration for
qemu:

  <clock offset='utc'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
  </clock>

However we weren't testing any of those timer elements.

tests/qemuxml2argvdata/qemuxml2argv-clock-hpet-off.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-clock-hpet-off.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c

diff --git a/tests/qemuxml2argvdata/qemuxml2argv-clock-hpet-off.args b/tests/qemuxml2argvdata/qemuxml2argv-clock-hpet-off.args
new file mode 100644 (file)
index 0000000..5d11d91
--- /dev/null
@@ -0,0 +1,5 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
+/usr/bin/qemu -S -M \
+pc -m 214 -smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait \
+-rtc base=utc,driftfix=slew -no-kvm-pit-reinjection -no-hpet -no-acpi -boot c \
+-usb -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-clock-hpet-off.xml b/tests/qemuxml2argvdata/qemuxml2argv-clock-hpet-off.xml
new file mode 100644 (file)
index 0000000..3aed49f
--- /dev/null
@@ -0,0 +1,30 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219100</memory>
+  <currentMemory unit='KiB'>219100</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <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>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <controller type='ide' index='0'/>
+    <memballoon model='virtio'/>
+  </devices>
+</domain>
index 58165fda760042c3ee3ffdc7db321bc6f463a0f8..286f1a362838838863d47feb2ab73eead64ea871 100644 (file)
@@ -421,6 +421,8 @@ mymain(void)
     DO_TEST("clock-variable", QEMU_CAPS_RTC);
     */
     DO_TEST("clock-france", QEMU_CAPS_RTC);
+    DO_TEST("clock-hpet-off", QEMU_CAPS_RTC, QEMU_CAPS_NO_HPET,
+            QEMU_CAPS_NO_KVM_PIT);
     DO_TEST("cpu-kvmclock", QEMU_CAPS_ENABLE_KVM);
     DO_TEST("cpu-host-kvmclock", QEMU_CAPS_ENABLE_KVM, QEMU_CAPS_CPU_HOST);
     DO_TEST("kvmclock", QEMU_CAPS_KVM);