From 3a6b4366a79f11cebeb60d094e91a23c9d500e68 Mon Sep 17 00:00:00 2001 From: Antonio Ojea Date: Wed, 11 Nov 2020 13:52:46 +0100 Subject: [PATCH 1/2] remove wrong test for SCTP connectivity the test tries to test the connectivity between two pods, but it acually test the connectivity against itself. --- test/e2e/network/networking.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/test/e2e/network/networking.go b/test/e2e/network/networking.go index 4fbbe993404..993965495df 100644 --- a/test/e2e/network/networking.go +++ b/test/e2e/network/networking.go @@ -508,18 +508,6 @@ 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] - ginkgo.It("should function for pod-pod: 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)) - message := "hello" - err := config.DialEchoFromTestContainer("sctp", config.TestContainerPod.Status.PodIP, e2enetwork.EndpointSCTPPort, config.MaxTries, 0, message) - if err != nil { - framework.Failf("failed dialing endpoint, %v", err) - } - }) - ginkgo.It("should recreate its iptables rules if they are deleted [Disruptive]", func() { e2eskipper.SkipUnlessProviderIs(framework.ProvidersWithSSH...) e2eskipper.SkipUnlessSSHKeyPresent() From 19cf272b377409cb1376406934e53e4639c20b1b Mon Sep 17 00:00:00 2001 From: Antonio Ojea Date: Wed, 11 Nov 2020 16:54:55 +0100 Subject: [PATCH 2/2] add more e2e sctp tests Add more e2e SCTP tests for Services and intra-pod communication. --- test/e2e/common/networking.go | 25 +++++++++++++++++++++--- test/e2e/network/networking.go | 35 ++++++++++++++++++++++++++++++++-- 2 files changed, 55 insertions(+), 5 deletions(-) diff --git a/test/e2e/common/networking.go b/test/e2e/common/networking.go index 4774526015a..6af8233b831 100644 --- a/test/e2e/common/networking.go +++ b/test/e2e/common/networking.go @@ -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) + } + } + }) + }) }) diff --git a/test/e2e/network/networking.go b/test/e2e/network/networking.go index 993965495df..eb6b67f3688 100644 --- a/test/e2e/network/networking.go +++ b/test/e2e/network/networking.go @@ -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() {