Browse Source

go.crypto/ssh: fix tests with -cpu 1,2.

When running the ssh tests several times (e.g. with -cpu 1,2), the
second run would fail because testing globals had been altered. This
change avoids altering the globals since the default worked anyway.

Fixes golang/go#4715.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7903045
Adam Langley 12 years ago
parent
commit
1ddfbba54b
1 changed files with 1 additions and 7 deletions
  1. 1 7
      ssh/session_test.go

+ 1 - 7
ssh/session_test.go

@@ -22,12 +22,6 @@ type serverType func(*serverChan, *testing.T)
 
 // dial constructs a new test server and returns a *ClientConn.
 func dial(handler serverType, t *testing.T) *ClientConn {
-	pw := password("tiger")
-	serverConfig.PasswordCallback = func(conn *ServerConn, user, pass string) bool {
-		return user == "testuser" && pass == string(pw)
-	}
-	serverConfig.PublicKeyCallback = nil
-
 	l, err := Listen("tcp", "127.0.0.1:0", serverConfig)
 	if err != nil {
 		t.Fatalf("unable to listen: %v", err)
@@ -74,7 +68,7 @@ func dial(handler serverType, t *testing.T) *ClientConn {
 	config := &ClientConfig{
 		User: "testuser",
 		Auth: []ClientAuth{
-			ClientAuthPassword(pw),
+			ClientAuthPassword(clientPassword),
 		},
 	}