Skip to content

Commit

Permalink
Ensure connection in Ingress TLS tests
Browse files Browse the repository at this point in the history
Ensure connection to NGINX before running tests.
Without ensuring, sometimes the first connection to NGINX would
hang (timeout). The problem is noticable when running tests in
kind.
  • Loading branch information
pleshakov committed Apr 20, 2021
1 parent 3d5265a commit 78bd423
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/suite/test_tls.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest

from suite.resources_utils import create_ingress_from_yaml, delete_items_from_yaml, wait_before_test, \
create_secret_from_yaml, delete_secret, replace_secret, is_secret_present
create_secret_from_yaml, delete_secret, replace_secret, is_secret_present, ensure_connection_to_public_endpoint
from suite.yaml_utils import get_first_ingress_host_from_yaml, get_name_from_yaml
from suite.ssl_utils import get_server_certificate_subject
from settings import TEST_DATA
Expand Down Expand Up @@ -58,6 +58,9 @@ def tls_setup(request, kube_apis, ingress_controller_prerequisites, ingress_cont
ingress_host = get_first_ingress_host_from_yaml(ingress_path)
secret_name = get_name_from_yaml(f"{test_data_path}/tls-secret.yaml")

ensure_connection_to_public_endpoint(ingress_controller_endpoint.public_ip, ingress_controller_endpoint.port,
ingress_controller_endpoint.port_ssl)

def fin():
print("Clean up TLS setup")
delete_items_from_yaml(kube_apis, ingress_path, test_namespace)
Expand Down

0 comments on commit 78bd423

Please sign in to comment.