From 1ddfbba54b04d4acf0785dacec9098d7d5e6b9a5 Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Fri, 22 Mar 2013 15:51:39 -0400 Subject: [PATCH] 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 --- ssh/session_test.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/ssh/session_test.go b/ssh/session_test.go index 218d002..7453c8a 100644 --- a/ssh/session_test.go +++ b/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), }, }