Make test_create_port_when_quotas_is_full more generic

This patch is making the test test_create_port_when_quotas_is_full more
generic to work with different ML2 drivers.

The test is being changed to set the quotas to the number of existing
ports + 1, instead of having it hardcoded to 1. The reason for that is
because the ML2/OVN driver does create a port to be used by the metadata
service upon creating a new network. That would then already fulfil the
ports quota for that tenant.

This approach was suggested at
http://lists.openstack.org/pipermail/openstack-dev/2018-April/129084.html

Closes-Bug: #1761119
Change-Id: I86fe55eb48b9964b33d4b5174a248676129abfb1
diff --git a/neutron_tempest_plugin/api/admin/test_quotas_negative.py b/neutron_tempest_plugin/api/admin/test_quotas_negative.py
index 2267313..7d699d1 100644
--- a/neutron_tempest_plugin/api/admin/test_quotas_negative.py
+++ b/neutron_tempest_plugin/api/admin/test_quotas_negative.py
@@ -63,9 +63,6 @@
     @decorators.idempotent_id('fe20d9f9-346c-4a20-bbfa-d9ca390f4dc6')
     def test_create_port_when_quotas_is_full(self):
         tenant_id = self.create_project()['id']
-        new_quotas = {'port': 1}
-        self._setup_quotas(tenant_id, **new_quotas)
-
         net_args = {'tenant_id': tenant_id}
         net = self.admin_client.create_network(**net_args)['network']
         self.addCleanup(self.admin_client.delete_network, net['id'])
@@ -78,6 +75,11 @@
         subnet = self.admin_client.create_subnet(**subnet_args)['subnet']
         self.addCleanup(self.admin_client.delete_subnet, subnet['id'])
 
+        ports = self.admin_client.list_ports(tenant_id=tenant_id)
+        quota_limit = len(ports['ports']) + 1
+        new_quotas = {'port': quota_limit}
+        self._setup_quotas(tenant_id, **new_quotas)
+
         port_args = {'tenant_id': tenant_id,
                      'network_id': net['id']}
         port = self.admin_client.create_port(**port_args)['port']