pkg/Makefile: allow DISABLE_NET_TESTS=1 to disable network tests

netchan, rpc, websocket: run test servers on 127.0.0.1,
to avoid conflict with OS X firewall.

TBR=r
CC=golang-dev
https://golang.org/cl/1689046
This commit is contained in:
Russ Cox 2010-06-21 13:05:38 -07:00
parent e495351ff7
commit 96d35c6984
4 changed files with 16 additions and 11 deletions

View file

@ -55,7 +55,7 @@ func (t *Arith) Error(args *Args, reply *Reply) os.Error {
func startServer() {
Register(new(Arith))
l, e := net.Listen("tcp", ":0") // any available address
l, e := net.Listen("tcp", "127.0.0.1:0") // any available address
if e != nil {
log.Exitf("net.Listen tcp :0: %v", e)
}
@ -64,7 +64,7 @@ func startServer() {
go Accept(l)
HandleHTTP()
l, e = net.Listen("tcp", ":0") // any available address
l, e = net.Listen("tcp", "127.0.0.1:0") // any available address
if e != nil {
log.Stderrf("net.Listen tcp :0: %v", e)
os.Exit(1)