Merge "Fix cinder volume leakage"

This commit is contained in:
Jenkins 2017-04-10 17:40:49 +00:00 committed by Gerrit Code Review
commit 6448215bba

View File

@ -31,6 +31,11 @@ class TestServersBootNovaClient(base.ClientTestBase):
imageRef=self.image.id)
self.wait_for_volume_status(volume, "available")
if (len(bdm_params) >= 3 and bdm_params[2] == '1'):
delete_volume = False
else:
delete_volume = True
bdm_params = ':'.join(bdm_params)
if bdm_params:
bdm_params = ''.join((':', bdm_params))
@ -51,6 +56,10 @@ class TestServersBootNovaClient(base.ClientTestBase):
self.client.servers.delete(server_id)
self.wait_for_resource_delete(server_id, self.client.servers)
if delete_volume:
self.cinder.volumes.delete(volume.id)
self.wait_for_resource_delete(volume.id, self.cinder.volumes)
def test_boot_server_with_legacy_bdm(self):
# bdm v1 format
# <id>:<type>:<size(GB)>:<delete-on-terminate>