mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-10 13:42:02 +00:00
e2e test for kubectl exec, port-forward
This commit is contained in:
@@ -19,6 +19,7 @@ package e2e
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"math"
|
||||
"math/rand"
|
||||
@@ -832,6 +833,20 @@ func runKubectl(args ...string) string {
|
||||
return strings.TrimSpace(stdout.String())
|
||||
}
|
||||
|
||||
func startCmdAndStreamOutput(cmd *exec.Cmd) (stdout, stderr io.ReadCloser, err error) {
|
||||
stdout, err = cmd.StdoutPipe()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
stderr, err = cmd.StderrPipe()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
Logf("Asyncronously running '%s %s'", cmd.Path, strings.Join(cmd.Args, " "))
|
||||
err = cmd.Start()
|
||||
return
|
||||
}
|
||||
|
||||
// testContainerOutput runs testContainerOutputInNamespace with the default namespace.
|
||||
func testContainerOutput(scenarioName string, c *client.Client, pod *api.Pod, containerIndex int, expectedOutput []string) {
|
||||
testContainerOutputInNamespace(scenarioName, c, pod, containerIndex, expectedOutput, api.NamespaceDefault)
|
||||
|
Reference in New Issue
Block a user