usb.cfg 13.0 KB
Newer Older
1
- usb:
2
    virt_test_type = qemu
3 4
    no Host_RHEL.m5
    no Host_RHEL.m6.u1
5 6
    restart_vm = yes
    kill_vm_on_error = yes
C
Cong Li 已提交
7
    usbs = " usbtest"
8
    usb_bus = "usbtest.0"
9 10 11

    # usb controllers
    variants:
C
Cong Li 已提交
12
        - piix3-uhci:
13
            usb_type_usbtest = piix3-usb-uhci
14
            usb_controller = uhci
15
            max_ports_usbtest = 2
16
            drive_format_stg = "usb1"
17
            no ppc64 ppc64le
C
Cong Li 已提交
18 19 20
        - piix4-uhci:
            usb_type_usbtest = piix4-usb-uhci
            usb_controller = uhci
21
            max_ports_usbtest = 2
C
Cong Li 已提交
22
            drive_format_stg = "usb1"
23
            no ppc64 ppc64le
24
            no Windows
C
Cong Li 已提交
25 26 27
        - ich9-uhci:
            usb_type_usbtest = ich9-usb-uhci6
            usb_controller = uhci
28
            max_ports_usbtest = 2
C
Cong Li 已提交
29
            drive_format_stg = "usb1"
30
            no ppc64 ppc64le
31
            no Host_RHEL.m6
C
Cong Li 已提交
32
        - ich9-ehci:
33
            usb_controller = ehci
34
            max_ports = 6
35
            drive_format_stg = "usb2"
36 37 38 39 40 41 42 43 44 45 46
            no ppc64 ppc64le
            # Use ich9-usb-ehci2 for usb_hotplug..usb_negative_test and
            # usb_multi_disk test since ich9-usb-ehci1 is specified to
            # be used as companion controller in avocado-vt
            variants:
                - @ich9-ehci1:
                    no usb_hotplug..usb_negative_test, usb_multi_disk
                    usb_type_usbtest = ich9-usb-ehci1
                - ich9-ehci2:
                    only usb_hotplug..usb_negative_test, usb_multi_disk
                    usb_type = ich9-usb-ehci2
C
Cong Li 已提交
47 48
        - usb-ehci:
            usb_type_usbtest = usb-ehci
49
            usb_type = usb-ehci
C
Cong Li 已提交
50
            usb_controller = ehci
51
            max_ports = 6
C
Cong Li 已提交
52 53
            drive_format_stg = "usb2"
        - nec-xhci:
54
            no RHEL.5
55
            no Host_RHEL.m6
56
            usb_type_usbtest = nec-usb-xhci
57
            usb_type = nec-usb-xhci
58
            usb_controller = xhci
59
            max_ports = 4
60
            drive_format_stg = "usb3"
61 62
            Host_RHEL:
                no Win2000, WinXP, Win2003, WinVista, Win7, Win2008
H
Haotong Chen 已提交
63 64 65 66
        - qemu-xhci:
            no RHEL.5
            no Host_RHEL.m6, Host_RHEL.m7.u0, Host_RHEL.m7.u1
            no Host_RHEL.m7.u2, Host_RHEL.m7.u3
67 68
            usb_type_usbtest = nec-usb-xhci
            usb_type = qemu-xhci
H
Haotong Chen 已提交
69
            usb_controller = xhci
70
            max_ports = 4
H
Haotong Chen 已提交
71 72 73
            drive_format_stg = "usb3"
            Host_RHEL:
                no Win2000, WinXP, Win2003, WinVista, Win7, Win2008
74

75 76
    # usb toplogy
    variants:
77
        - without_usb_hub:
78
        - with_usb_hub:
79
            no usb_host, usb_multi_disk
80
            no usb-ehci
81 82 83 84
            usb_devices += " hub1"
            usb_type_hub1 = usb-hub
            usb_port_hub1 = "2"
            usb_port_testdev = "2.1"
