Merge "Changed minversion in tox to 3.18.0"
diff --git a/neutron_tempest_plugin/api/test_security_groups.py b/neutron_tempest_plugin/api/test_security_groups.py
index 94b6dbf..0970d83 100644
--- a/neutron_tempest_plugin/api/test_security_groups.py
+++ b/neutron_tempest_plugin/api/test_security_groups.py
@@ -240,12 +240,14 @@
def _create_security_group_rules(self, amount, port_index=1):
for i in range(amount):
- self.create_security_group_rule(**{
+ ingress_rule = self.create_security_group_rule(**{
'project_id': self.client.tenant_id,
'direction': 'ingress',
'port_range_max': port_index + i,
'port_range_min': port_index + i,
'protocol': 'tcp'})
+ self.addCleanup(
+ self.client.delete_security_group_rule, ingress_rule['id'])
def _increase_sg_rules_quota(self):
sg_rules_quota = self._get_sg_rules_quota()