usb.cfg 9.7 KB
Newer Older
1
- usb:
2
    virt_test_type = qemu
3 4
    no Host_RHEL.5
    no Host_RHEL.6.1
5 6 7
    restart_vm = yes
    kill_vm_on_error = yes
    usbs += " usbtest"
8
    usb_bus = "usbtest.0"
9 10 11 12 13

    # usb controllers
    variants:
        - uhci:
            usb_type_usbtest = piix3-usb-uhci
14
            usb_controller = uhci
15 16 17 18
            usb_max_port_usbtest = 2
            drive_format_stg = "usb1"
        - ehci:
            usb_type_usbtest = ich9-usb-ehci1
19
            usb_controller = ehci
20 21 22
            usb_max_port_usbtest = 6
            drive_format_stg = "usb2"
        - xhci:
23 24 25
            no RHEL.3
            no RHEL.4
            no RHEL.5
26
            usb_type_usbtest = nec-usb-xhci
27
            usb_controller = xhci
28 29
            usb_max_port_usbtest = 4
            drive_format_stg = "usb3"
30 31
            Host_RHEL:
                no Win2000, WinXP, Win2003, WinVista, Win7, Win2008
32

33 34
    # usb toplogy
    variants:
35
        - without_usb_hub:
36 37 38 39 40 41
        - with_usb_hub:
            no usb_nodev
            usb_devices += " hub1"
            usb_type_hub1 = usb-hub
            usb_port_hub1 = "2"
            usb_port_testdev = "2.1"
42 43 44 45 46 47 48 49 50 51 52 53
            variants:
                - one_usb_dev:
                - max_usb_dev:
                    only usb_boot, usb_reboot
                    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"
54

55
    # usb devices
56 57
    variants:
        - @usb_nodev:
58
            only usb_storage, usb_host, usb_multi_disk
59 60
        - usb_kbd:
            only usb_boot, usb_reboot, usb_hotplug
61
            usb_type = "usb-kbd"
62 63 64 65 66 67 68
            info_usb_name = "QEMU USB Keyboard"
            vendor_id = "0627"
            product_id = "0001"
            vendor = "Adomax Technology Co., Ltd"
            product = "QEMU USB Keyboard"
        - usb_mouse:
            only usb_boot, usb_reboot, usb_hotplug
69
            usb_type = "usb-mouse"
70 71 72 73 74 75 76
            info_usb_name = "QEMU USB Mouse"
            vendor_id = "0627"
            product_id = "0001"
            vendor = "Adomax Technology Co., Ltd"
            product = "QEMU USB Mouse"
        - usb_tablet:
            only usb_boot, usb_reboot, usb_hotplug
77
            usb_type = "usb-tablet"
78 79 80 81 82 83 84
            info_usb_name = "QEMU USB Tablet"
            vendor_id = "0627"
            product_id = "0001"
            vendor = "Adomax Technology Co., Ltd"
            product = "QEMU USB Tablet"
        - usb_ccid:
            only usb_boot, usb_reboot, usb_hotplug
85
            usb_type = "usb-ccid"
86
            info_usb_name = "QEMU USB CCID"
87
            vendor_id = "08E6"
88 89 90 91
            product_id = "4433"
            vendor = "Gemplus"
            product = "QEMU USB CCID"
        - usb_audio:
92
            no Host_RHEL.6
93
            no Host_RHEL.7
94
            only usb_boot, usb_reboot, usb_hotplug
95
            usb_type = usb-audio
96
            info_usb_name = "QEMU USB Audio"
97
            vendor_id = "46F4"
98 99 100 101 102
            product_id = "0002"
            vendor = ""
            product = "QEMU USB Audio"
        - usb_hub:
            only usb_boot, usb_reboot, usb_hotplug
103
            usb_type = usb-hub
104 105 106 107 108 109 110 111 112
            info_usb_name = "QEMU USB Hub"
            vendor_id = "(0000|0409)"
            product_id = "(0000|55aa)"
            vendor = ""
            product = "QEMU USB Hub"

    # usb tests
    variants:
        - usb_boot:
113
            type = usb_basic_check
114
            usb_devices += " testdev"
115 116
            deviceid_str = "%s:%s"
            chk_usb_info_cmd = "lsusb -v"
