commit | 5ddcc7eefaefb4ef178081ec4838e8f450c6c1dd | [log] [tgz] |
---|---|---|
author | yatin <ykarel@redhat.com> | Tue Mar 27 14:49:36 2018 +0530 |
committer | yatin <ykarel@redhat.com> | Tue Mar 27 17:06:44 2018 +0530 |
tree | 76316a8a04ea3b56672d331b9e175dc875f2efd4 | |
parent | a6d945d8e677dedf73ccb7b2f7271e8fc96836be [diff] [blame] |
Use addCleanup to detach volume instead of explicit detach Cinder volume delete [1] is executed during resource cleanup. So, if test fails due to some reason then it tries to delete a volume which is "in-use" state. Detach volume should be executed before trying to delete the volume. This patch adds nova_detach volume as a cleanup task. [1] https://github.com/openstack/barbican-tempest-plugin/blob/a6d945d8e677dedf73ccb7b2f7271e8fc96836be/barbican_tempest_plugin/tests/scenario/manager.py#L229 Change-Id: I3457bb6fc22a7bb6a32c8d6f4ea5879aeb8d43c5 Related-Bug: #1755485
diff --git a/barbican_tempest_plugin/tests/scenario/manager.py b/barbican_tempest_plugin/tests/scenario/manager.py index 1aa009e..66d28a5 100644 --- a/barbican_tempest_plugin/tests/scenario/manager.py +++ b/barbican_tempest_plugin/tests/scenario/manager.py
@@ -333,6 +333,7 @@ waiters.wait_for_volume_resource_status(self.volumes_client, volume['id'], 'in-use') + self.addCleanup(self.nova_volume_detach, server, volume) # Return the updated volume after the attachment return self.volumes_client.show_volume(volume['id'])['volume']