tests: Separates DNS hosts entries test

At the moment, Windows cannot mount individual files into Containers, which means
that the Kubelet-managed hosts file cannot be mounted into the Container, causing
the "should provide DNS for the cluster" test to fail.

This test separates the hosts entries checks from the mentioned test to a new test.
This commit is contained in:
Claudiu Belu 2018-11-02 13:53:37 -07:00
parent bd8edc27db
commit cb9c594f98
2 changed files with 23 additions and 5 deletions

View File

@ -178,6 +178,7 @@ test/e2e/kubectl/kubectl.go: "should create a job from an image, then delete the
test/e2e/kubectl/kubectl.go: "should support proxy with --port 0"
test/e2e/kubectl/kubectl.go: "should support --unix-socket=/path"
test/e2e/network/dns.go: "should provide DNS for the cluster"
test/e2e/network/dns.go: "should provide /etc/hosts entries for the cluster"
test/e2e/network/dns.go: "should provide DNS for services"
test/e2e/network/proxy.go: "should proxy logs on node with explicit kubelet port using proxy subresource"
test/e2e/network/proxy.go: "should proxy logs on node using proxy subresource"

View File

@ -39,7 +39,7 @@ var _ = SIGDescribe("DNS", func() {
/*
Release : v1.9
Testname: DNS, cluster
Description: When a Pod is created, the pod MUST be able to resolve cluster dns entries such as kubernetes.default via DNS and /etc/hosts.
Description: When a Pod is created, the pod MUST be able to resolve cluster dns entries such as kubernetes.default via DNS.
*/
framework.ConformanceIt("should provide DNS for the cluster ", func() {
// All the names we need to be able to resolve.
@ -54,10 +54,8 @@ var _ = SIGDescribe("DNS", func() {
namesToResolve = append(namesToResolve, "google.com")
namesToResolve = append(namesToResolve, "metadata")
}
hostFQDN := fmt.Sprintf("%s.%s.%s.svc.%s", dnsTestPodHostName, dnsTestServiceName, f.Namespace.Name, framework.TestContext.ClusterDNSDomain)
hostEntries := []string{hostFQDN, dnsTestPodHostName}
wheezyProbeCmd, wheezyFileNames := createProbeCommand(namesToResolve, hostEntries, "", "wheezy", f.Namespace.Name, framework.TestContext.ClusterDNSDomain)
jessieProbeCmd, jessieFileNames := createProbeCommand(namesToResolve, hostEntries, "", "jessie", f.Namespace.Name, framework.TestContext.ClusterDNSDomain)
wheezyProbeCmd, wheezyFileNames := createProbeCommand(namesToResolve, nil, "", "wheezy", f.Namespace.Name, framework.TestContext.ClusterDNSDomain)
jessieProbeCmd, jessieFileNames := createProbeCommand(namesToResolve, nil, "", "jessie", f.Namespace.Name, framework.TestContext.ClusterDNSDomain)
By("Running these commands on wheezy: " + wheezyProbeCmd + "\n")
By("Running these commands on jessie: " + jessieProbeCmd + "\n")
@ -67,6 +65,25 @@ var _ = SIGDescribe("DNS", func() {
validateDNSResults(f, pod, append(wheezyFileNames, jessieFileNames...))
})
/*
Release : v1.14
Testname: DNS, cluster
Description: When a Pod is created, the pod MUST be able to resolve cluster dns entries such as kubernetes.default via /etc/hosts.
*/
framework.ConformanceIt("should provide /etc/hosts entries for the cluster [LinuxOnly]", func() {
hostFQDN := fmt.Sprintf("%s.%s.%s.svc.%s", dnsTestPodHostName, dnsTestServiceName, f.Namespace.Name, framework.TestContext.ClusterDNSDomain)
hostEntries := []string{hostFQDN, dnsTestPodHostName}
wheezyProbeCmd, wheezyFileNames := createProbeCommand(nil, hostEntries, "", "wheezy", f.Namespace.Name, framework.TestContext.ClusterDNSDomain)
jessieProbeCmd, jessieFileNames := createProbeCommand(nil, hostEntries, "", "jessie", f.Namespace.Name, framework.TestContext.ClusterDNSDomain)
By("Running these commands on wheezy: " + wheezyProbeCmd + "\n")
By("Running these commands on jessie: " + jessieProbeCmd + "\n")
// Run a pod which probes /etc/hosts and exposes the results by HTTP.
By("creating a pod to probe /etc/hosts")
pod := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd, dnsTestPodHostName, dnsTestServiceName)
validateDNSResults(f, pod, append(wheezyFileNames, jessieFileNames...))
})
/*
Release : v1.9
Testname: DNS, services