From e7a9a94da876b172b696b47805a1ee06d3646d5c Mon Sep 17 00:00:00 2001 From: jay vyas Date: Wed, 7 Oct 2020 09:51:42 -0400 Subject: [PATCH] simpler addition of nodeport basic validation --- test/e2e/framework/network/utils.go | 3 +++ test/e2e/network/networking.go | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/test/e2e/framework/network/utils.go b/test/e2e/framework/network/utils.go index 051456b6a0f..60a7a916e81 100644 --- a/test/e2e/framework/network/utils.go +++ b/test/e2e/framework/network/utils.go @@ -686,6 +686,9 @@ func (config *NetworkingTestConfig) setupCore(selector map[string]string) { config.createTestPods() epCount := len(config.EndpointPods) + + // Note that this is not O(n^2) in practice, because epCount SHOULD be < 10. In cases that epCount is > 10, this would be prohibitively large. + // Check maxNetProxyPodsCount for details. config.MaxTries = epCount*epCount + testTries framework.Logf("Setting MaxTries for pod polling to %v for networking test based on endpoint count %v", config.MaxTries, epCount) } diff --git a/test/e2e/network/networking.go b/test/e2e/network/networking.go index 69257b04c59..d0f879174a6 100644 --- a/test/e2e/network/networking.go +++ b/test/e2e/network/networking.go @@ -363,6 +363,16 @@ var _ = SIGDescribe("Networking", func() { } }) + // quick validation of udp, next test confirms that this services update as well after endpoints are removed, but is slower. + ginkgo.It("should support basic nodePort: udp functionality", func() { + config := e2enetwork.NewNetworkingTestConfig(f, true, false) + ginkgo.By(fmt.Sprintf("dialing(udp) %v (node) --> %v:%v (nodeIP) and getting ALL host endpoints", config.NodeIP, config.NodeIP, config.NodeUDPPort)) + err := config.DialFromNode("udp", config.NodeIP, config.NodeUDPPort, config.MaxTries, 0, config.EndpointHostnames()) + if err != nil { + framework.Failf("Failure validating that nodePort service WAS forwarding properly: %v", err) + } + }) + // Slow because we confirm that the nodePort doesn't serve traffic, which requires a period of polling. ginkgo.It("should update nodePort: udp [Slow]", func() { config := e2enetwork.NewNetworkingTestConfig(f, true, false)