add more e2e sctp tests

Add more e2e SCTP tests for Services and intra-pod communication.
This commit is contained in:
Antonio Ojea 2020-11-11 16:54:55 +01:00
parent 3a6b4366a7
commit 19cf272b37
2 changed files with 55 additions and 5 deletions

View File

@ -29,7 +29,7 @@ var _ = ginkgo.Describe("[sig-network] Networking", func() {
ginkgo.Describe("Granular Checks: Pods", func() {
checkNodeConnectivity := func(config *e2enetwork.NetworkingTestConfig, protocol string, port int) {
checkPodToPodConnectivity := func(config *e2enetwork.NetworkingTestConfig, protocol string, port int) {
// breadth first poll to quickly estimate failure.
failedPodsByHost := map[string][]*v1.Pod{}
// First time, we'll quickly try all pods, breadth first.
@ -79,7 +79,7 @@ var _ = ginkgo.Describe("[sig-network] Networking", func() {
*/
framework.ConformanceIt("should function for intra-pod communication: http [NodeConformance]", func() {
config := e2enetwork.NewCoreNetworkingTestConfig(f, false)
checkNodeConnectivity(config, "http", e2enetwork.EndpointHTTPPort)
checkPodToPodConnectivity(config, "http", e2enetwork.EndpointHTTPPort)
})
/*
@ -90,7 +90,7 @@ var _ = ginkgo.Describe("[sig-network] Networking", func() {
*/
framework.ConformanceIt("should function for intra-pod communication: udp [NodeConformance]", func() {
config := e2enetwork.NewCoreNetworkingTestConfig(f, false)
checkNodeConnectivity(config, "udp", e2enetwork.EndpointUDPPort)
checkPodToPodConnectivity(config, "udp", e2enetwork.EndpointUDPPort)
})
/*
@ -126,5 +126,24 @@ var _ = ginkgo.Describe("[sig-network] Networking", func() {
}
}
})
// [Disruptive] because it conflicts with tests that call CheckSCTPModuleLoadedOnNodes
ginkgo.It("should function for intra-pod communication: sctp [LinuxOnly][Feature:SCTPConnectivity][Disruptive]", func() {
config := e2enetwork.NewNetworkingTestConfig(f, e2enetwork.EnableSCTP)
checkPodToPodConnectivity(config, "sctp", e2enetwork.EndpointSCTPPort)
})
// [Disruptive] because it conflicts with tests that call CheckSCTPModuleLoadedOnNodes
ginkgo.It("should function for node-pod communication: sctp [LinuxOnly][Feature:SCTPConnectivity][Disruptive]", func() {
ginkgo.Skip("Skipping SCTP node to pod test until DialFromNode supports SCTP #96482")
config := e2enetwork.NewNetworkingTestConfig(f, e2enetwork.EnableSCTP)
for _, endpointPod := range config.EndpointPods {
err := config.DialFromNode("sctp", endpointPod.Status.PodIP, e2enetwork.EndpointSCTPPort, config.MaxTries, 0, sets.NewString(endpointPod.Name))
if err != nil {
framework.Failf("Error dialing SCTP from node to pod: %v", err)
}
}
})
})
})

View File

@ -178,8 +178,7 @@ var _ = SIGDescribe("Networking", func() {
}
})
// Once basic tests checking for the sctp module not to be loaded are implemented, this
// needs to be marked as [Disruptive]
// [Disruptive] because it conflicts with tests that call CheckSCTPModuleLoadedOnNodes
ginkgo.It("should function for pod-Service: sctp [Feature:SCTPConnectivity][Disruptive]", func() {
config := e2enetwork.NewNetworkingTestConfig(f, e2enetwork.EnableSCTP)
ginkgo.By(fmt.Sprintf("dialing(sctp) %v --> %v:%v (config.clusterIP)", config.TestContainerPod.Name, config.ClusterIP, e2enetwork.ClusterSCTPPort))
@ -222,6 +221,22 @@ var _ = SIGDescribe("Networking", func() {
}
})
// [Disruptive] because it conflicts with tests that call CheckSCTPModuleLoadedOnNodes
ginkgo.It("should function for node-Service: sctp [Feature:SCTPConnectivity][Disruptive]", func() {
ginkgo.Skip("Skipping SCTP node to service test until DialFromNode supports SCTP #96482")
config := e2enetwork.NewNetworkingTestConfig(f, e2enetwork.EnableSCTP)
ginkgo.By(fmt.Sprintf("dialing(sctp) %v (node) --> %v:%v (config.clusterIP)", config.NodeIP, config.ClusterIP, e2enetwork.ClusterSCTPPort))
err := config.DialFromNode("sctp", config.ClusterIP, e2enetwork.ClusterSCTPPort, config.MaxTries, 0, config.EndpointHostnames())
if err != nil {
framework.Failf("failed dialing endpoint, %v", err)
}
ginkgo.By(fmt.Sprintf("dialing(sctp) %v (node) --> %v:%v (nodeIP)", config.NodeIP, config.NodeIP, config.NodeSCTPPort))
err = config.DialFromNode("sctp", config.NodeIP, config.NodeSCTPPort, config.MaxTries, 0, config.EndpointHostnames())
if err != nil {
framework.Failf("failed dialing endpoint, %v", err)
}
})
ginkgo.It("should function for endpoint-Service: http", func() {
config := e2enetwork.NewNetworkingTestConfig(f)
ginkgo.By(fmt.Sprintf("dialing(http) %v (endpoint) --> %v:%v (config.clusterIP)", config.EndpointPods[0].Name, config.ClusterIP, e2enetwork.ClusterHTTPPort))
@ -251,6 +266,22 @@ var _ = SIGDescribe("Networking", func() {
}
})
// [Disruptive] because it conflicts with tests that call CheckSCTPModuleLoadedOnNodes
ginkgo.It("should function for endpoint-Service: sctp [Feature:SCTPConnectivity][Disruptive]", func() {
config := e2enetwork.NewNetworkingTestConfig(f, e2enetwork.EnableSCTP)
ginkgo.By(fmt.Sprintf("dialing(sctp) %v (endpoint) --> %v:%v (config.clusterIP)", config.EndpointPods[0].Name, config.ClusterIP, e2enetwork.ClusterSCTPPort))
err := config.DialFromEndpointContainer("sctp", config.ClusterIP, e2enetwork.ClusterSCTPPort, config.MaxTries, 0, config.EndpointHostnames())
if err != nil {
framework.Failf("failed dialing endpoint, %v", err)
}
ginkgo.By(fmt.Sprintf("dialing(sctp) %v (endpoint) --> %v:%v (nodeIP)", config.EndpointPods[0].Name, config.NodeIP, config.NodeSCTPPort))
err = config.DialFromEndpointContainer("sctp", config.NodeIP, config.NodeSCTPPort, config.MaxTries, 0, config.EndpointHostnames())
if err != nil {
framework.Failf("failed dialing endpoint, %v", err)
}
})
// This test ensures that in a situation where multiple services exist with the same selector,
// deleting one of the services does not affect the connectivity of the remaining service
ginkgo.It("should function for multiple endpoint-Services with same selector", func() {