Skip to content

Commit 13d5056

Browse files
committed
OCPBUGS-45192: Add e2e test for router service IP connectivity
1 parent 036d28e commit 13d5056

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

test/suites/standard1/networking-smoke.robot

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,25 @@ Router Smoke Test
3535
... Delete Hello MicroShift Pod And Service
3636
... Wait For Service Deletion With Timeout
3737

38+
Router Service IP Connectivity
39+
[Documentation] Verify that the router is accessible on all IP addresses
40+
... assigned to the router-default LoadBalancer service.
41+
[Setup] Run Keywords
42+
... Create Hello MicroShift Pod
43+
... Expose Hello MicroShift Service Via Route
44+
... Restart Router
45+
46+
@{ips}= Get Router Service IPs
47+
FOR ${ip} IN @{ips}
48+
Wait Until Keyword Succeeds 10x 6s
49+
... Access Hello MicroShift From Host ${ip} ${HTTP_PORT}
50+
END
51+
52+
[Teardown] Run Keywords
53+
... Delete Hello MicroShift Route
54+
... Delete Hello MicroShift Pod And Service
55+
... Wait For Service Deletion With Timeout
56+
3857
Load Balancer Smoke Test
3958
[Documentation] Verify that Load Balancer correctly exposes HTTP service
4059
Verify Hello MicroShift LB
@@ -57,6 +76,30 @@ Ingress Smoke Test
5776

5877

5978
*** Keywords ***
79+
Get Router Service IPs
80+
[Documentation] Get all IP addresses from the router-default LoadBalancer service
81+
... in the openshift-ingress namespace.
82+
${output}= Oc Get JsonPath
83+
... service
84+
... openshift-ingress
85+
... router-default
86+
... .status.loadBalancer.ingress[*].ip
87+
Should Not Be Empty ${output} Router service has no LoadBalancer ingress IPs
88+
@{ips}= Split String ${output}
89+
RETURN @{ips}
90+
91+
Access Hello MicroShift From Host
92+
[Documentation] Access hello-microshift from the MicroShift host via SSH using the given IP.
93+
[Arguments] ${router_ip} ${port} ${hostname}=${HOSTNAME}
94+
${ip}= Add Brackets If Ipv6 ${router_ip}
95+
${stdout} ${stderr} ${rc}= SSHLibrary.Execute Command
96+
... curl -k -i --connect-to "${hostname}::${ip}:" "http://${hostname}:${port}"
97+
... sudo=False return_rc=True return_stderr=True return_stdout=True
98+
Log Many ${stdout} ${stderr}
99+
Should Be Equal As Integers 0 ${rc}
100+
Should Match Regexp ${stdout} HTTP.*200
101+
Should Contain ${stdout} Hello MicroShift
102+
60103
Expose Hello MicroShift Service Via Route
61104
[Documentation] Expose the "hello microshift" application through the Route
62105
Oc Expose pod hello-microshift -n ${NAMESPACE}

0 commit comments

Comments
 (0)