Merge "Add wait for resource deletion on volume teardown"
diff --git a/tempest/tests/volume/test_volumes_actions.py b/tempest/tests/volume/test_volumes_actions.py
index 7eddb67..155acb6 100644
--- a/tempest/tests/volume/test_volumes_actions.py
+++ b/tempest/tests/volume/test_volumes_actions.py
@@ -46,7 +46,10 @@
         super(VolumesActionsTest, cls).tearDownClass()
         # Delete the test instance and volume
         cls.client.delete_volume(cls.volume['id'])
+        cls.client.wait_for_resource_deletion(cls.volume['id'])
+
         cls.servers_client.delete_server(cls.server['id'])
+        cls.client.wait_for_resource_deletion(cls.server['id'])
 
     @attr(type='smoke')
     def test_attach_detach_volume_to_instance(self):
diff --git a/tempest/tests/volume/test_volumes_list.py b/tempest/tests/volume/test_volumes_list.py
index 26a85b7..2fc1353 100644
--- a/tempest/tests/volume/test_volumes_list.py
+++ b/tempest/tests/volume/test_volumes_list.py
@@ -87,8 +87,9 @@
                     # because the backing file size of the volume group is
                     # too small. So, here, we clean up whatever we did manage
                     # to create and raise a SkipTest
-                    for volume in cls.volume_id_list:
-                        cls.client.delete_volume(volume)
+                    for volid in cls.volume_id_list:
+                        cls.client.delete_volume(volid)
+                        cls.client.wait_for_resource_deletion(volid)
                     msg = ("Failed to create ALL necessary volumes to run "
                            "test. This typically means that the backing file "
                            "size of the nova-volumes group is too small to "
@@ -99,9 +100,9 @@
     @classmethod
     def tearDownClass(cls):
         # Delete the created volumes
-        for volume in cls.volume_id_list:
-            resp, _ = cls.client.delete_volume(volume)
-            cls.client.wait_for_resource_deletion(volume)
+        for volid in cls.volume_id_list:
+            resp, _ = cls.client.delete_volume(volid)
+            cls.client.wait_for_resource_deletion(volid)
         super(VolumeListTestXML, cls).tearDownClass()
 
 
@@ -133,8 +134,9 @@
                     # because the backing file size of the volume group is
                     # too small. So, here, we clean up whatever we did manage
                     # to create and raise a SkipTest
-                    for volume in cls.volume_id_list:
-                        cls.client.delete_volume(volume)
+                    for volid in cls.volume_id_list:
+                        cls.client.delete_volume(volid)
+                        cls.client.wait_for_resource_deletion(volid)
                     msg = ("Failed to create ALL necessary volumes to run "
                            "test. This typically means that the backing file "
                            "size of the nova-volumes group is too small to "
@@ -145,7 +147,7 @@
     @classmethod
     def tearDownClass(cls):
         # Delete the created volumes
-        for volume in cls.volume_id_list:
-            resp, _ = cls.client.delete_volume(volume)
-            cls.client.wait_for_resource_deletion(volume)
+        for volid in cls.volume_id_list:
+            resp, _ = cls.client.delete_volume(volid)
+            cls.client.wait_for_resource_deletion(volid)
         super(VolumeListTestJSON, cls).tearDownClass()