From Fedora Project Wiki

(flesh out the test case)
m (changed to numbered list)
 
Line 2: Line 2:
|description=This test case checks that the libvirt node device dettach, reattach and reset operations work correctly. These operations were added to support device assignment.
|description=This test case checks that the libvirt node device dettach, reattach and reset operations work correctly. These operations were added to support device assignment.
|actions=
|actions=
* Verify that you have the correct nodedev name for the device
# Verify that you have the correct nodedev name for the device
<pre>
#:<pre>
  $> virsh nodedev-dumpxml pci_8086_10bd
#:  $> virsh nodedev-dumpxml pci_8086_10bd
  <device>
#:  <device>
    <name>pci_8086_10bd</name>
#:    <name>pci_8086_10bd</name>
    <parent>computer</parent>
#:    <parent>computer</parent>
    <capability type='pci'>
#:    <capability type='pci'>
      <domain>0</domain>
#:      <domain>0</domain>
      <bus>0</bus>
#:      <bus>0</bus>
      <slot>25</slot>
#:      <slot>25</slot>
      <function>0</function>
#:      <function>0</function>
      <product id='0x10bd'>82566DM-2 Gigabit Network Connection</product>
#:      <product id='0x10bd'>82566DM-2 Gigabit Network Connection</product>
      <vendor id='0x8086'>Intel Corporation</vendor>
#:      <vendor id='0x8086'>Intel Corporation</vendor>
    </capability>
#:    </capability>
  </device>
#:  </device>
</pre>
#:</pre>
* Convert the address above to a hexidecimal PCI device address and check which driver is currently loaded
# Convert the address above to a hexidecimal PCI device address and check which driver is currently loaded
<pre>
#:<pre>
  $> readlink /sys/bus/pci/devices/0000\:00\:19.0/driver
#:  $> readlink /sys/bus/pci/devices/0000\:00\:19.0/driver
  ../../../bus/pci/drivers/e1000e
#:  ../../../bus/pci/drivers/e1000e
</pre>
#:</pre>
* Detach the device
# Detach the device
<pre>
#:<pre>
  $> virsh nodedev-dettach pci_8086_10bd
#:  $> virsh nodedev-dettach pci_8086_10bd
  Device pci_8086_10bd dettached
#:  Device pci_8086_10bd dettached
</pre>
#:</pre>
* Check that the device is now bound to the pci-stub driver
# Check that the device is now bound to the pci-stub driver
<pre>
#:<pre>
  $> readlink /sys/bus/pci/devices/0000\:00\:19.0/driver
#:  $> readlink /sys/bus/pci/devices/0000\:00\:19.0/driver
  ../../../bus/pci/drivers/pci-stub
#:  ../../../bus/pci/drivers/pci-stub
</pre>
#:</pre>
* Reset the device
# Reset the device
<pre>
#:<pre>
  $> virsh nodedev-reset pci_8086_10bd
#:  $> virsh nodedev-reset pci_8086_10bd
  Device pci_8086_10bd reset
#:  Device pci_8086_10bd reset
</pre>
#:</pre>
* Re-attach the device:
# Re-attach the device:
<pre>
#:<pre>
  $> virsh nodedev-reattach pci_8086_10bd
#:  $> virsh nodedev-reattach pci_8086_10bd
  Device pci_8086_10bd re-attached
#:  Device pci_8086_10bd re-attached
</pre>
#:</pre>
* Check the device is bound to the original driver again
# Check the device is bound to the original driver again
<pre>
#:<pre>
  $> readlink /sys/bus/pci/devices/0000\:00\:19.0/driver
#:  $> readlink /sys/bus/pci/devices/0000\:00\:19.0/driver
  ../../../bus/pci/drivers/e1000e
#:  ../../../bus/pci/drivers/e1000e
</pre>
#:</pre>
* Check that the device can still be used in the host - e.g. if it is a NIC, bring it up and try pinging a remote host
# Check that the device can still be used in the host - e.g. if it is a NIC, bring it up and try pinging a remote host
|results=
|results=
* All operations should complete successfully
# All operations should complete successfully
* The device should be bound to pci-stub and then bound back to the original driver
# The device should be bound to pci-stub and then bound back to the original driver
* The device should operate correctly after it is re-attached
# The device should operate correctly after it is re-attached
}}
}}
[[Category:Virtualization KVM PCI Device Assignment Test Cases|nodedev ops]]
[[Category:Virtualization KVM PCI Device Assignment Test Cases|nodedev ops]]

Latest revision as of 11:38, 6 May 2009

Description

This test case checks that the libvirt node device dettach, reattach and reset operations work correctly. These operations were added to support device assignment.


How to test

  1. Verify that you have the correct nodedev name for the device
    $> virsh nodedev-dumpxml pci_8086_10bd
    <device>
    <name>pci_8086_10bd</name>
    <parent>computer</parent>
    <capability type='pci'>
    <domain>0</domain>
    <bus>0</bus>
    <slot>25</slot>
    <function>0</function>
    <product id='0x10bd'>82566DM-2 Gigabit Network Connection</product>
    <vendor id='0x8086'>Intel Corporation</vendor>
    </capability>
    </device>
  2. Convert the address above to a hexidecimal PCI device address and check which driver is currently loaded
    $> readlink /sys/bus/pci/devices/0000\:00\:19.0/driver
    ../../../bus/pci/drivers/e1000e
  3. Detach the device
    $> virsh nodedev-dettach pci_8086_10bd
    Device pci_8086_10bd dettached
  4. Check that the device is now bound to the pci-stub driver
    $> readlink /sys/bus/pci/devices/0000\:00\:19.0/driver
    ../../../bus/pci/drivers/pci-stub
  5. Reset the device
    $> virsh nodedev-reset pci_8086_10bd
    Device pci_8086_10bd reset
  6. Re-attach the device:
    $> virsh nodedev-reattach pci_8086_10bd
    Device pci_8086_10bd re-attached
  7. Check the device is bound to the original driver again
    $> readlink /sys/bus/pci/devices/0000\:00\:19.0/driver
    ../../../bus/pci/drivers/e1000e
  8. Check that the device can still be used in the host - e.g. if it is a NIC, bring it up and try pinging a remote host

Expected Results

  1. All operations should complete successfully
  2. The device should be bound to pci-stub and then bound back to the original driver
  3. The device should operate correctly after it is re-attached