Merge "Fix test_port_pool when namespace is created"

This commit is contained in:
Zuul 2022-01-17 14:09:43 +00:00 committed by Gerrit Code Review
commit 871fe9ece6
1 changed files with 4 additions and 0 deletions

View File

@ -95,6 +95,7 @@ class TestPortPoolScenario(base.BaseKuryrScenarioTest):
pool_batch = self.PORTS_POOL_DEFAULT_DICT['ports_pool_batch']
if CONF.kuryr_kubernetes.trigger_namespace_upon_pod:
port_list_num = 1
# create a pod to test the port pool increase
pod_name1, _ = self.create_pod(namespace=namespace_name,
labels={'type': 'demo'})
subnet_id = self.get_subnet_id_for_ns(namespace_name)
@ -103,6 +104,9 @@ class TestPortPoolScenario(base.BaseKuryrScenarioTest):
port_list_num = self.check_initial_ports_num(subnet_id,
namespace_name,
pool_batch)
# create a pod to test the port pool increase
pod_name1, _ = self.create_pod(namespace=namespace_name,
labels={'type': 'demo'})
# port number should increase by ports_pool_batch value
updated_port_list_num = len(self.os_admin.ports_client.list_ports(