85 86 87 88
            variants:
                - one_usb_dev:
                - max_usb_dev:
                    only usb_boot, usb_reboot
89
                    no usb_hub
90 91 92 93 94 95 96 97
                    usb_devices += " d1 d2 d3 d4 d5 d6 d7"
                    usb_port_d1 = "2.2"
                    usb_port_d2 = "2.3"
                    usb_port_d3 = "2.4"
                    usb_port_d4 = "2.5"
                    usb_port_d5 = "2.6"
                    usb_port_d6 = "2.7"
                    usb_port_d7 = "2.8"
98 99 100 101 102 103 104
                - max_usb_hub_dev:
                    only usb_boot, usb_reboot
                    only usb_hub
                    usb_devices += " hub2 hub3 hub4"
                    usb_port_hub2 = "2.2"
                    usb_port_hub3 = "2.3"
                    usb_port_hub4 = "2.4"
105

106
    # usb devices
107 108
    variants:
        - @usb_nodev:
109
            only usb_storage, usb_host, usb_multi_disk
110
        - usb_kbd:
111 112
            Host_RHEL.m6:
                no usb-ehci
113
            only usb_reboot, usb_hotplug
114
            usb_type = "usb-kbd"
115 116 117 118 119 120
            info_usb_name = "QEMU USB Keyboard"
            vendor_id = "0627"
            product_id = "0001"
            vendor = "Adomax Technology Co., Ltd"
            product = "QEMU USB Keyboard"
        - usb_mouse:
121 122
            Host_RHEL.m6:
                no usb-ehci
123
            only usb_reboot, usb_hotplug
124
            usb_type = "usb-mouse"
125 126 127 128 129 130
            info_usb_name = "QEMU USB Mouse"
            vendor_id = "0627"
            product_id = "0001"
            vendor = "Adomax Technology Co., Ltd"
            product = "QEMU USB Mouse"
        - usb_tablet:
131 132
            Host_RHEL.m6:
                no usb-ehci
133
            only usb_reboot, usb_hotplug
134
            usb_type = "usb-tablet"
135 136 137 138 139 140
            info_usb_name = "QEMU USB Tablet"
            vendor_id = "0627"
            product_id = "0001"
            vendor = "Adomax Technology Co., Ltd"
            product = "QEMU USB Tablet"
        - usb_ccid:
141
            no usb-ehci
142
            only usb_boot, usb_reboot, usb_hotplug
143
            usb_type = "usb-ccid"
144
            info_usb_name = "QEMU USB CCID"
145
            vendor_id = "08E6"
146 147 148
            product_id = "4433"
            vendor = "Gemplus"
            product = "QEMU USB CCID"
149 150
            Linux:
                dwprotocols = "dwProtocols\s+\d\s+T=0"
151
        - usb_audio:
152
            no Host_RHEL
153
            only usb_boot, usb_reboot, usb_hotplug
154
            usb_type = usb-audio
155
            info_usb_name = "QEMU USB Audio"
156
            vendor_id = "46F4"
157 158 159 160
            product_id = "0002"
            vendor = ""
            product = "QEMU USB Audio"
        - usb_hub:
161
            no usb-ehci
162
            only usb_boot, usb_reboot, usb_hotplug
163
            usb_type = usb-hub
164 165 166 167 168 169 170 171 172
            info_usb_name = "QEMU USB Hub"
            vendor_id = "(0000|0409)"
            product_id = "(0000|55aa)"
            vendor = ""
            product = "QEMU USB Hub"

    # usb tests
    variants:
        - usb_boot:
173
            type = usb_basic_check
174
            usb_devices += " testdev"
175 176
            deviceid_str = "%s:%s"
            chk_usb_info_cmd = "lsusb -v"
177
            chk_specified_usb_info = "lsusb -v -d ${deviceid_str}"
178
        - usb_reboot:
179
            type = usb_basic_check
180 181
            reboot_method = shell
            usb_devices += " testdev"
