nova/nova/tests/unit/virt/libvirt
Lee Yarwood 93058ae1b8 libvirt: Handle VIR_ERR_DEVICE_MISSING when detaching devices
Introduced in libvirt v4.1.0 [1] this error code replaces the previously
raised VIR_ERR_INVALID_ARG, VIR_ERR_OPERATION_FAILED and
VIR_ERR_INVALID_ARG codes [2][3].

VIR_ERR_OPERATION_FAILED was introduced and tested as an
active/live/hot unplug config device detach error code in
I131aaf28d2f5d5d964d4045e3d7d62207079cfb0.

VIR_ERR_INTERNAL_ERROR was introduced and tested as an
active/live/hot unplug config device detach error code in
I3055cd7641de92ab188de73733ca9288a9ca730a.

VIR_ERR_INVALID_ARG was introduced and tested as an
inactive/persistent/cold unplug config device detach error code in
I09230fc47b0950aa5a3db839a070613c9c817576.

This change introduces support for the new VIR_ERR_DEVICE_MISSING error
code while also retaining coverage for these codes until
MIN_LIBVIRT_VERSION is bumped past v4.1.0.

The majority of this change is test code motion with the existing tests
being modified to run against either the active or inactive versions of
the above  error codes for the time being.

test_detach_device_with_retry_operation_internal and
test_detach_device_with_retry_invalid_argument_no_live have been removed
as they duplicate the logic within the now refactored
_test_detach_device_with_retry_second_detach_failure.

[1] https://libvirt.org/git/?p=libvirt.git;a=commit;h=bb189c8e8c93f115c13fa3bfffdf64498f3f0ce1
[2] https://libvirt.org/git/?p=libvirt.git;a=commit;h=126db34a81bc9f9f9710408f88cceaa1e34bbbd7
[3] https://libvirt.org/git/?p=libvirt.git;a=commit;h=2f54eab7c7c618811de23c60a51e910274cf30de

Closes-Bug: #1887946
Change-Id: I7eb86edc130d186a66c04b229d46347ec5c0b625
(cherry picked from commit 902f09af25)
2020-07-22 14:06:07 +01:00
..
storage Merge "Leave brackets on Ceph IP addresses for libguestfs" 2019-10-14 20:56:14 +00:00
volume workarounds: Add option to locally attach RBD volumes on compute hosts 2020-04-06 21:59:08 +01:00
__init__.py
fake_imagebackend.py libvirt: Add support for stable device rescue 2020-04-09 08:39:35 +01:00
fake_libvirt_data.py Also enable iommu for virtio controllers and video in libvirt 2019-12-10 11:01:08 +00:00
fake_os_brick_connector.py Switch to using os-brick 2015-07-27 10:47:22 -07:00
fakelibvirt.py libvirt: Handle VIR_ERR_DEVICE_MISSING when detaching devices 2020-07-22 14:06:07 +01:00
test_blockinfo.py fup: Combine SUPPORTED_DEVICE_BUS and SUPPORTED_STORAGE_BUSES 2020-04-09 09:05:13 +01:00
test_config.py libvirt: Use domain capabilities to get supported device models 2020-03-24 17:28:09 +00:00
test_designer.py Create a controller for qga when SEV is used 2019-12-10 11:01:08 +00:00
test_driver.py Merge "catch libvirt exception when nodedev not found." into stable/ussuri 2020-07-15 16:34:16 +00:00
test_fakelibvirt.py libvirt: Get the CPU model, not 'arch' from get_capabilities() 2019-09-20 16:04:46 +00:00
test_guest.py libvirt: Handle VIR_ERR_DEVICE_MISSING when detaching devices 2020-07-22 14:06:07 +01:00
test_host.py Correct reported system memory 2020-07-13 11:07:59 +00:00
test_imagebackend.py Make RBD imagebackend flatten method idempotent 2020-01-28 14:30:40 +01:00
test_imagecache.py Guard against missing image cache directory 2020-06-25 12:19:00 +00:00
test_migration.py Support live migration with vpmem 2020-04-07 13:13:13 +00:00
test_utils.py images: Make JSON the default output format of calls to qemu-img info 2020-04-16 16:38:24 +01:00
test_vif.py libvirt: Mark e1000e VIF as supported 2020-07-06 13:40:59 +00:00