Commit 3ec82f6e authored by Alex Brainman's avatar Alex Brainman

exp/ssh: change test listen address, also exit test if fails

R=golang-dev, rsc
CC=dave, golang-dev
https://golang.org/cl/5364061
parent a479a455
...@@ -161,7 +161,7 @@ func TestClientAuthPassword(t *testing.T) { ...@@ -161,7 +161,7 @@ func TestClientAuthPassword(t *testing.T) {
} }
serverConfig.PubKeyCallback = nil serverConfig.PubKeyCallback = nil
l, err := Listen("tcp", "0.0.0.0:0", serverConfig) l, err := Listen("tcp", "127.0.0.1:0", serverConfig)
if err != nil { if err != nil {
t.Fatalf("unable to listen: %s", err) t.Fatalf("unable to listen: %s", err)
} }
...@@ -189,7 +189,7 @@ func TestClientAuthPassword(t *testing.T) { ...@@ -189,7 +189,7 @@ func TestClientAuthPassword(t *testing.T) {
c, err := Dial("tcp", l.Addr().String(), config) c, err := Dial("tcp", l.Addr().String(), config)
if err != nil { if err != nil {
t.Errorf("unable to dial remote side: %s", err) t.Fatalf("unable to dial remote side: %s", err)
} }
defer c.Close() defer c.Close()
<-done <-done
...@@ -211,7 +211,7 @@ func TestClientAuthPasswordAndPublickey(t *testing.T) { ...@@ -211,7 +211,7 @@ func TestClientAuthPasswordAndPublickey(t *testing.T) {
return user == "testuser" && algo == algoname && bytes.Equal(pubkey, expected) return user == "testuser" && algo == algoname && bytes.Equal(pubkey, expected)
} }
l, err := Listen("tcp", "0.0.0.0:0", serverConfig) l, err := Listen("tcp", "127.0.0.1:0", serverConfig)
if err != nil { if err != nil {
t.Fatalf("unable to listen: %s", err) t.Fatalf("unable to listen: %s", err)
} }
...@@ -241,7 +241,7 @@ func TestClientAuthPasswordAndPublickey(t *testing.T) { ...@@ -241,7 +241,7 @@ func TestClientAuthPasswordAndPublickey(t *testing.T) {
c, err := Dial("tcp", l.Addr().String(), config) c, err := Dial("tcp", l.Addr().String(), config)
if err != nil { if err != nil {
t.Errorf("unable to dial remote side: %s", err) t.Fatalf("unable to dial remote side: %s", err)
} }
defer c.Close() defer c.Close()
<-done <-done
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment