Correct 'list index out of range' in FloatingIPDetailsTestJSON
In FloatingIPDetailsTestJSON's resource_setup, 3 floating_ips
are created and appended to cls.floating_ip, but if
create_floating_ip failes, cls.floating_ip will be an empty list,
so in resource_cleanup we should not use 'range(3)', but should
iterate each item in cls.floating_ip.
Closes-Bug: #1632581
Change-Id: I24979f27305c75474825f8ecef2ed56b7171158e
diff --git a/tempest/api/compute/floating_ips/test_list_floating_ips.py b/tempest/api/compute/floating_ips/test_list_floating_ips.py
index 5738293..222bf18 100644
--- a/tempest/api/compute/floating_ips/test_list_floating_ips.py
+++ b/tempest/api/compute/floating_ips/test_list_floating_ips.py
@@ -41,8 +41,8 @@
@classmethod
def resource_cleanup(cls):
- for i in range(3):
- cls.client.delete_floating_ip(cls.floating_ip_id[i])
+ for f_id in cls.floating_ip_id:
+ cls.client.delete_floating_ip(f_id)
super(FloatingIPDetailsTestJSON, cls).resource_cleanup()
@test.idempotent_id('16db31c3-fb85-40c9-bbe2-8cf7b67ff99f')