Commit 7f4bca80 authored by Brendan Burns's avatar Brendan Burns

Add a test for kubectl run --attach=true

parent 496296f7
...@@ -188,6 +188,16 @@ var _ = Describe("Kubectl client", func() { ...@@ -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() { It("should support port-forward", func() {
By("forwarding the container port to a local port") By("forwarding the container port to a local port")
cmd := kubectlCmd("port-forward", fmt.Sprintf("--namespace=%v", ns), simplePodName, fmt.Sprintf(":%d", simplePodPort)) cmd := kubectlCmd("port-forward", fmt.Sprintf("--namespace=%v", ns), simplePodName, fmt.Sprintf(":%d", simplePodPort))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment