nova/nova/tests/unit/virt/libvirt
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
..
storage Port libvirt.storage.test_rbd to Python 3 2016-12-15 13:38:53 +00:00
volume libvirt: workaround findmnt behaviour change 2017-01-16 11:32:07 +00:00
__init__.py move all tests to nova/tests/unit 2014-11-12 15:31:08 -05:00
fake_imagebackend.py [3/3]Replace six.iteritems() with .items() 2017-02-09 23:09:38 +08:00
fake_libvirt_utils.py libvirt: ephemeral disk support for virtuozzo containers 2017-01-26 14:19:08 +03:00
fake_os_brick_connector.py Switch to using os-brick 2015-07-27 10:47:22 -07:00
fakelibvirt.py [3/3]Replace six.iteritems() with .items() 2017-02-09 23:09:38 +08:00
test_blockinfo.py Merge "Fix root_device_name for Xen" 2017-01-31 18:56:46 +00:00
test_compat.py Workaround for race condition in libvirt 2015-03-14 20:17:41 -03:00
test_config.py libvirt: Use the mirror element to detect job completion 2017-01-25 11:35:47 +00:00
test_designer.py libvirt: avoid generating script with empty path 2017-01-24 12:50:49 +00:00
test_driver.py libvirt: wait for interface detach from the guest 2017-02-09 19:33:33 -05:00
test_fakelibvirt.py tests: Combine multiple NUMA-generation functions 2017-02-01 11:29:21 +00:00
test_firewall.py Port libvirt.test_firewall to Python 3 2017-01-05 10:26:19 +00:00
test_guest.py libvirt: wait for interface detach from the guest 2017-02-09 19:33:33 -05:00
test_host.py libvirt: Flatten 'get_domain' function 2016-12-14 18:47:46 +00:00
test_imagebackend.py Merge "Remove mox from unit/virt/libvirt/test_imagebackend.py (5)" 2017-01-28 00:24:10 +00:00
test_imagecache.py conf: Remove config option compute_ manager 2016-12-08 20:05:52 +08:00
test_migration.py Change exponential function to linear 2017-01-26 15:24:20 +00:00
test_utils.py [3/3]Replace six.iteritems() with .items() 2017-02-09 23:09:38 +08:00
test_vif.py Merge "libvirt: set vlan tag for macvtap on SR-IOV VFs" 2017-02-09 17:35:27 +00:00