diff --git a/hack/verify-flags/exceptions.txt b/hack/verify-flags/exceptions.txt index 2eede332961..a27cf2534ae 100644 --- a/hack/verify-flags/exceptions.txt +++ b/hack/verify-flags/exceptions.txt @@ -95,14 +95,14 @@ pkg/util/oom/oom_linux.go: oomScoreAdjPath := path.Join("/proc", pidStr, "oom_sc pkg/util/oom/oom_linux.go:// Writes 'value' to /proc//oom_score_adj for all processes in cgroup cgroupName. pkg/util/oom/oom_linux.go:// Writes 'value' to /proc//oom_score_adj. PID = 0 means self test/e2e/configmap.go: Command: []string{"/mt", "--break_on_expected_content=false", "--retry_time=120", "--file_content_in_loop=/etc/configmap-volume/data-1"}, -test/e2e/downwardapi_volume.go: Command: []string{"/mt", "--break_on_expected_content=false", "--retry_time=120", "--file_content_in_loop=" + filePath}, +test/e2e/common/downwardapi_volume.go: Command: []string{"/mt", "--break_on_expected_content=false", "--retry_time=120", "--file_content_in_loop=" + filePath}, test/e2e/es_cluster_logging.go: framework.Failf("No cluster_name field in Elasticsearch response: %v", esResponse) test/e2e/es_cluster_logging.go: // Check to see if have a cluster_name field. test/e2e/es_cluster_logging.go: clusterName, ok := esResponse["cluster_name"] -test/e2e/host_path.go: fmt.Sprintf("--file_content_in_loop=%v", filePath), -test/e2e/host_path.go: fmt.Sprintf("--file_content_in_loop=%v", filePathInReader), -test/e2e/host_path.go: fmt.Sprintf("--retry_time=%d", retryDuration), -test/e2e/host_path.go: fmt.Sprintf("--retry_time=%d", retryDuration), +test/e2e/common/host_path.go: fmt.Sprintf("--file_content_in_loop=%v", filePath), +test/e2e/common/host_path.go: fmt.Sprintf("--file_content_in_loop=%v", filePathInReader), +test/e2e/common/host_path.go: fmt.Sprintf("--retry_time=%d", retryDuration), +test/e2e/common/host_path.go: fmt.Sprintf("--retry_time=%d", retryDuration), test/e2e_node/configmap_test.go: Command: []string{"/mt", "--break_on_expected_content=false", "--retry_time=120", "--file_content_in_loop=/etc/configmap-volume/data-1"}, test/images/mount-tester/mt.go: flag.BoolVar(&breakOnExpectedContent, "break_on_expected_content", true, "Break out of loop on expected content, (use with --file_content_in_loop flag only)") test/images/mount-tester/mt.go: flag.IntVar(&retryDuration, "retry_time", 180, "Retry time during the loop") diff --git a/test/e2e/downwardapi_volume.go b/test/e2e/common/downwardapi_volume.go similarity index 92% rename from test/e2e/downwardapi_volume.go rename to test/e2e/common/downwardapi_volume.go index 13e2e5fc96e..7154fc64a2e 100644 --- a/test/e2e/downwardapi_volume.go +++ b/test/e2e/common/downwardapi_volume.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package e2e +package common import ( "fmt" @@ -32,8 +32,12 @@ import ( var _ = framework.KubeDescribe("Downward API volume", func() { // How long to wait for a log pod to be displayed const podLogTimeout = 45 * time.Second - f := framework.NewDefaultFramework("downward-api") + var podClient *framework.PodClient + BeforeEach(func() { + podClient = f.PodClient() + }) + It("should provide podname only [Conformance]", func() { podName := "downwardapi-volume-" + string(uuid.NewUUID()) pod := downwardAPIVolumePodForSimpleTest(podName, "/etc/podname") @@ -67,13 +71,10 @@ var _ = framework.KubeDescribe("Downward API volume", func() { containerName := "client-container" defer func() { By("Deleting the pod") - f.Client.Pods(f.Namespace.Name).Delete(pod.Name, api.NewDeleteOptions(0)) + podClient.Delete(pod.Name, api.NewDeleteOptions(0)) }() By("Creating the pod") - pod, err := f.Client.Pods(f.Namespace.Name).Create(pod) - Expect(err).NotTo(HaveOccurred()) - - framework.ExpectNoError(framework.WaitForPodRunningInNamespace(f.Client, pod)) + podClient.CreateSync(pod) Eventually(func() (string, error) { return framework.GetPodLogs(f.Client, f.Namespace.Name, podName, containerName) @@ -81,7 +82,7 @@ var _ = framework.KubeDescribe("Downward API volume", func() { podLogTimeout, framework.Poll).Should(ContainSubstring("key1=\"value1\"\n")) //modify labels - f.PodClient().Update(podName, func(pod *api.Pod) { + podClient.Update(podName, func(pod *api.Pod) { pod.Labels["key3"] = "value3" }) @@ -100,14 +101,12 @@ var _ = framework.KubeDescribe("Downward API volume", func() { containerName := "client-container" defer func() { By("Deleting the pod") - f.Client.Pods(f.Namespace.Name).Delete(pod.Name, api.NewDeleteOptions(0)) + podClient.Delete(pod.Name, api.NewDeleteOptions(0)) }() By("Creating the pod") - pod, err := f.Client.Pods(f.Namespace.Name).Create(pod) - Expect(err).NotTo(HaveOccurred()) - framework.ExpectNoError(framework.WaitForPodRunningInNamespace(f.Client, pod)) + podClient.CreateSync(pod) - pod, err = f.Client.Pods(f.Namespace.Name).Get(pod.Name) + pod, err := podClient.Get(pod.Name) Expect(err).NotTo(HaveOccurred()) Eventually(func() (string, error) { @@ -116,7 +115,7 @@ var _ = framework.KubeDescribe("Downward API volume", func() { podLogTimeout, framework.Poll).Should(ContainSubstring("builder=\"bar\"\n")) //modify annotations - f.PodClient().Update(podName, func(pod *api.Pod) { + podClient.Update(podName, func(pod *api.Pod) { pod.Annotations["builder"] = "foo" }) diff --git a/test/e2e/empty_dir.go b/test/e2e/common/empty_dir.go similarity index 99% rename from test/e2e/empty_dir.go rename to test/e2e/common/empty_dir.go index a71ab28f7da..469bd517bc3 100644 --- a/test/e2e/empty_dir.go +++ b/test/e2e/common/empty_dir.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package e2e +package common import ( "fmt" diff --git a/test/e2e/host_path.go b/test/e2e/common/host_path.go similarity index 95% rename from test/e2e/host_path.go rename to test/e2e/common/host_path.go index 684b34f2871..17f44edf2d7 100644 --- a/test/e2e/host_path.go +++ b/test/e2e/common/host_path.go @@ -1,5 +1,5 @@ /* -Copyright 2015 The Kubernetes Authors. +Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package e2e +package common import ( "fmt" @@ -24,7 +24,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apimachinery/registered" - client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/test/e2e/framework" . "github.com/onsi/ginkgo" @@ -32,15 +31,10 @@ import ( //TODO : Consolidate this code with the code for emptyDir. //This will require some smart. -var _ = framework.KubeDescribe("hostPath", func() { +var _ = framework.KubeDescribe("HostPath", func() { f := framework.NewDefaultFramework("hostpath") - var c *client.Client - var namespace *api.Namespace BeforeEach(func() { - c = f.Client - namespace = f.Namespace - //cleanup before running the test. _ = os.Remove("/tmp/test-file") })