nova/nova/tests
Matthew Booth b66b7d4f9d libvirt: Pass instance to connect_volume and disconnect_volume
When we support multi-attach volumes, for volume drivers which must
make host state changes (eg mount/unmount) it is no longer enough to
know only which volume is being connected; we must also know which
instance it is being attached to. Consider the following sequence of
calls, and the expected behaviour of the volume driver:

 * connect_volume(conn_info)
     connect the volume
 * connect_volume(conn_info)
     do nothing (volume is already connected)
 * disconnect_volume(conn_info)
     disconnect the volume
 * disconnect_volume(conn_info)
     do nothing (volume is already disconnected)

Now consider these were actually connections to different instances:

 * connect_volume(conn_info, A)
     connect the volume
 * connect_volume(conn_info, B)
     do nothing (volume is already connected)
 * disconnect_volume(conn_info, A)
     ++ do nothing (volume is still connected to B)
 * disconnect_volume(conn_info, B)
     disconnect the volume

IOW, it is not possible for the driver to determine the correct
behaviour unless it also knows which instance is being attached.

This is a non functional change which simply adds instance as an
argument to all connect_volume and disconnect_volume calls in libvirt
volume drivers. It is effectively a part of change I3155984d. I have
split it as it is mechanical, it touches a large number of files
which make the substantive change harder to read, and to isolate the
substantive change from merge conflicts caused by this change.

We also add a utility test class: SubclassSignatureTestCase. This is
used in this patch to ensure we have found all connect_volume and
disconnect_volume methods which need to be updated. We implement it in
the top level tests module as we expect it to be useful elsewhere.

This patch was previously submitted as change I658d7ab5 but had to be
reverted as it failed to update the signatures of several volume
drivers. This is also what has prompted the addition of
SubclassSignatureTestCase, which ensures this hasn't happened again.

Change-Id: I01c908add1312063f0db724110f7e5927ff281ff
2017-05-08 11:31:11 -04:00
..
functional Merge "Catching OverQuota Exception" 2017-05-04 11:10:03 +00:00
live_migration/hooks remove unused functions 2017-05-02 10:36:30 -04:00
unit libvirt: Pass instance to connect_volume and disconnect_volume 2017-05-08 11:31:11 -04:00
__init__.py
fixtures.py Spelling error "paramenter" 2017-04-17 16:40:50 +08:00
uuidsentinel.py Remove redundant str typecasting 2016-09-23 12:53:34 +05:30