Skip to content
Permalink
Browse files

Promote e2e testing session affinity for ClusterIP and NodePort servi…

…ces to Conformance
  • Loading branch information...
mgdevstack committed Apr 11, 2019
1 parent 2ad2795 commit a43439255e522af448976464f48150cb8344f24a
Showing with 46 additions and 8 deletions.
  1. +4 −0 test/conformance/testdata/conformance.txt
  2. +42 −8 test/e2e/network/service.go
@@ -219,6 +219,10 @@ test/e2e/network/service.go: "should provide secure master service"
test/e2e/network/service.go: "should serve a basic endpoint from pods"
test/e2e/network/service.go: "should serve multiport endpoints from pods"
test/e2e/network/service.go: "should be able to create a functioning NodePort service"
test/e2e/network/service.go: "should have session affinity work for service with type clusterIP"
test/e2e/network/service.go: "should be able to switch session affinity for service with type clusterIP"
test/e2e/network/service.go: "should have session affinity work for NodePort service"
test/e2e/network/service.go: "should be able to switch session affinity for NodePort service"
test/e2e/network/service_latency.go: "should not be very high"
test/e2e/node/events.go: "should be sent by kubelets and the scheduler about pods scheduling and running"
test/e2e/node/pods.go: "should be submitted and removed"
@@ -1736,26 +1736,60 @@ var _ = SIGDescribe("Services", func() {
}
})

ginkgo.It("should have session affinity work for service with type clusterIP", func() {
svc := getServeHostnameService("affinity-clusterip")
/*
Release: v1.16
Testname: Service, ClusterIP type, session affinity ON
Description: Create a service of type "ClusterIP". Service's sessionAffinity is set to "ClientIP". Service creation MUST be successful by assigning "ClusterIP" to the service.
Create a Replication Controller to ensure that 3 pods are running and are targeted by the service to serve hostname of the pod when requests are sent to the service.
Create another pod to make requests to the service. Service MUST serve the hostname from the same pod of the replica for all consecutive requests.
Service MUST be reachable over serviceName and the ClusterIP on servicePort.
*/
framework.ConformanceIt("should have session affinity work for service with type clusterIP", func() {
svc := getServeHostnameService("service")
svc.Spec.Type = v1.ServiceTypeClusterIP
execAffinityTestForNonLBService(f, cs, svc)
})

ginkgo.It("should be able to switch session affinity for service with type clusterIP", func() {
svc := getServeHostnameService("affinity-clusterip-transition")
/*
Release: v1.16
Testname: Service, ClusterIP type, session affinity OFF
Description: Create a service of type "ClusterIP". Service's sessionAffinity is set to "ClientIP". Service creation MUST be successful by assigning "ClusterIP" to the service.
Create a Replication Controller to ensure that 3 pods are running and are targeted by the service to serve hostname of the pod when requests are sent to the service.
Create another pod to make requests to the service. Update the service's sessionAffinity to "None". Service update MUST be successful. When a requests are made to the service, it MUST be able serve the hostname from any pod of the replica.
When service's sessionAffinily is updated back to "ClientIP", service MUST serve the hostname from the same pod of the replica for all consecutive requests.
Service MUST be reachable over serviceName and the ClusterIP on servicePort.
*/
framework.ConformanceIt("should be able to switch session affinity for service with type clusterIP", func() {
svc := getServeHostnameService("service")
svc.Spec.Type = v1.ServiceTypeClusterIP
execAffinityTestForNonLBServiceWithTransition(f, cs, svc)
})

ginkgo.It("should have session affinity work for NodePort service", func() {
svc := getServeHostnameService("affinity-nodeport")
/*
Release: v1.16
Testname: Service, NodePort type, session affinity ON
Description: Create a service of type "NodePort" and provide service port and protocol. Service's sessionAffinity is set to "ClientIP". Service creation MUST be successful by assigning a "ClusterIP" to service and allocating NodePort on all nodes.
Create a Replication Controller to ensure that 3 pods are running and are targeted by the service to serve hostname of the pod when a requests are sent to the service.
Create another pod to make requests to the service on node's IP and NodePort. Service MUST serve the hostname from the same pod of the replica for all consecutive requests.
Service MUST be reachable over serviceName and the ClusterIP on servicePort. Service MUST also be reachable over node's IP on NodePort.
*/
framework.ConformanceIt("should have session affinity work for NodePort service", func() {
svc := getServeHostnameService("service")
svc.Spec.Type = v1.ServiceTypeNodePort
execAffinityTestForNonLBService(f, cs, svc)
})

ginkgo.It("should be able to switch session affinity for NodePort service", func() {
svc := getServeHostnameService("affinity-nodeport-transition")
/*
Release: v1.16
Testname: Service, NodePort type, session affinity OFF
Description: Create a service of type "NodePort" and provide service port and protocol. Service's sessionAffinity is set to "ClientIP". Service creation MUST be successful by assigning a "ClusterIP" to the service and allocating NodePort on all the nodes.
Create a Replication Controller to ensure that 3 pods are running and are targeted by the service to serve hostname of the pod when requests are sent to the service.
Create another pod to make requests to the service. Update the service's sessionAffinity to "None". Service update MUST be successful. When a requests are made to the service on node's IP and NodePort, service MUST be able serve the hostname from any pod of the replica.
When service's sessionAffinily is updated back to "ClientIP", service MUST serve the hostname from the same pod of the replica for all consecutive requests.
Service MUST be reachable over serviceName and the ClusterIP on servicePort. Service MUST also be reachable over node's IP on NodePort.
*/
framework.ConformanceIt("should be able to switch session affinity for NodePort service", func() {
svc := getServeHostnameService("service")
svc.Spec.Type = v1.ServiceTypeNodePort
execAffinityTestForNonLBServiceWithTransition(f, cs, svc)
})

0 comments on commit a434392

Please sign in to comment.
You can’t perform that action at this time.