117
        - usb_reboot:
118
            type = usb_basic_check
119 120
            reboot_method = shell
            usb_devices += " testdev"
121 122
            deviceid_str = "%s:%s"
            chk_usb_info_cmd = "lsusb -v"
123
        - usb_hotplug:
124 125 126 127 128 129
            #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
130
            type = usb_hotplug
131 132 133
            #XXX: Now usb_hotplug doesn't support QMP monitor.
            # Limit it to human monitor only.
            monitor_type = human
134 135
            monitors = hmp1
            main_monitor = hmp1
136 137 138 139 140 141 142 143
            usb_sleep_time = 1
            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 = ""
144 145 146 147 148 149 150 151 152 153 154
            variants:
                - usb_normal_test:
                - usb_negative_test:
                    only ehci
                    only usb_hub
                    only usb_default
                    # Note: This is a workaround for the multifunction
                    # code in qemu_vm module.
                    usb_type_usbtest = usb-ehci
                    usb_negative_test = "yes"
                    usb_reply_msg = "Warning: speed mismatch trying to attach usb device"
155 156 157 158 159
            variants:
                - usb_one_time:
                    usb_repeat_times = 1
                - usb_multi_times:
                    usb_repeat_times = 5000
160
        - usb_storage:
161
            type = usb_storage
162 163 164 165 166 167 168 169 170 171 172 173 174
            images += " stg"
            image_boot_image1 = yes
            image_name_stg = "usbdevice"
            image_format_stg = "qcow2"
            image_boot_stg = no
            drive_index_stg = 1
            create_image_stg = yes
            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
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
            # 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 = ""
            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"
            writefile_cmd = "out=%s;"
            writefile_cmd += " python -c "print '$out'*10**4" > /tmp/usb_storage.in;"
            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;"
            writefile_cmd += ' echo "md5sum -c /media/out.$size.md5 >/dev/null 2>&1" >> /media/md5chk.sh;'
            writefile_cmd += " done;"
            writefile_cmd += " echo $out > %s"
            readfile_cmd = "sh /media/md5chk.sh && cat %s"
192 193
            chk_usb_info_cmd = "lsusb -v"
            chk_usb_info_keyword = "Mass Storage,SCSI,QEMU USB HARDDRIVE"
194 195
            RHEL.3, RHEL.4, RHEL.5:
                check_io_size_option = no
196 197 198 199 200 201
            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
202 203 204 205
        - usb_host:
            # must configure which device should be used
            #usb_host_device = "<vendorid>:<productid>"
            type = usb_host
206 207 208 209 210 211 212 213 214 215 216
            #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"
                    usb_reply_msg = "Property 'usb-host.productid' doesn't take value"
                    usb_host_device_list = "aaa:aaa,aaa:111,21231:11231333,21231:1123132233,2123133:1123132233111"
217 218 219 220 221
            variants:
                - usb_one_time:
                    usb_repeat_times = 1
                - usb_multi_times:
                    usb_repeat_times = 5000
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236
        - usb_multi_disk:
            only ehci
            type = multi_disk
            cmd_timeout = 1000
            black_list = C: D:
            start_vm = no
            kill_vm = yes
            create_image = yes
            image_boot_image1 = yes
            usbs = usb1
            usb_type = usb-ehci
            usb_max_port_usb1 = 6
            usb_max_port = 6
            usb_devices = ""
            variants:
237
                - one_disk_repeat:
238 239 240 241 242 243 244 245 246 247 248 249
                    images += " stg"
                    image_format_stg = qcow2
                    image_name_stg = storage
                    image_size_stg = 1G
                    drive_format_stg = usb2
                    drive_index_stg = 1
                    image_boot_stg = no
                    force_create_image_stg = yes
                    remove_image_stg = yes
                    n_repeat = 10
                - max_disk:
                    start_vm = no
250
                    restart_vm = no
251 252 253 254 255 256
                    usbs += " usb2 usb3 usb4"
                    stg_image_num = 24
                    stg_image_size = 1G
                    stg_image_boot = no
                    stg_drive_format = usb2
                    stg_assign_index = yes
257 258
                    force_create_image = yes
                    force_create_image_image1 = no
259 260 261
                    remove_image = yes
                    remove_image_image1 = no
                    cmd_timeout = 1000