You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/e2e/network/service.go
+39-77Lines changed: 39 additions & 77 deletions
Original file line number
Diff line number
Diff line change
@@ -932,11 +932,12 @@ var _ = SIGDescribe("Services", func() {
932
932
933
933
/*
934
934
Testname: Service, update NodePort, same port different protocol
935
-
Description: Create a service of type ClusterIP to accept TCP requests. Service creation MUST be successful by assigning ClusterIP to the service.
936
-
When service type is updated to NodePort to support two protocols i.e. TCP and UDP for same assigned service port 80, service update MUST be successful by allocating two NodePorts to the service.
937
-
TODO: Test Service reachability, good to include this check in Conformance perspective.
935
+
Description: Create a service to accept TCP requests. By default, created service MUST be of type ClusterIP and an ClusterIP MUST be assigned to the service.
936
+
When service type is updated to NodePort supporting TCP protocol, it MUST be reachable on nodeIP over allocated NodePort to serve TCP requests.
937
+
When this NodePort service is updated to use two protocols i.e. TCP and UDP for same assigned service port 80, service update MUST be successful by allocating two NodePorts to the service and
938
+
service MUST be able to serve both TCP and UDP requests over same service port 80.
938
939
*/
939
-
ginkgo.It("should be able to update NodePorts with two same port numbers but different protocols", func() {
940
+
ginkgo.It("should be able to update service type to NodePort listening on same port number but different protocols", func() {
940
941
serviceName:="nodeport-update-service"
941
942
ns:=f.Namespace.Name
942
943
jig:=e2eservice.NewTestJig(cs, serviceName)
@@ -949,36 +950,50 @@ var _ = SIGDescribe("Services", func() {
949
950
framework.ExpectNoError(err, "failed to delete service: %s in namespace: %s", serviceName, ns)
framework.ExpectEqual(nodePortCounts, 2, "updated service should have two Ports but found %d Ports", nodePortCounts)
980
993
981
-
framework.Logf("new service allocates NodePort %d for Port %s", port.NodePort, port.Name)
994
+
for_, port:=rangenodePortService.Spec.Ports {
995
+
framework.ExpectNotEqual(port.NodePort, 0, "NodePort service failed to allocate NodePort for Port %s", port.Name)
996
+
framework.Logf("NodePort service allocates NodePort: %d for Port: %s over Protocol: %s", port.NodePort, port.Name, port.Protocol)
982
997
}
983
998
})
984
999
@@ -1133,59 +1148,6 @@ var _ = SIGDescribe("Services", func() {
1133
1148
1134
1149
})
1135
1150
1136
-
/*
1137
-
Testname: Service, NodePort, same port different protocols
1138
-
Description: Create a service of type NodePort listening on port 53 for two protocols TCP and UDP.
1139
-
Service creation MUST be successful by assigning a ClusterIP and two unique nodePorts for each protocol, making service reachable on every node's IP and nodePort.
1140
-
TODO: Test Service reachability, good to include this check in Conformance perspective.
1141
-
*/
1142
-
ginkgo.It("should use same NodePort with same port but different protocols", func() {
1143
-
serviceName:="nodeports"
1144
-
ns:=f.Namespace.Name
1145
-
1146
-
t:=e2eservice.NewServerTest(cs, ns, serviceName)
1147
-
deferfunc() {
1148
-
deferginkgo.GinkgoRecover()
1149
-
errs:=t.Cleanup()
1150
-
iflen(errs) !=0 {
1151
-
framework.Failf("errors in cleanup: %v", errs)
1152
-
}
1153
-
}()
1154
-
1155
-
ginkgo.By("creating service "+serviceName+" with same NodePort but different protocols in namespace "+ns)
1156
-
service:=&v1.Service{
1157
-
ObjectMeta: metav1.ObjectMeta{
1158
-
Name: t.ServiceName,
1159
-
Namespace: t.Namespace,
1160
-
},
1161
-
Spec: v1.ServiceSpec{
1162
-
Selector: t.Labels,
1163
-
Type: v1.ServiceTypeNodePort,
1164
-
Ports: []v1.ServicePort{
1165
-
{
1166
-
Name: "tcp-port",
1167
-
Port: 53,
1168
-
Protocol: v1.ProtocolTCP,
1169
-
},
1170
-
{
1171
-
Name: "udp-port",
1172
-
Port: 53,
1173
-
Protocol: v1.ProtocolUDP,
1174
-
},
1175
-
},
1176
-
},
1177
-
}
1178
-
result, err:=t.CreateService(service)
1179
-
framework.ExpectNoError(err, "failed to create service: %s in namespace: %s", serviceName, ns)
1180
-
1181
-
iflen(result.Spec.Ports) !=2 {
1182
-
framework.Failf("got unexpected len(Spec.Ports) for new service: %v", result)
0 commit comments