From 0a963b63026f9570f7fd3ac5af1a232881a7e2c9 Mon Sep 17 00:00:00 2001
From: Paul Abel
Date: Wed, 29 Nov 2023 11:52:23 +0000
Subject: [PATCH] fix cleanup of `tls-passthrough-custom-port` test
---
.gitignore | 1 +
Makefile | 5 +++++
tests/Makefile | 1 -
tests/suite/fixtures/ic_fixtures.py | 4 ++++
4 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/.gitignore b/.gitignore
index 711d23caac..9178f69b55 100644
--- a/.gitignore
+++ b/.gitignore
@@ -70,3 +70,4 @@ package.json
# kind kube-config
kube-local
+venv/
\ No newline at end of file
diff --git a/Makefile b/Makefile
index 17c7598ee2..4fb0557ea7 100644
--- a/Makefile
+++ b/Makefile
@@ -169,3 +169,8 @@ deps: ## Add missing and remove unused modules, verify deps and download them to
.PHONY: clean-cache
clean-cache: ## Clean go cache
@go clean -modcache
+
+.PHONY: rebuild-test-img ## Rebuild the python e2e test image
+rebuild-test-img:
+ cd tests && \
+ make build
diff --git a/tests/Makefile b/tests/Makefile
index 5ebbf7fbfb..fc4c4110d7 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -10,7 +10,6 @@ TEST_PREFIX = test-runner
KUBE_CONFIG_FOLDER = ${HOME}/.kube
KIND_KUBE_CONFIG_FOLDER = $(KUBE_CONFIG_FOLDER)/kind
SHOW_IC_LOGS = no
-PYTEST_ARGS =
DOCKERFILEPATH := ${ROOT_DIR}/tests/Dockerfile
IP_FAMILY = dual
TEST_TAG ?= latest ## The Tag to use for the test image. e.g. commitsha
diff --git a/tests/suite/fixtures/ic_fixtures.py b/tests/suite/fixtures/ic_fixtures.py
index a29724ea71..e3627fa4f2 100644
--- a/tests/suite/fixtures/ic_fixtures.py
+++ b/tests/suite/fixtures/ic_fixtures.py
@@ -80,6 +80,7 @@ def crd_ingress_controller(
"""
namespace = ingress_controller_prerequisites.namespace
name = "nginx-ingress"
+ orig_port = 0
try:
print("------------------------- Update ClusterRole -----------------------------------")
@@ -94,6 +95,7 @@ def crd_ingress_controller(
request.param.get("extra_args", None),
)
if request.param["type"] == "tls-passthrough-custom-port":
+ orig_port = ingress_controller_endpoint.port_ssl
ingress_controller_endpoint.port_ssl = ingress_controller_endpoint.custom_ssl_port
ensure_connection_to_public_endpoint(
ingress_controller_endpoint.public_ip,
@@ -114,6 +116,8 @@ def fin():
patch_rbac(kube_apis.rbac_v1, f"{DEPLOYMENTS}/rbac/rbac.yaml")
print("Remove the IC:")
delete_ingress_controller(kube_apis.apps_v1_api, name, cli_arguments["deployment-type"], namespace)
+ if request.param["type"] == "tls-passthrough-custom-port":
+ ingress_controller_endpoint.port_ssl = orig_port
request.addfinalizer(fin)