Skip to content

Commit 8a051e2

Browse files
Merge pull request #2377 from openshift-cherrypick-robot/cherry-pick-2375-to-release-4.14
[release-4.14] OCPBUGS-19518: Add ingress smoke test
2 parents 9ecf0dd + f2b750a commit 8a051e2

File tree

3 files changed

+51
-2
lines changed

3 files changed

+51
-2
lines changed
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: networking.k8s.io/v1
2+
kind: Ingress
3+
metadata:
4+
name: hello-microshift
5+
annotations:
6+
haproxy.org/path-rewrite: /principal/(.*) /\1
7+
spec:
8+
rules:
9+
- host: hello-microshift.cluster.local
10+
http:
11+
paths:
12+
- path: /principal
13+
pathType: Prefix
14+
backend:
15+
service:
16+
name: hello-microshift
17+
port:
18+
number: 8080

test/resources/microshift-network.resource

+7-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ Create Hello MicroShift Pod
1818
Oc Create -f ${HELLO_USHIFT} -n ${NAMESPACE}
1919
Oc Wait For pods -l app=hello-microshift condition\=Ready timeout=300s
2020

21+
Expose Hello MicroShift
22+
[Documentation] Expose the "hello microshift" application via cluster ip service
23+
Run With Kubeconfig oc expose pod hello-microshift -n ${NAMESPACE}
24+
2125
Expose Hello MicroShift Pod Via LB
2226
[Documentation] Expose the "hello microshift" application through the load balancer
2327
Run With Kubeconfig oc create service loadbalancer hello-microshift --tcp=${LB_PORT}:8080 -n ${NAMESPACE}
@@ -29,12 +33,13 @@ Expose Hello MicroShift Pod Via NodePort
2933

3034
Access Hello Microshift
3135
[Documentation] Try to retrieve data from the "hello microshift" service end point
32-
[Arguments] ${ushift_port} ${ushift_ip}=${USHIFT_HOST}
36+
[Arguments] ${ushift_port} ${ushift_ip}=${USHIFT_HOST} ${path}=${EMPTY}
3337

3438
${connect_to}= Set Variable "hello-microshift.cluster.local:${HTTP_PORT}:${ushift_ip}:${ushift_port}"
39+
${url_path}= Set Variable "http://hello-microshift.cluster.local${path}"
3540

3641
${result}= Run Process
37-
... curl -i http://hello-microshift.cluster.local --connect-to ${connect_to}
42+
... curl -i ${url_path} --connect-to ${connect_to}
3843
... shell=True
3944
... timeout=15s
4045
Log Many ${result.rc} ${result.stdout} ${result.stderr}

test/suites/standard/networking-smoke.robot

+26
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ Suite Teardown Teardown Suite With Namespace
1212
Test Tags smoke
1313

1414

15+
*** Variables ***
16+
${HELLO_USHIFT_INGRESS} ./assets/hello-microshift-ingress.yaml
17+
18+
1519
*** Test Cases ***
1620
Router Smoke Test
1721
[Documentation] Run a router smoke test
@@ -31,6 +35,20 @@ Load Balancer Smoke Test
3135
[Documentation] Verify that Load Balancer correctly exposes HTTP service
3236
Verify Hello MicroShift LB
3337

38+
Ingress Smoke Test
39+
[Documentation] Verify a simple ingress rule correctly exposes HTTP service
40+
[Setup] Run Keywords
41+
... Create Hello MicroShift Pod
42+
... Expose Hello MicroShift
43+
... Create Hello MicroShift Ingress
44+
45+
Wait Until Keyword Succeeds 10x 6s
46+
... Access Hello Microshift ${HTTP_PORT} path="/principal"
47+
48+
[Teardown] Run Keywords
49+
... Delete Hello MicroShift Ingress
50+
... Delete Hello MicroShift Pod And Service
51+
3452

3553
*** Keywords ***
3654
Expose Hello MicroShift Service Via Route
@@ -41,3 +59,11 @@ Expose Hello MicroShift Service Via Route
4159
Delete Hello MicroShift Route
4260
[Documentation] Delete route for cleanup.
4361
Oc Delete route/hello-microshift -n ${NAMESPACE}
62+
63+
Create Hello MicroShift Ingress
64+
[Documentation] Create ingress rule.
65+
Oc Create -f ${HELLO_USHIFT_INGRESS} -n ${NAMESPACE}
66+
67+
Delete Hello MicroShift Ingress
68+
[Documentation] Delete ingress for cleanup.
69+
Oc Delete -f ${HELLO_USHIFT_INGRESS} -n ${NAMESPACE}

0 commit comments

Comments
 (0)