oomichi / try-kubernetes

12 stars 5 forks source link

[Fail] [sig-storage] HostPath [It] should support existing single file subPath #50

Closed oomichi closed 5 years ago

oomichi commented 5 years ago
~ Failure [6.673 seconds]
[sig-storage] HostPath
/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/common/host_path.go:33
  should support existing single file subPath [It]
  /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/common/host_path.go:166

  Sep 20 18:35:24.596: Couldn't get the external IP of host k8s-master with addresses [{InternalIP 192.168.1.108} {Hostname k8s-master}]

  /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/util.go:5012
------------------------------
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSep 20 18:35:31.093: INFO: Running AfterSuite actions on all node
Sep 20 18:35:31.093: INFO: Running AfterSuite actions on node 1
oomichi commented 5 years ago

テストコード

165         // TODO consolidate common code of this test and above
166         It("should support existing single file subPath", func() {
167                 framework.SkipUnlessSSHKeyPresent()
168
169                 subPath := "sub-path-test-file"
170                 retryDuration := 180
171
172                 filePathInReader := path.Join(volumePath, subPath)
173
174                 source := &v1.HostPathVolumeSource{
175                         Path: "/tmp",
176                 }
177                 pod := testPodWithHostVol(volumePath, source)
178                 nodeList := framework.GetReadySchedulableNodesOrDie(f.ClientSet)
179                 pod.Spec.NodeName = nodeList.Items[0].Name
180
181                 // Create the subPath file on the host
182                 existing := path.Join(source.Path, subPath)
183                 result, err := framework.SSH(fmt.Sprintf("echo \"mount-tester new file\" > %s", existing), framework.GetNodeExternalIP(&nodeList.Items[0]    ), framework.TestContext.Provider)
184                 framework.LogSSHResult(result)
185                 framework.ExpectNoError(err)
186                 if result.Code != 0 {
187                         framework.Failf("echo returned non-zero")
188                 }
189
190                 // Mount the file to the subPath in container 0
191                 container := &pod.Spec.Containers[0]
192                 container.VolumeMounts[0].SubPath = subPath
193
194                 // Read it from outside the subPath from container 1
195                 pod.Spec.Containers[1].Args = []string{
196                         fmt.Sprintf("--file_content_in_loop=%v", filePathInReader),
197                         fmt.Sprintf("--retry_time=%d", retryDuration),
198                 }
199
200                 f.TestContainerOutput("hostPath subPath", pod, 1, []string{
201                         "content of file \"" + filePathInReader + "\": mount-tester new file",
202                 })
203         })
204 })
oomichi commented 5 years ago

k/kubernetes/pull/68915 として投稿済み ローカル環境では通るようになった。