]> Cypherpunks repositories - gostls13.git/commit
net: fix TestDialGoogle with -ipv6 when CGO_ENABLED=0
authorMikio Hara <mikioh.mikioh@gmail.com>
Fri, 10 Apr 2015 08:24:43 +0000 (17:24 +0900)
committerMikio Hara <mikioh.mikioh@gmail.com>
Thu, 16 Apr 2015 00:44:52 +0000 (00:44 +0000)
commit57bc7a043405c7e7215360f5fd1b80df6f56bb43
treedf16487a8f68da3a5ab1699c8e51b52dddc133da
parentf616af23e0977cda63a0771d726d1529e70f17a4
net: fix TestDialGoogle with -ipv6 when CGO_ENABLED=0

Under some dial tests that require external network connectivity, we
must prevent application traffic but must not interfere with control
plane traffic such as DNS message exchange. But test helper function
disableSocketConnect prevents both application and control plane traffic
unconditionally and makes some dial tests with -ipv6 fail when
CGO_ENABLED=0.

This change makes disableSocketConnect take a look at not only address
family but socket type for fixing some dial tests with -ipv6 when
CGO_ENBALED=0.

Change-Id: I32241d9592d31483424bb5e69cb4d56f3fc20312
Reviewed-on: https://go-review.googlesource.com/8743
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/net/main_posix_test.go