test/e2e_node: tie together expected string and exec

This commit ties together busybox-sh invocation and test expectation
to avoid subtle mismatches between exec command and output string.
This commit is contained in:
Luca Bruno 2017-01-26 17:09:13 +00:00
parent 373ff83518
commit 05bff300f3
No known key found for this signature in database
GPG Key ID: A9834A2252078E4E

View File

@ -131,7 +131,7 @@ var _ = framework.KubeDescribe("Kubelet", func() {
{ {
Image: "gcr.io/google_containers/busybox:1.24", Image: "gcr.io/google_containers/busybox:1.24",
Name: podName, Name: podName,
Command: []string{"sh", "-c", "echo test > /file; sleep 240"}, Command: []string{"/bin/sh", "-c", "echo test > /file; sleep 240"},
SecurityContext: &v1.SecurityContext{ SecurityContext: &v1.SecurityContext{
ReadOnlyRootFilesystem: &isReadOnly, ReadOnlyRootFilesystem: &isReadOnly,
}, },
@ -148,7 +148,7 @@ var _ = framework.KubeDescribe("Kubelet", func() {
buf := new(bytes.Buffer) buf := new(bytes.Buffer)
buf.ReadFrom(rc) buf.ReadFrom(rc)
return buf.String() return buf.String()
}, time.Minute, time.Second*4).Should(Equal("sh: can't create /file: Read-only file system\n")) }, time.Minute, time.Second*4).Should(Equal("/bin/sh: can't create /file: Read-only file system\n"))
}) })
}) })
}) })