]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: qemuxml2argv: Add tests for USB controller on q35
authorAndrea Bolognani <abologna@redhat.com>
Fri, 8 Jan 2016 15:20:47 +0000 (16:20 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Fri, 8 Jan 2016 18:46:43 +0000 (19:46 +0100)
tests/qemuxml2argvdata/qemuxml2argv-usb-controller-default-q35.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-usb-controller-default-q35.xml [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-usb-controller-default-unavailable-q35.xml [new symlink]
tests/qemuxml2argvdata/qemuxml2argv-usb-controller-explicit-q35.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-usb-controller-explicit-q35.xml [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-usb-controller-explicit-unavailable-q35.xml [new symlink]
tests/qemuxml2argvtest.c

diff --git a/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-default-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-default-q35.args
new file mode 100644 (file)
index 0000000..a746d37
--- /dev/null
@@ -0,0 +1,21 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/libexec/qemu-kvm \
+-name q35-test \
+-S \
+-M q35 \
+-m 2048 \
+-smp 1 \
+-uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \
+-nographic \
+-nodefaults \
+-monitor unix:/tmp/test-monitor,server,nowait \
+-no-acpi \
+-boot c \
+-device pci-bridge,chassis_nr=56,id=pci.2,bus=pci.1,addr=0x1 \
+-device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \
+-device piix3-usb-uhci,id=usb,bus=pcie.0,addr=0x1
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-default-q35.xml b/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-default-q35.xml
new file mode 100644 (file)
index 0000000..26eecef
--- /dev/null
@@ -0,0 +1,27 @@
+<domain type='qemu'>
+  <name>q35-test</name>
+  <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid>
+  <memory unit='KiB'>2097152</memory>
+  <currentMemory unit='KiB'>2097152</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64' machine='q35'>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>
+    <emulator>/usr/libexec/qemu-kvm</emulator>
+    <controller type='pci' index='0' model='pcie-root'/>
+    <controller type='pci' index='2' model='pci-bridge'>
+      <model name='pci-bridge'/>
+      <target chassisNr='56'/>
+    </controller>
+    <controller type='usb' index='0'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+    </controller>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-default-unavailable-q35.xml b/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-default-unavailable-q35.xml
new file mode 120000 (symlink)
index 0000000..c31eb0e
--- /dev/null
@@ -0,0 +1 @@
+qemuxml2argv-usb-controller-default-q35.xml
\ No newline at end of file
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-explicit-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-explicit-q35.args
new file mode 100644 (file)
index 0000000..6fd058c
--- /dev/null
@@ -0,0 +1,21 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/libexec/qemu-kvm \
+-name q35-test \
+-S \
+-M q35 \
+-m 2048 \
+-smp 1 \
+-uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \
+-nographic \
+-nodefaults \
+-monitor unix:/tmp/test-monitor,server,nowait \
+-no-acpi \
+-boot c \
+-device pci-bridge,chassis_nr=56,id=pci.2,bus=pci.1,addr=0x1 \
+-device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \
+-device nec-usb-xhci,id=usb,bus=pcie.0,addr=0x1
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-explicit-q35.xml b/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-explicit-q35.xml
new file mode 100644 (file)
index 0000000..f3b34ee
--- /dev/null
@@ -0,0 +1,27 @@
+<domain type='qemu'>
+  <name>q35-test</name>
+  <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid>
+  <memory unit='KiB'>2097152</memory>
+  <currentMemory unit='KiB'>2097152</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64' machine='q35'>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>
+    <emulator>/usr/libexec/qemu-kvm</emulator>
+    <controller type='pci' index='0' model='pcie-root'/>
+    <controller type='pci' index='2' model='pci-bridge'>
+      <model name='pci-bridge'/>
+      <target chassisNr='56'/>
+    </controller>
+    <controller type='usb' index='0' model='nec-xhci'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+    </controller>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-explicit-unavailable-q35.xml b/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-explicit-unavailable-q35.xml
new file mode 120000 (symlink)
index 0000000..141d17c
--- /dev/null
@@ -0,0 +1 @@
+qemuxml2argv-usb-controller-explicit-q35.xml
\ No newline at end of file
index 63480ce8af19a2615ed81582ac41d5fcd0bc4734..b023522e69f71d2e9f97b8b144c7a5b21f696c59 100644 (file)
@@ -1181,7 +1181,22 @@ mymain(void)
             QEMU_CAPS_USB_HUB);
     DO_TEST_PARSE_ERROR("usb-none-usbtablet",
             QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
-
+    DO_TEST("usb-controller-default-q35",
+            QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_PCI_BRIDGE,
+            QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_PCI_OHCI,
+            QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_NEC_USB_XHCI);
+    DO_TEST_FAILURE("usb-controller-default-unavailable-q35",
+                    QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_PCI_BRIDGE,
+                    QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_PCI_OHCI,
+                    QEMU_CAPS_NEC_USB_XHCI);
+    DO_TEST("usb-controller-explicit-q35",
+            QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_PCI_BRIDGE,
+            QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_PCI_OHCI,
+            QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_NEC_USB_XHCI);
+    DO_TEST_FAILURE("usb-controller-explicit-unavailable-q35",
+                    QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_PCI_BRIDGE,
+                    QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_PCI_OHCI,
+                    QEMU_CAPS_PIIX3_USB_UHCI);
 
     DO_TEST("smbios", QEMU_CAPS_SMBIOS_TYPE);
     DO_TEST_PARSE_ERROR("smbios-date", QEMU_CAPS_SMBIOS_TYPE);