From 7f4bca80badf8d59e1ff1d65e0998f24bd596926 Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Tue, 1 Sep 2015 16:42:16 -0700 Subject: [PATCH] Add a test for kubectl run --attach=true --- test/e2e/kubectl.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/e2e/kubectl.go b/test/e2e/kubectl.go index 1bd0b04ea6e..b5af50aa733 100644 --- a/test/e2e/kubectl.go +++ b/test/e2e/kubectl.go @@ -188,6 +188,16 @@ var _ = Describe("Kubectl client", func() { } }) + It("should support inline execution and attach", func() { + By("executing a command with run and attach") + runOutput := runKubectl("run", fmt.Sprintf("--namespace=%v", ns), "run", "run-test", "--image=busybox", "--restart=Never", "--attach", "echo", "running", "in", "container") + expectedRunOutput := "running in container" + if runOutput != expectedRunOutput { + Failf("Unexpected kubectl exec output. Wanted '%s', got '%s'", runOutput, expectedRunOutput) + } + runKubectl("delete", "pods", "run-test") + }) + It("should support port-forward", func() { By("forwarding the container port to a local port") cmd := kubectlCmd("port-forward", fmt.Sprintf("--namespace=%v", ns), simplePodName, fmt.Sprintf(":%d", simplePodPort))