Merge pull request #102963 from andrewsykim/granular-services-remove-internet-tests

test/e2e/network: remove dependency to google.com for in-cluster networking tests
This commit is contained in:
Kubernetes Prow Robot 2021-06-21 10:06:51 -07:00 committed by GitHub
commit 0f4fd721e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,6 @@ package network
import (
"context"
"fmt"
"net/http"
"strconv"
"strings"
@ -81,20 +80,6 @@ var _ = common.SIGDescribe("Networking", func() {
var svcname = "nettest"
f := framework.NewDefaultFramework(svcname)
ginkgo.BeforeEach(func() {
// Assert basic external connectivity.
// Since this is not really a test of kubernetes in any way, we
// leave it as a pre-test assertion, rather than a Ginko test.
ginkgo.By("Executing a successful http request from the external internet")
resp, err := http.Get("http://google.com")
if err != nil {
framework.Failf("Unable to connect/talk to the internet: %v", err)
}
if resp.StatusCode != http.StatusOK {
framework.Failf("Unexpected error code, expected 200, got, %v (%v)", resp.StatusCode, resp)
}
})
ginkgo.It("should provide Internet connection for containers [Feature:Networking-IPv4]", func() {
ginkgo.By("Running container which tries to connect to 8.8.8.8")
framework.ExpectNoError(
@ -109,6 +94,12 @@ var _ = common.SIGDescribe("Networking", func() {
checkConnectivityToHost(f, "", "connectivity-test", "2001:4860:4860::8888", 53, 30))
})
ginkgo.It("should provider Internet connection for containers using DNS [Feature:Networking-DNS]", func() {
ginkgo.By("Running container which tries to connect to google.com")
framework.ExpectNoError(
checkConnectivityToHost(f, "", "connectivity-test", "google.com", 80, 30))
})
// First test because it has no dependencies on variables created later on.
ginkgo.It("should provide unchanging, static URL paths for kubernetes api services", func() {
tests := []struct {