@@ -7,7 +7,7 @@ Resource ../../resources/oc.resource
77Suite Setup Setup Suite With Namespace
88Suite Teardown Teardown Suite With Namespace
99
10- Test Tags optional gateway-api robot:skip
10+ Test Tags optional gateway-api
1111
1212
1313*** Variables ***
@@ -25,9 +25,14 @@ Test Simple HTTP Route
2525 ... Setup Namespace
2626 ... Deploy Hello MicroShift
2727 Create Gateway ${GATEWAY_HOSTNAME } ${GATEWAY_PORT } ${NS_GATEWAY }
28- Create HTTP Route ${GATEWAY_HOSTNAME } ${NS_GATEWAY }
29- Wait Until Keyword Succeeds 20x 6s
30- ... Access Hello MicroShift Success ushift_port=${GATEWAY_PORT } hostname=${GATEWAY_HOSTNAME }
28+ ${gateway_ip } Create HTTP Route ${GATEWAY_HOSTNAME } ${NS_GATEWAY }
29+ Wait Until Keyword Succeeds
30+ ... 20x
31+ ... 6s
32+ ... Access Hello MicroShift Success
33+ ... ushift_port=${GATEWAY_PORT }
34+ ... hostname=${GATEWAY_HOSTNAME }
35+ ... ushift_ip=${gateway_ip }
3136 [Teardown] Run Keywords
3237 ... Delete Namespace
3338
@@ -65,6 +70,7 @@ Create Gateway
6570
6671Create HTTP Route
6772 [Documentation] Create an HTTP route using the given hostname and namespace. Waits for acceptance in a gateway.
73+ ... Returns the gateway service external IP.
6874 [Arguments] ${hostname } ${namespace }
6975 VAR ${tmp } /tmp/route.yaml
7076 VAR ${HOSTNAME } ${hostname } scope=TEST
@@ -73,11 +79,21 @@ Create HTTP Route
7379 ... Remove File ${tmp }
7480 Generate File From Template ${HTTP_ROUTE_MANIFEST_TMPL } ${tmp }
7581 Oc Apply -n ${namespace } -f ${tmp }
82+ ${gateway_ip } Wait For HTTPRoute And Gateway Ready ${namespace }
83+ RETURN ${gateway_ip }
7684
85+ Wait For HTTPRoute And Gateway Ready
86+ [Documentation] Wait for HTTPRoute acceptance and gateway readiness. Returns gateway service IP.
87+ [Arguments] ${namespace }
7788 Wait Until Keyword Succeeds 20x 6s
7889 ... Verify HTTPRoute Parent Accepted ${namespace }
7990 Wait Until Keyword Succeeds 20x 6s
8091 ... Verify HTTPRoute References Resolved ${namespace }
92+ Wait Until Keyword Succeeds 20x 6s
93+ ... Verify Gateway Programmed ${namespace }
94+ ${gateway_ip } Wait Until Keyword Succeeds 20x 6s
95+ ... Verify Gateway Service Has External IP ${namespace }
96+ RETURN ${gateway_ip }
8197
8298Verify HTTPRoute Parent Accepted
8399 [Documentation] Verify that the HTTPRoute is accepted by its parent gateway
@@ -97,6 +113,21 @@ Verify HTTPRoute References Resolved
97113 Should Not Contain ${result } False HTTPRoute references not resolved
98114 Should Not Contain ${result } Unknown HTTPRoute reference resolution status is unknown
99115
116+ Verify Gateway Programmed
117+ [Documentation] Verify that the gateway data plane is programmed and ready to receive traffic
118+ [Arguments] ${namespace }
119+ ${result } Run With Kubeconfig
120+ ... oc get gateway/test-gateway -n ${namespace } -o jsonpath='{.status.conditions[?(@.type=="Programmed")].status}'
121+ Should Be Equal As Strings ${result } True Gateway is not yet programmed
122+
123+ Verify Gateway Service Has External IP
124+ [Documentation] Verify that the gateway's LoadBalancer service has an external IP assigned and return it
125+ [Arguments] ${namespace }
126+ ${result } Run With Kubeconfig
127+ ... oc get svc test-gateway-openshift-gateway-api -n ${namespace } -o jsonpath='{.status.loadBalancer.ingress[0].ip}'
128+ Should Not Be Empty ${result } Gateway service does not have an external IP assigned
129+ RETURN ${result }
130+
100131Generate File From Template
101132 [Documentation] Generate file from template
102133 [Arguments] ${template_file } ${out_file }
0 commit comments