From 01d0dc36972de679e9a957574eae000218aec34c Mon Sep 17 00:00:00 2001 From: Kenichi Omichi Date: Mon, 5 Nov 2018 21:35:17 +0000 Subject: [PATCH] Remove subPath tests from host_path.go As discussing on #68905 some tests of test/e2e/common/host_path.go are covered with test/e2e/storage/testsuites/subpath.go So we don't need to keep them in test/e2e/common/host_path.go anymore for the maintenance. --- test/e2e/common/host_path.go | 95 ------------------------------------ 1 file changed, 95 deletions(-) diff --git a/test/e2e/common/host_path.go b/test/e2e/common/host_path.go index 942481a7279..2728b6e4c32 100644 --- a/test/e2e/common/host_path.go +++ b/test/e2e/common/host_path.go @@ -116,101 +116,6 @@ var _ = Describe("[sig-storage] HostPath", func() { "content of file \"" + filePathInReader + "\": mount-tester new file", }) }) - - It("should support existing directory subPath", func() { - framework.SkipUnlessSSHKeyPresent() - - subPath := "sub-path" - fileName := "test-file" - retryDuration := 180 - - filePathInWriter := path.Join(volumePath, fileName) - filePathInReader := path.Join(volumePath, subPath, fileName) - - source := &v1.HostPathVolumeSource{ - Path: "/tmp", - } - pod := testPodWithHostVol(volumePath, source) - nodeList := framework.GetReadySchedulableNodesOrDie(f.ClientSet) - pod.Spec.NodeName = nodeList.Items[0].Name - - // Create the subPath directory on the host - existing := path.Join(source.Path, subPath) - nodeIP, err := framework.GetNodeExternalIP(&nodeList.Items[0]) - if err != nil { - nodeIP, err = framework.GetNodeInternalIP(&nodeList.Items[0]) - } - framework.ExpectNoError(err) - result, err := framework.SSH(fmt.Sprintf("mkdir -p %s", existing), nodeIP, framework.TestContext.Provider) - framework.LogSSHResult(result) - framework.ExpectNoError(err) - if result.Code != 0 { - framework.Failf("mkdir returned non-zero") - } - - // Write the file in the subPath from container 0 - container := &pod.Spec.Containers[0] - container.VolumeMounts[0].SubPath = subPath - container.Args = []string{ - fmt.Sprintf("--new_file_0644=%v", filePathInWriter), - fmt.Sprintf("--file_mode=%v", filePathInWriter), - } - - // Read it from outside the subPath from container 1 - pod.Spec.Containers[1].Args = []string{ - fmt.Sprintf("--file_content_in_loop=%v", filePathInReader), - fmt.Sprintf("--retry_time=%d", retryDuration), - } - - f.TestContainerOutput("hostPath subPath", pod, 1, []string{ - "content of file \"" + filePathInReader + "\": mount-tester new file", - }) - }) - - // TODO consolidate common code of this test and above - It("should support existing single file subPath", func() { - framework.SkipUnlessSSHKeyPresent() - - subPath := "sub-path-test-file" - retryDuration := 180 - - filePathInReader := path.Join(volumePath, subPath) - - source := &v1.HostPathVolumeSource{ - Path: "/tmp", - } - pod := testPodWithHostVol(volumePath, source) - nodeList := framework.GetReadySchedulableNodesOrDie(f.ClientSet) - pod.Spec.NodeName = nodeList.Items[0].Name - - // Create the subPath file on the host - existing := path.Join(source.Path, subPath) - nodeIP, err := framework.GetNodeExternalIP(&nodeList.Items[0]) - if err != nil { - nodeIP, err = framework.GetNodeInternalIP(&nodeList.Items[0]) - } - framework.ExpectNoError(err) - result, err := framework.SSH(fmt.Sprintf("echo \"mount-tester new file\" > %s", existing), nodeIP, framework.TestContext.Provider) - framework.LogSSHResult(result) - framework.ExpectNoError(err) - if result.Code != 0 { - framework.Failf("echo returned non-zero") - } - - // Mount the file to the subPath in container 0 - container := &pod.Spec.Containers[0] - container.VolumeMounts[0].SubPath = subPath - - // Read it from outside the subPath from container 1 - pod.Spec.Containers[1].Args = []string{ - fmt.Sprintf("--file_content_in_loop=%v", filePathInReader), - fmt.Sprintf("--retry_time=%d", retryDuration), - } - - f.TestContainerOutput("hostPath subPath", pod, 1, []string{ - "content of file \"" + filePathInReader + "\": mount-tester new file", - }) - }) }) //These constants are borrowed from the other test.