revert unrelated changes

pull/8265/head
Medya Gh 2020-05-26 18:03:37 -07:00
parent f16ed7c650
commit 122fcf1d6f
No known key found for this signature in database
GPG Key ID: 7CF7792C6DF3245C
2 changed files with 9 additions and 10 deletions

View File

@ -51,6 +51,8 @@ func validateMountCmd(ctx context.Context, t *testing.T, profile string) { //nol
t.Skip("skipping: mount broken on hyperv: https://github.com/kubernetes/minikube/issues/5029") t.Skip("skipping: mount broken on hyperv: https://github.com/kubernetes/minikube/issues/5029")
} }
t.Logf("runtime is %q", runtime.GOOS)
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
t.Skip("skipping: mount broken on windows: https://github.com/kubernetes/minikube/issues/8271") t.Skip("skipping: mount broken on windows: https://github.com/kubernetes/minikube/issues/8271")
} }
@ -66,21 +68,18 @@ func validateMountCmd(ctx context.Context, t *testing.T, profile string) { //nol
t.Fatalf("Unexpected error while creating tempDir: %v", err) t.Fatalf("Unexpected error while creating tempDir: %v", err)
} }
mctx, cancel := context.WithTimeout(ctx, Minutes(10)) mctx, cancel := context.WithTimeout(ctx, Minutes(3))
args := []string{"mount", "-p", profile, fmt.Sprintf("%s:%s", tempDir, guestMount), "--alsologtostderr", "-v=1"} args := []string{"mount", "-p", profile, fmt.Sprintf("%s:%s", tempDir, guestMount), "--alsologtostderr", "-v=1"}
var ss *StartSession ss, err := Start(t, exec.CommandContext(mctx, Target(), args...))
ss, err = Start(t, exec.CommandContext(mctx, Target(), args...))
if err != nil { if err != nil {
t.Fatalf("%v failed: %v", args, err) t.Fatalf("%v failed: %v", args, err)
} }
defer func() { defer func() {
var rr *RunResult
var err error
if t.Failed() { if t.Failed() {
t.Logf("%q failed, getting debug info...", t.Name()) t.Logf("%q failed, getting debug info...", t.Name())
rr, err = Run(t, exec.Command(Target(), "-p", profile, "ssh", "mount | grep 9p; ls -la /mount-9p; cat /mount-9p/pod-dates")) rr, err := Run(t, exec.Command(Target(), "-p", profile, "ssh", "mount | grep 9p; ls -la /mount-9p; cat /mount-9p/pod-dates"))
if err != nil { if err != nil {
t.Logf("debugging command %q failed : %v", rr.Command(), err) t.Logf("debugging command %q failed : %v", rr.Command(), err)
} else { } else {
@ -89,7 +88,7 @@ func validateMountCmd(ctx context.Context, t *testing.T, profile string) { //nol
} }
// Cleanup in advance of future tests // Cleanup in advance of future tests
rr, err = Run(t, exec.Command(Target(), "-p", profile, "ssh", "sudo umount -f /mount-9p")) rr, err := Run(t, exec.Command(Target(), "-p", profile, "ssh", "sudo umount -f /mount-9p"))
if err != nil { if err != nil {
t.Logf("%q: %v", rr.Command(), err) t.Logf("%q: %v", rr.Command(), err)
} }

View File

@ -97,7 +97,7 @@ func Run(t *testing.T, cmd *exec.Cmd) (*RunResult, error) {
if err != nil { if err != nil {
return &RunResult{}, errors.Wrapf(err, "lookup powershell") return &RunResult{}, errors.Wrapf(err, "lookup powershell")
} }
args := append([]string{"-NoProfile", "-NonInteractive"}, cmd.Args...) args := append([]string{"-NoProfile", "-NonInteractive", "--%"}, cmd.Args...)
newCmd = exec.Command(psBin, args...) newCmd = exec.Command(psBin, args...)
newCmd.Stdout = cmd.Stdout newCmd.Stdout = cmd.Stdout
newCmd.Stderr = cmd.Stderr newCmd.Stderr = cmd.Stderr
@ -106,7 +106,7 @@ func Run(t *testing.T, cmd *exec.Cmd) (*RunResult, error) {
newCmd = cmd newCmd = cmd
} }
rr := &RunResult{Args: cmd.Args} rr := &RunResult{Args: newCmd.Args}
t.Logf("(dbg) Run: %v", rr.Command()) t.Logf("(dbg) Run: %v", rr.Command())
@ -148,7 +148,7 @@ func Start(t *testing.T, cmd *exec.Cmd) (*StartSession, error) {
if err != nil { if err != nil {
return &StartSession{}, errors.Wrapf(err, "lookup powershell") return &StartSession{}, errors.Wrapf(err, "lookup powershell")
} }
args := append([]string{"-NoProfile", "-NonInteractive"}, cmd.Args...) args := append([]string{"-NoProfile", "-NonInteractive", "--%"}, cmd.Args...)
newCmd = exec.Command(psBin, args...) newCmd = exec.Command(psBin, args...)
newCmd.Stdout = cmd.Stdout newCmd.Stdout = cmd.Stdout
newCmd.Stderr = cmd.Stderr newCmd.Stderr = cmd.Stderr