Skip to content

Commit 4747212

Browse files
committed
USHIFT-6640: Update gateway api test
1 parent 1dee3d9 commit 4747212

1 file changed

Lines changed: 21 additions & 8 deletions

File tree

test/suites/optional/gateway-api.robot

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ 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}
28+
${gateway_ip} Create HTTP Route ${GATEWAY_HOSTNAME} ${NS_GATEWAY}
2929
Wait Until Keyword Succeeds 20x 6s
30-
... Access Hello MicroShift Success ushift_port=${GATEWAY_PORT} hostname=${GATEWAY_HOSTNAME}
30+
... Access Hello MicroShift Success ushift_port=${GATEWAY_PORT} hostname=${GATEWAY_HOSTNAME} ushift_ip=${gateway_ip}
3131
[Teardown] Run Keywords
3232
... Delete Namespace
3333

@@ -65,6 +65,7 @@ Create Gateway
6565

6666
Create HTTP Route
6767
[Documentation] Create an HTTP route using the given hostname and namespace. Waits for acceptance in a gateway.
68+
... Returns the gateway service external IP.
6869
[Arguments] ${hostname} ${namespace}
6970
VAR ${tmp} /tmp/route.yaml
7071
VAR ${HOSTNAME} ${hostname} scope=TEST
@@ -79,7 +80,10 @@ Create HTTP Route
7980
Wait Until Keyword Succeeds 20x 6s
8081
... Verify HTTPRoute References Resolved ${namespace}
8182
Wait Until Keyword Succeeds 20x 6s
82-
... Verify Gateway Port Listening ${GATEWAY_PORT}
83+
... Verify Gateway Programmed ${namespace}
84+
${gateway_ip} Wait Until Keyword Succeeds 20x 6s
85+
... Verify Gateway Service Has External IP ${namespace}
86+
RETURN ${gateway_ip}
8387

8488
Verify HTTPRoute Parent Accepted
8589
[Documentation] Verify that the HTTPRoute is accepted by its parent gateway
@@ -99,11 +103,20 @@ Verify HTTPRoute References Resolved
99103
Should Not Contain ${result} False HTTPRoute references not resolved
100104
Should Not Contain ${result} Unknown HTTPRoute reference resolution status is unknown
101105

102-
Verify Gateway Port Listening
103-
[Documentation] Verify that the gateway port is accepting connections on the host.
104-
[Arguments] ${port}
105-
${rc}= Run And Return Rc nc -z -w 5 ${USHIFT_HOST} ${port}
106-
Should Be Equal As Integers ${rc} 0 Gateway port ${port} is not listening
106+
Verify Gateway Programmed
107+
[Documentation] Verify that the gateway data plane is programmed and ready to receive traffic
108+
[Arguments] ${namespace}
109+
${result} Run With Kubeconfig
110+
... oc get gateway/test-gateway -n ${namespace} -o jsonpath='{.status.conditions[?(@.type=="Programmed")].status}'
111+
Should Be Equal As Strings ${result} True Gateway is not yet programmed
112+
113+
Verify Gateway Service Has External IP
114+
[Documentation] Verify that the gateway's LoadBalancer service has an external IP assigned and return it
115+
[Arguments] ${namespace}
116+
${result} Run With Kubeconfig
117+
... oc get svc test-gateway-openshift-gateway-api -n ${namespace} -o jsonpath='{.status.loadBalancer.ingress[0].ip}'
118+
Should Not Be Empty ${result} Gateway service does not have an external IP assigned
119+
RETURN ${result}
107120

108121
Generate File From Template
109122
[Documentation] Generate file from template

0 commit comments

Comments
 (0)