Allow kwargs in nova_volume_attach
As a part of the scenario/manager.py stabilization tracked by
the below BP the patch adds kwargs argument for nova_volume_attach
method so that the consumers are able to pass additional
parameters if needed.
Change-Id: Ibeca23781c16417ee031bc975305429af79d9b4a
Implements: blueprint tempest-scenario-manager-stable
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index ff860d5..ed11938 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -697,17 +697,20 @@
image_name, server['name'])
return snapshot_image
- def nova_volume_attach(self, server, volume_to_attach):
+ def nova_volume_attach(self, server, volume_to_attach, **kwargs):
"""Compute volume attach
This utility attaches volume from compute and waits for the
volume status to be 'in-use' state.
"""
volume = self.servers_client.attach_volume(
- server['id'], volumeId=volume_to_attach['id'])['volumeAttachment']
+ server['id'], volumeId=volume_to_attach['id'],
+ **kwargs)['volumeAttachment']
self.assertEqual(volume_to_attach['id'], volume['id'])
waiters.wait_for_volume_resource_status(self.volumes_client,
volume['id'], 'in-use')
+ self.addCleanup(test_utils.call_and_ignore_notfound_exc,
+ self.nova_volume_detach, server, volume)
# Return the updated volume after the attachment
return self.volumes_client.show_volume(volume['id'])['volume']