From 5b5847c9fbece719f62b626fd57998a442d9de60 Mon Sep 17 00:00:00 2001 From: Kalya Subramanian <42158129+ksubrmnn@users.noreply.github.com> Date: Thu, 8 Jul 2021 16:48:28 -0700 Subject: [PATCH] test(e2e): Configure e2e ports for OpenShift (#3748) * test(e2e): Configure e2e ports for OpenShift Signed-off-by: Kalya Subramanian (cherry picked from commit 6e19645f02c8414ad26914adf3284540a23a00ea) --- tests/e2e/constants.go | 6 ++++++ tests/e2e/e2e_trafficsplit_same_sa_test.go | 9 +++++---- 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 tests/e2e/constants.go diff --git a/tests/e2e/constants.go b/tests/e2e/constants.go new file mode 100644 index 0000000000..98b52014a1 --- /dev/null +++ b/tests/e2e/constants.go @@ -0,0 +1,6 @@ +package e2e + +const ( + // appPort is the port to be used for server and client applications + appPort = 14001 +) diff --git a/tests/e2e/e2e_trafficsplit_same_sa_test.go b/tests/e2e/e2e_trafficsplit_same_sa_test.go index e855ef27e1..962f0f9cc6 100644 --- a/tests/e2e/e2e_trafficsplit_same_sa_test.go +++ b/tests/e2e/e2e_trafficsplit_same_sa_test.go @@ -80,7 +80,8 @@ var _ = OSMDescribe("Test TrafficSplit where each backend shares the same Servic Namespace: serverNamespace, ReplicaCount: int32(serverReplicaSet), Image: "simonkowallik/httpbin", - Ports: []int{80}, + Ports: []int{appPort}, + Command: []string{"gunicorn", "-b", fmt.Sprintf("0.0.0.0:%d", appPort), "httpbin:app", "-k", "gevent"}, }) // Expose an env variable such as XHTTPBIN_X_POD_NAME: @@ -121,7 +122,7 @@ var _ = OSMDescribe("Test TrafficSplit where each backend shares the same Servic Command: []string{"/bin/bash", "-c", "--"}, Args: []string{"while true; do sleep 30; done;"}, Image: "songrgg/alpine-debug", - Ports: []int{80}, + Ports: []int{appPort}, }) _, err := Td.CreateServiceAccount(clientApp, &svcAccDef) @@ -164,7 +165,7 @@ var _ = OSMDescribe("Test TrafficSplit where each backend shares the same Servic _, _, trafficSplitService := Td.SimplePodApp(SimplePodAppDef{ Name: trafficSplitName, Namespace: serverNamespace, - Ports: []int{80}, + Ports: []int{appPort}, }) // Creating trafficsplit service in K8s @@ -211,7 +212,7 @@ var _ = OSMDescribe("Test TrafficSplit where each backend shares the same Servic SourceContainer: ns, // container_name == NS for this test // Targeting the trafficsplit FQDN - Destination: fmt.Sprintf("%s.%s", trafficSplitName, serverNamespace), + Destination: fmt.Sprintf("%s.%s:%d", trafficSplitName, serverNamespace, appPort), }) } }