From: Li Zhang <zhlcindy(a)linux.vnet.ibm.com>
This patch is to add USB keyboard test cases for capabilities,
qemuxml2argvtest and qemuargv2xmltest.
Signed-off-by: Li Zhang <zhlcindy(a)linux.vnet.ibm.com>
---
tests/qemucapabilitiesdata/caps_1.2.2-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.3.1-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.4.2-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.5.3-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.6.0-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.6.50-1.caps | 1 +
tests/qemuhelptest.c | 8 ++++++++
tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml | 1 +
.../qemuxml2argv-pseries-usb-kbd.args | 9 +++++++++
.../qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.xml | 19 +++++++++++++++++++
tests/qemuxml2argvtest.c | 3 +++
11 files changed, 46 insertions(+)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.xml
diff --git a/tests/qemucapabilitiesdata/caps_1.2.2-1.caps
b/tests/qemucapabilitiesdata/caps_1.2.2-1.caps
index 73a561d..b620341 100644
--- a/tests/qemucapabilitiesdata/caps_1.2.2-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.2.2-1.caps
@@ -112,4 +112,5 @@
<flag name='usb-storage'/>
<flag name='usb-storage.removable'/>
<flag name='kvm-pit-lost-tick-policy'/>
+ <flag name='usb-kbd'/>
</qemuCaps>
diff --git a/tests/qemucapabilitiesdata/caps_1.3.1-1.caps
b/tests/qemucapabilitiesdata/caps_1.3.1-1.caps
index da15d8b..6b4a8f0 100644
--- a/tests/qemucapabilitiesdata/caps_1.3.1-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.3.1-1.caps
@@ -126,4 +126,5 @@
<flag name='usb-storage'/>
<flag name='usb-storage.removable'/>
<flag name='kvm-pit-lost-tick-policy'/>
+ <flag name='usb-kbd'/>
</qemuCaps>
diff --git a/tests/qemucapabilitiesdata/caps_1.4.2-1.caps
b/tests/qemucapabilitiesdata/caps_1.4.2-1.caps
index c419068..e3d0047 100644
--- a/tests/qemucapabilitiesdata/caps_1.4.2-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.4.2-1.caps
@@ -127,4 +127,5 @@
<flag name='usb-storage.removable'/>
<flag name='ich9-intel-hda'/>
<flag name='kvm-pit-lost-tick-policy'/>
+ <flag name='usb-kbd'/>
</qemuCaps>
diff --git a/tests/qemucapabilitiesdata/caps_1.5.3-1.caps
b/tests/qemucapabilitiesdata/caps_1.5.3-1.caps
index 09cf657..2a59401 100644
--- a/tests/qemucapabilitiesdata/caps_1.5.3-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.5.3-1.caps
@@ -131,4 +131,5 @@
<flag name='usb-storage.removable'/>
<flag name='ich9-intel-hda'/>
<flag name='kvm-pit-lost-tick-policy'/>
+ <flag name='usb-kbd'/>
</qemuCaps>
diff --git a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps
b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps
index 33ee73b..d352d8f 100644
--- a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps
@@ -135,4 +135,5 @@
<flag name='virtio-mmio'/>
<flag name='ich9-intel-hda'/>
<flag name='kvm-pit-lost-tick-policy'/>
+ <flag name='usb-kbd'/>
</qemuCaps>
diff --git a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps
b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps
index a66034a..514e7b7 100644
--- a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps
+++ b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps
@@ -134,4 +134,5 @@
<flag name='virtio-mmio'/>
<flag name='ich9-intel-hda'/>
<flag name='kvm-pit-lost-tick-policy'/>
+ <flag name='usb-kbd'/>
</qemuCaps>
diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c
index 3628fbe..6e0a5f8 100644
--- a/tests/qemuhelptest.c
+++ b/tests/qemuhelptest.c
@@ -403,6 +403,7 @@ mymain(void)
QEMU_CAPS_DEVICE_VMWARE_SVGA,
QEMU_CAPS_DEVICE_USB_SERIAL,
QEMU_CAPS_DEVICE_USB_NET,
+ QEMU_CAPS_DEVICE_USB_KBD,
QEMU_CAPS_DEVICE_PCI_BRIDGE);
DO_TEST("qemu-kvm-0.12.3", 12003, 1, 0,
QEMU_CAPS_VNC_COLON,
@@ -515,6 +516,7 @@ mymain(void)
QEMU_CAPS_DEVICE_USB_NET,
QEMU_CAPS_DEVICE_PCI_BRIDGE,
QEMU_CAPS_DEVICE_SCSI_GENERIC,
+ QEMU_CAPS_DEVICE_USB_KBD,
QEMU_CAPS_DEVICE_USB_STORAGE);
DO_TEST("qemu-kvm-0.12.1.2-rhel61", 12001, 1, 0,
QEMU_CAPS_VNC_COLON,
@@ -581,6 +583,7 @@ mymain(void)
QEMU_CAPS_DEVICE_VMWARE_SVGA,
QEMU_CAPS_DEVICE_USB_SERIAL,
QEMU_CAPS_DEVICE_USB_NET,
+ QEMU_CAPS_DEVICE_USB_KBD,
QEMU_CAPS_DEVICE_PCI_BRIDGE);
DO_TEST("qemu-kvm-0.12.1.2-rhel62-beta", 12001, 1, 0,
QEMU_CAPS_VNC_COLON,
@@ -655,6 +658,7 @@ mymain(void)
QEMU_CAPS_DEVICE_VGA,
QEMU_CAPS_DEVICE_CIRRUS_VGA,
QEMU_CAPS_DEVICE_PCI_BRIDGE,
+ QEMU_CAPS_DEVICE_USB_KBD,
QEMU_CAPS_DEVICE_USB_STORAGE);
DO_TEST("qemu-1.0", 1000000, 0, 0,
QEMU_CAPS_VNC_COLON,
@@ -739,6 +743,7 @@ mymain(void)
QEMU_CAPS_DEVICE_USB_NET,
QEMU_CAPS_DEVICE_SCSI_GENERIC,
QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX,
+ QEMU_CAPS_DEVICE_USB_KBD,
QEMU_CAPS_DEVICE_USB_STORAGE);
DO_TEST("qemu-1.1.0", 1001000, 0, 0,
QEMU_CAPS_VNC_COLON,
@@ -835,6 +840,7 @@ mymain(void)
QEMU_CAPS_DEVICE_SCSI_GENERIC,
QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX,
QEMU_CAPS_VNC_SHARE_POLICY,
+ QEMU_CAPS_DEVICE_USB_KBD,
QEMU_CAPS_DEVICE_USB_STORAGE);
DO_TEST("qemu-1.2.0", 1002000, 0, 0,
QEMU_CAPS_VNC_COLON,
@@ -943,6 +949,7 @@ mymain(void)
QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX,
QEMU_CAPS_VNC_SHARE_POLICY,
QEMU_CAPS_DEVICE_USB_STORAGE,
+ QEMU_CAPS_DEVICE_USB_KBD,
QEMU_CAPS_USB_STORAGE_REMOVABLE);
DO_TEST("qemu-kvm-1.2.0", 1002000, 1, 0,
QEMU_CAPS_VNC_COLON,
@@ -1056,6 +1063,7 @@ mymain(void)
QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX,
QEMU_CAPS_VNC_SHARE_POLICY,
QEMU_CAPS_DEVICE_USB_STORAGE,
+ QEMU_CAPS_DEVICE_USB_KBD,
QEMU_CAPS_USB_STORAGE_REMOVABLE);
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml
b/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml
index dbbd6aa..4a2be91 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml
@@ -30,6 +30,7 @@
<controller type='usb' index='0'/>
<controller type='scsi' index='0'/>
<controller type='pci' index='0' model='pci-root'/>
+ <input type='kbd' bus='usb'/>
<input type='mouse' bus='ps2'/>
<graphics type='sdl'/>
<video>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args
b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args
new file mode 100644
index 0000000..373c72a
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args
@@ -0,0 +1,9 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-ppc64 -S -M pseries -m 512 -smp 1 \
+-nographic -nodefconfig -nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=readline -no-acpi -boot c \
+-device pci-ohci,id=usb,bus=pci,addr=0x1 \
+-chardev pty,id=charserial0 \
+-device spapr-vty,chardev=charserial0,reg=0x30000000 \
+-device usb-kbd,id=input0
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.xml
b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.xml
new file mode 100644
index 0000000..c512584
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.xml
@@ -0,0 +1,19 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+ <memory unit='KiB'>524288</memory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='ppc64' machine='pseries'>hvm</type>
+ </os>
+ <clock offset='utc'/>
+ <devices>
+ <emulator>/usr/bin/qemu-system-ppc64</emulator>
+ <console type='pty'>
+ <address type="spapr-vio"/>
+ </console>
+ <memballoon model="none"/>
+ <controller type='usb' index='0' model='pci-ohci'/>
+ <input type='kbd' bus='usb'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index a290062..87e089a 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -986,6 +986,9 @@ mymain(void)
DO_TEST_ERROR("pseries-vio-address-clash", QEMU_CAPS_DRIVE,
QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("pseries-nvram", QEMU_CAPS_DEVICE_NVRAM);
+ DO_TEST("pseries-usb-kbd", QEMU_CAPS_PCI_OHCI,
+ QEMU_CAPS_DEVICE_USB_KBD, QEMU_CAPS_CHARDEV,
+ QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST_FAILURE("pseries-cpu-exact", QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE,
QEMU_CAPS_NODEFCONFIG);
DO_TEST("disk-ide-drive-split",
QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG,
--
1.8.2.1