182 183
            deviceid_str = "%s:%s"
            chk_usb_info_cmd = "lsusb -v"
184
            chk_specified_usb_info = "lsusb -v -d ${deviceid_str}"
185
        - usb_hotplug:
186 187 188 189 190 191
            #XXX: usb_hotplug uses some linux-only cmds.
            # And the pattern to verify device is pluged can't
            # work with guests older then RHEL5.
            no RHEL.3
            no RHEL.4
            no RHEL.5
192
            type = usb_hotplug
193 194 195
            #XXX: Now usb_hotplug doesn't support QMP monitor.
            # Limit it to human monitor only.
            monitor_type = human
196 197
            monitors = hmp1
            main_monitor = hmp1
198
            usb_sleep_time = 10
199 200 201 202 203 204 205
            Windows:
                usb_match_add = "VID_%s&PID_%s"
                usb_match_del = ""
                usb_clear_guest_log_cmd = ""
                usb_query_syslog_cmd = 'wmic path Win32_USBControllerDevice get Dependent | find "USB"'
                usb_sleep_time = 10
                usb_udev_refresh_cmd = ""
206 207 208
            variants:
                - usb_normal_test:
                - usb_negative_test:
209
                    only ich9-ehci
210
                    only usb_hub
211
                    only without_usb_hub
212 213
                    # Note: This is a workaround for the multifunction
                    # code in qemu_vm module.
214
                    usb_type_usbtest = ich9-usb-ehci2
215 216
                    usb_negative_test = "yes"
                    usb_reply_msg = "Warning: speed mismatch trying to attach usb device"
217 218 219 220
            variants:
                - usb_one_time:
                    usb_repeat_times = 1
                - usb_multi_times:
221
                    no usb_negative_test
Q
Qianqian Zhu 已提交
222
                    usb_repeat_times = 20
223
        - usb_storage:
224
            type = usb_storage
225
            images += " stg"
226
            blk_extra_params_stg = "serial=TARGET_DISK0"
227
            image_boot_image1 = yes
M
Mike Qiu 已提交
228
            image_name_stg = "images/usbdevice"
229 230 231 232
            image_format_stg = "qcow2"
            image_boot_stg = no
            drive_index_stg = 1
            create_image_stg = yes
233
            remove_image_stg = yes
234 235 236 237 238 239
            image_size_stg = 10M
            fdisk_string = "10 MB, 10485760 bytes"
            format_timeout = 400
            check_serial_option = yes
            check_removable_option = yes
            check_io_size_option = yes
240 241 242 243 244
            # The following parameters will be overridden in guest-os config files.
            create_partition_cmd = ""
            format_cmd = "yes |mkfs $(readlink -f `ls /dev/disk/by-path/* | grep usb`)"
            list_disk_cmd = ""
            set_online_cmd = ""
245
            chk_mount_cmd = "grep -qs $(readlink -f `ls /dev/disk/by-path/* | grep usb`) /proc/mounts"
246 247 248
            mount_cmd =  "mount $(readlink -f `ls /dev/disk/by-path/* | grep usb`) /media"
            umount_cmd = "umount $(readlink -f `ls /dev/disk/by-path/* | grep usb`)"
            testfile_name = "/media/usb_storage-test.txt"
249 250
            writefile_cmd = "echo "set -e" > /media/md5chk.sh;"
            writefile_cmd += " out=%s;"
X
Xu Han 已提交
251
            writefile_cmd += " python -c "print('$out'*10**4)" > /tmp/usb_storage.in;"
252 253 254
            writefile_cmd += " for size in 4K 16K 64K 256K; do"
            writefile_cmd += " dd if=/tmp/usb_storage.in of=/media/out.$size bs=$size || exit 1;"
            writefile_cmd += " md5sum /media/out.$size > /media/out.$size.md5;"
255
            writefile_cmd += " echo "md5sum -c /media/out.$size.md5 >/dev/null 2>&1" >> /media/md5chk.sh;"
