fix ssh test

pull/8265/head
Medya Gh 2020-05-25 16:30:04 -07:00
parent e2d4290800
commit 1881032044
No known key found for this signature in database
GPG Key ID: 7CF7792C6DF3245C
1 changed files with 4 additions and 3 deletions

View File

@ -836,13 +836,14 @@ func validateSSHCmd(ctx context.Context, t *testing.T, profile string) {
if NoneDriver() {
t.Skipf("skipping: ssh unsupported by none")
}
want := "hello\n"
want := profile+"\n"
var rr *RunResult
var err error
if runtime.GOOS == "windows" { // golang exec powershell needs some tricks !
rr, err = Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "ssh", fmt.Sprintf("echo hello")), true)
minikube ssh --% "echo $(pwd)"
rr, err = Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "ssh", "--%", "cat /etc/hostname", true)
} else {
rr, err = Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "ssh", fmt.Sprintf("echo hello")))
rr, err = Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "ssh", "cat /etc/hostname"))
}
if ctx.Err() == context.DeadlineExceeded {
t.Logf("failed to run command by deadline. exceeded timeout : %s", rr.Command())