Skip to content

Commit

Permalink
OCPBUGS-19433: Add ingress smoke test
Browse files Browse the repository at this point in the history
  • Loading branch information
pacevedom authored and openshift-cherrypick-robot committed Sep 20, 2023
1 parent 39c9823 commit a506424
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/assets/hello-microshift-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: hello-microshift
annotations:
haproxy.org/path-rewrite: /principal/(.*) /\1
spec:
rules:
- host: hello-microshift.cluster.local
http:
paths:
- path: /principal
pathType: Prefix
backend:
service:
name: hello-microshift
port:
number: 8080
23 changes: 23 additions & 0 deletions test/suites/standard/networking-smoke.robot
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Suite Teardown Teardown Suite With Namespace

Test Tags smoke

*** Variables ***
${HELLO_USHIFT_INGRESS} ./assets/hello-microshift-ingress.yaml

*** Test Cases ***
Router Smoke Test
Expand All @@ -31,6 +33,19 @@ Load Balancer Smoke Test
[Documentation] Verify that Load Balancer correctly exposes HTTP service
Verify Hello MicroShift LB

Ingress Smoke Test
[Documentation] Verify a simple ingress rule correctly exposes HTTP service
[Setup] Run Keywords
... Create Hello MicroShift Pod
... Expose Hello MicroShift
... Create Hello MicroShift Ingress

Wait Until Keyword Succeeds 10x 6s
... Access Hello Microshift ${HTTP_PORT} path="/principal"

[Teardown] Run Keywords
... Delete Hello MicroShift Ingress
... Delete Hello MicroShift Pod And Service

*** Keywords ***
Expose Hello MicroShift Service Via Route
Expand All @@ -41,3 +56,11 @@ Expose Hello MicroShift Service Via Route
Delete Hello MicroShift Route
[Documentation] Delete route for cleanup.
Oc Delete route/hello-microshift -n ${NAMESPACE}

Create Hello MicroShift Ingress
[Documentation] Create ingress rule.
Oc Create -f ${HELLO_USHIFT_INGRESS} -n ${NAMESPACE}

Delete Hello MicroShift Ingress
[Documentation] Delete ingress for cleanup.
Oc Delete -f ${HELLO_USHIFT_INGRESS} -n ${NAMESPACE}

0 comments on commit a506424

Please sign in to comment.