Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ensure connections #1539

Merged
merged 2 commits into from
Apr 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/suite/resources_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1047,9 +1047,9 @@ def ensure_connection(request_url, expected_code=404) -> None:
:param expected_code: response code
:return:
"""
for _ in range(4):
for _ in range(10):
try:
resp = requests.get(request_url, verify=False)
resp = requests.get(request_url, verify=False, timeout=5)
if resp.status_code == expected_code:
return
except Exception as ex:
Expand Down
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