nova/nova/tests/unit/virt
Matt Riedemann a3b3e8d831 libvirt: wait for interface detach from the guest
The test_reassign_port_between_servers test in Tempest creates
a port in neutron and two servers. It attaches the port to the
first server and then quickly detaches it and waits for the
port.device_id to be unbound from the server. Then it repeats
that for the second server.

The interface detach from the guest is asynchronous and happens
before nova unbinds the port, so there is a race where the port's
device_id is unset but the interface is still on the first guest
when we try to attach to the second guest, which fails.

This is a latent bug, but apparently has been tickled by the
move to our neutron CI jobs to use ubuntu xenial nodes.

The fix is to add a detach and retry loop on the interface detach
on the guest so that we can wait until the interface is gone
from the guest before nova unbinds the port in neutron, which is
what the Tempest test is waiting for. Then the device should be
available for attaching to the second guest.

This is similar to what we do with detaching volumes.

Closes-Bug: #1607714

Change-Id: Ic04aad8923ea2edf1d16e32c208cd41fdf898834
2017-02-09 19:33:33 -05:00
..
disk Merge "Guestfs handle no passwd or group in image" 2016-12-12 06:27:16 +00:00
hyperv Merge "hyperv: make sure to plug OVS VIFs after resize/migrate" 2017-02-07 01:57:48 +00:00
image Use assert(Not)Equal instead of assertTrue(A == X) 2016-06-03 16:53:15 +01:00
ironic Merge "ironic: Add trigger crash dump support to ironic driver" 2017-01-31 19:10:18 +00:00
libvirt libvirt: wait for interface detach from the guest 2017-02-09 19:33:33 -05:00
vmwareapi [3/3]Replace six.iteritems() with .items() 2017-02-09 23:09:38 +08:00
xenapi [3/3]Replace six.iteritems() with .items() 2017-02-09 23:09:38 +08:00
__init__.py
fakelibosinfo.py Fix misuse of assertTrue in console and virt tests 2016-02-22 16:09:21 +09:00
test_block_device.py [3/3]Replace six.iteritems() with .items() 2017-02-09 23:09:38 +08:00
test_configdrive.py force_config_drive: StrOpt -> BoolOpt 2015-11-11 19:59:22 +00:00
test_diagnostics.py
test_driver.py Move driver_dict_from_config to libvirt driver 2016-11-09 11:48:20 -05:00
test_events.py
test_fake.py
test_firewall.py Use more specific asserts in tests 2016-10-12 11:12:08 +01:00
test_hardware.py Mark sibling CPUs as 'used' for cpu_thread_policy = 'isolated' 2016-12-13 11:23:07 +04:00
test_imagecache.py Remove mox from tests/unit/virt/test_imagecache.py 2016-06-16 23:40:01 +00:00
test_images.py Bump prlimit cpu time for qemu from 2 to 8 2016-12-08 10:41:31 -05:00
test_netutils.py libvirt: expose virtual interfaces with vlans to metadata 2017-01-26 17:06:56 -05:00
test_osinfo.py Fix misuse of assertTrue in console and virt tests 2016-02-22 16:09:21 +09:00
test_virt.py Remove mox from nova/tests/unit/virt/test_virt.py 2016-11-28 08:49:51 +00:00
test_virt_drivers.py [3/3]Replace six.iteritems() with .items() 2017-02-09 23:09:38 +08:00
test_volumeutils.py Switch to using os-brick 2015-07-27 10:47:22 -07:00