Count service ports in quota negative tests
Related-Prod: PRODX-41247
Change-Id: I20a232e03e3a82fdd9f9186a5368701118b5b5c2
diff --git a/neutron_tempest_plugin/api/admin/test_quotas_negative.py b/neutron_tempest_plugin/api/admin/test_quotas_negative.py
index 9c37d92..ae7c60f 100644
--- a/neutron_tempest_plugin/api/admin/test_quotas_negative.py
+++ b/neutron_tempest_plugin/api/admin/test_quotas_negative.py
@@ -13,6 +13,7 @@
from neutron_lib import constants
from tempest.common import utils
from tempest.lib.common.utils import data_utils
+from tempest.lib.common.utils import test_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
@@ -24,6 +25,13 @@
class QuotasAdminNegativeTestJSON(test_quotas.QuotasTestBase):
+ def wait_network_ports(self, network_id, number):
+ def _wait_ports(network_id, number):
+ ports = self.admin_client.list_ports(
+ network_id=network_id)
+ return len(ports) == number
+ test_utils.call_until_true(_wait_ports, 90, 5, network_id, number)
+
@decorators.attr(type='negative')
@decorators.idempotent_id('952f9b24-9156-4bdc-90f3-682a3d4302f0')
def test_create_network_when_quotas_is_full(self):
@@ -74,6 +82,9 @@
'cidr': '10.0.0.0/24',
'ip_version': '4'}
subnet = self.admin_client.create_subnet(**subnet_args)['subnet']
+ self.wait_network_ports(subnet["network_id"],
+ CONF.network.service_ports_number)
+
self.addCleanup(self.admin_client.delete_subnet, subnet['id'])
ports = self.admin_client.list_ports(tenant_id=tenant_id)