QA:Testcase Virtualization Hotplug USB device to guest

From FedoraProject

(Difference between revisions)
Jump to: navigation, search
(Modernize this case)
(Mention virt-manager bug)
 
(3 intermediate revisions by one user not shown)
Line 9: Line 9:
 
|actions=
 
|actions=
  
# Start with a shutoff VM. Open the VM details page.
+
=== Attach the host USB device ===
# Select 'Controller USB' and change to USB2. Click 'Apply'
+
==== Using virt-manager ====
 +
{{admon/warning | Attaching device via virt-manager is busted | See bug 1146297}}
 +
 
 
# Start the VM
 
# Start the VM
 
# Add Hardware->USB Host Device
 
# Add Hardware->USB Host Device
Line 19: Line 21:
 
# Select the device in virt-manager, and click 'Remove'.
 
# Select the device in virt-manager, and click 'Remove'.
 
# Verify the device again appears in the host, and is functional on the host.
 
# Verify the device again appears in the host, and is functional on the host.
 +
 +
==== Using virt-xml ====
 +
 +
* Find the device you want to attach in the output of <code>lsusb</code>, copy the ID string, something like <code>0781:5406</code>
 +
* Attach the device to running VM 'test-day-vm' using virt-xml:
 +
  sudo virt-xml test-day-vm --update --add-device --host-device 0781:5406
 +
* Verify the device is usable in the VM
 +
* Remove the device from the running VM 'test-day-vm':
 +
  sudo virt-xml test-day-vm --update --remove-device --host-device 0781:5406
 +
* Verify the device is visible and functioning on the host machine
  
 
|results=
 
|results=

Latest revision as of 00:17, 25 September 2014

Contents

Description

Attach a physical USB device to your guest.

Setup

Functioning Fedora host and a VM of any OS. More VM OS and USB devices the merrier!

How to test

Attach the host USB device

Using virt-manager

Warning (medium size).png
Attaching device via virt-manager is busted
See bug 1146297
  1. Start the VM
  2. Add Hardware->USB Host Device
  3. Choose the device you want to assign from the list, like: 009:002 SanDisk Extreme
  4. Click Finish
  5. Verify that the guest shows up in 'lsusb' output in the guest.
  6. Verify the device's functionality in the guest (this will be device specific)
  7. Select the device in virt-manager, and click 'Remove'.
  8. Verify the device again appears in the host, and is functional on the host.

Using virt-xml

  • Find the device you want to attach in the output of lsusb, copy the ID string, something like 0781:5406
  • Attach the device to running VM 'test-day-vm' using virt-xml:
 sudo virt-xml test-day-vm --update --add-device --host-device 0781:5406
  • Verify the device is usable in the VM
  • Remove the device from the running VM 'test-day-vm':
 sudo virt-xml test-day-vm --update --remove-device --host-device 0781:5406
  • Verify the device is visible and functioning on the host machine

Expected Results

No obvious errors occur.