256 257
            writefile_cmd += " done;"
            writefile_cmd += " echo $out > %s"
258 259
            md5chk_cmd = "sh /media/md5chk.sh"
            readfile_cmd = "cat %s"
260 261
            chk_usb_info_cmd = "lsusb -v"
            chk_usb_info_keyword = "Mass Storage,SCSI,QEMU USB HARDDRIVE"
262 263
            RHEL.3, RHEL.4, RHEL.5:
                check_io_size_option = no
264 265 266 267 268 269
            Windows:
                chk_usb_info_cmd = 'wmic path Win32_USBControllerDevice get Dependent | find "USB"'
                chk_usb_info_keyword = "USBSTOR,VEN_QEMU,PROD_QEMU_HARDDISK"
                check_serial_option = no
                check_removable_option = no
                check_io_size_option = no
270 271 272 273
        - usb_host:
            # must configure which device should be used
            #usb_host_device = "<vendorid>:<productid>"
            type = usb_host
274 275 276 277 278 279 280 281 282
            #XXX: Now usb_host doesn't support QMP monitor.
            # Limit it to human monitor only.
            monitor_type = human
            monitors = hmp1
            main_monitor = hmp1
            variants:
                - usb_normal_test:
                - usb_negative_test:
                    usb_negative_test = "yes"
283 284
                    Host_RHEL.m6:
                        # Now no output from monitor for negative test on Host_RHEL.m6
285
                        usb_reply_msg = ""
286 287 288 289 290 291 292
                    usb_reply_msg = "Property 'usb-host.productid' doesn't take value"
                    usb_reply_msg += "Parameter 'productid' expects an int64 value or range;"
                    usb_reply_msg += "Parameter 'vendorid' expects an int64 value or range;"
                    usb_reply_msg += "productid out of range;"
                    usb_reply_msg += "vendorid out of range;"
                    usb_reply_msg += "Parameter 'productid' expects uint32_t;"
                    usb_reply_msg += "Parameter 'vendorid' expects uint32_t;"
293
                    usb_host_device_list = "aaa:aaa,aaa:111,21231:11231333,11231333:21231,21231:1123132233,2123133:1123132233111,1123132233111:111"
294 295
                - usb_check_isobufs:
                    usb_check_isobufs = "yes"
296 297 298 299
            variants:
                - usb_one_time:
                    usb_repeat_times = 1
                - usb_multi_times:
300
                    no usb_negative_test
Q
Qianqian Zhu 已提交
301
                    usb_repeat_times = 20
302
        - usb_multi_disk:
303 304 305
            no piix3-uhci, piix4-uhci, ich9-uhci
            Host_RHEL.m6:
                no usb-ehci
306 307
            Linux:
                file_system = "ext4"
308 309
            type = multi_disk
            cmd_timeout = 1000
310 311
            black_list = C: S:
            cdroms = ""
312 313 314 315
            start_vm = no
            kill_vm = yes
            create_image = yes
            image_boot_image1 = yes
316 317 318 319 320 321 322 323 324
            force_create_image = yes
            force_create_image_image1 = no
            remove_image = yes
            remove_image_image1 = no
            cmd_timeout = 1000
            stg_image_size = 1G
            stg_image_boot = no
            stg_image_format = qcow2
            stg_assign_index = yes
325 326
            usb_devices = ""
            variants:
327
                - one_disk_repeat:
328
                    stg_image_num = 1
329 330 331
                    n_repeat = 10
                - max_disk:
                    stg_image_num = 24
332 333 334 335 336 337 338
                    usb-ehci, ich9-ehci:
                        stg_drive_format = usb2
                        # Add multi usb controllers
                        usbs = "usbdisk1 usbdisk2 usbdisk3 usbdisk4"
                    nec-xhci, qemu-xhci:
                        stg_drive_format = usb3
                        usbs = "usbdisk1 usbdisk2 usbdisk3 usbdisk4 usbdisk5 usbdisk6"