mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 06:54:01 +00:00
Add a test for kubectl run --attach=true
This commit is contained in:
parent
496296f7f5
commit
7f4bca80ba
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user