Fix test_port_pool when namespace is created

A pod is needed to be created also for the case where trigger_namespace_upon_pod=False

Change-Id: I2af9e1d2be84ace03ccb7224a0c9357500123a20
This commit is contained in:
Itzik Brown 2021-12-27 09:44:53 +02:00
parent 13e740911c
commit 97af3a8d2e
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(