Merge "Improve test_egress_np_to_service_wo_selectors"

This commit is contained in:
Zuul 2022-02-24 11:40:12 +00:00 committed by Gerrit Code Review
commit 85807e55a9
1 changed files with 7 additions and 4 deletions

View File

@ -342,10 +342,9 @@ class ServiceWOSelectorsNPScenario(base.BaseKuryrScenarioTest):
start = time.time() start = time.time()
while time.time() - start < TIMEOUT_PERIOD: while time.time() - start < TIMEOUT_PERIOD:
try: try:
time.sleep(1) time.sleep(5)
_, crd_pod_selector, _ = self.get_np_crd_info(np_name, _, _, ready = self.get_np_crd_info(np_name, client_ns_name)
client_ns_name) if ready:
if crd_pod_selector:
break break
except kubernetes.client.rest.ApiException as e: except kubernetes.client.rest.ApiException as e:
LOG.info("ApiException ocurred: %s" % e.body) LOG.info("ApiException ocurred: %s" % e.body)
@ -355,6 +354,10 @@ class ServiceWOSelectorsNPScenario(base.BaseKuryrScenarioTest):
np_name, KURYR_NETWORK_POLICY_CRD_PLURAL) np_name, KURYR_NETWORK_POLICY_CRD_PLURAL)
raise lib_exc.TimeoutException(msg) raise lib_exc.TimeoutException(msg)
# Even though the SG rules are up it might still take a moment until
# they're enforced.
time.sleep(10)
# after applying NP, we still should have an access from client to the # after applying NP, we still should have an access from client to the
# service with matched labels, # service with matched labels,
self.assertIn(consts.POD_OUTPUT, self.assertIn(consts.POD_OUTPUT,