nova/nova/tests/unit/virt/libvirt
Lee Yarwood 74b053f47a 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)
(cherry picked from commit 93058ae1b8)
(cherry picked from commit 863d6ef760)
(cherry picked from commit 76428c1a6a)
2020-09-14 10:20:11 +01:00
..
storage Fix python3 compatibility of rbd get_fsid 2019-07-31 20:29:23 +00:00
volume Fixes multi-registry config in Quobyte driver 2019-06-03 07:42:32 +00:00
__init__.py
fake_imagebackend.py libvirt: update logic to configure device for scsi controller 2017-07-03 03:23:53 -04:00
fake_libvirt_utils.py Add method to get cpu traits 2018-07-24 12:37:46 +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-09-14 10:20:11 +01:00
test_blockinfo.py Modify the test case of get_disk_mapping_rescue_with_config 2018-01-12 14:08:51 +08:00
test_compat.py Workaround for race condition in libvirt 2015-03-14 20:17:41 -03:00
test_config.py conf: libvirt: Make `/dev/urandom` the default for 'rng_dev_path' 2018-06-26 17:55:11 +02:00
test_designer.py add mtu to libvirt xml for ethernet and bridge types 2018-06-06 09:39:40 -04:00
test_driver.py libvirt: Provide VIR_MIGRATE_PARAM_PERSIST_XML during live migration 2020-08-25 16:05:15 +01:00
test_fakelibvirt.py conf: Deprecate 'keymap' options 2018-03-07 10:18:23 +00:00
test_firewall.py Don't modify objects directly 2018-01-30 16:35:02 +00:00
test_guest.py libvirt: Handle VIR_ERR_DEVICE_MISSING when detaching devices 2020-09-14 10:20:11 +01:00
test_host.py libvirt: Don't react to VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED events 2018-08-23 14:44:22 -04:00
test_imagebackend.py Make RBD imagebackend flatten method idempotent 2020-02-19 11:25:18 +00:00
test_imagecache.py Move the dac_admin privsep code to a new location. 2017-09-18 23:14:11 +10:00
test_migration.py libvirt: Avoid setting MTU during live migration if unset 2018-10-29 22:46:06 +01:00
test_utils.py Plumb trusted_certs through the compute service 2018-06-12 16:58:25 -04:00
test_vif.py Fix non-existent method of Mock 2019-08-16 09:13:37 +09:00