Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCTP testing: fixes and additions #96460

Merged
merged 2 commits into from Nov 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 22 additions & 3 deletions test/e2e/common/networking.go
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
})

/*
Expand All @@ -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)
})

/*
Expand Down Expand Up @@ -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() {
aojea marked this conversation as resolved.
Show resolved Hide resolved
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)
}
}
})

})
})
47 changes: 33 additions & 14 deletions test/e2e/network/networking.go
Expand Up @@ -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))
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -508,18 +539,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))
aojea marked this conversation as resolved.
Show resolved Hide resolved
message := "hello"
err := config.DialEchoFromTestContainer("sctp", config.TestContainerPod.Status.PodIP, e2enetwork.EndpointSCTPPort, config.MaxTries, 0, message)
aojea marked this conversation as resolved.
Show resolved Hide resolved
aojea marked this conversation as resolved.
Show resolved Hide resolved
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()
Expand Down