net tests depend on external network #538

Closed
gopherbot opened this Issue Jan 17, 2010 · 8 comments

3 participants

@gopherbot

by csanady:

What steps will reproduce the problem?
1. Use IPv6 DNS servers exclusively in /etc/resolv.conf.
2. make all

What is the expected output? None.
What do you see instead?

First of all: 

--- FAIL: http.TestClient
    Get http://www.google.com/robots.txt: dial tcp www.google.com:http: dial udp 
2001:db8::1:53: too many colons in address 2001:db8::1:53
--- FAIL: http.TestRedirect
    Get http://codesearch.google.com/: dial tcp codesearch.google.com:http: dial udp 
2001:db8::1:53: too many colons in address 2001:db8::1:53
FAIL

net.Dial() requires []'s around IPv6 addresses.  After that is corrected:

--- FAIL: net.TestDialGoogle
    -- 74.125.19.99:80 --
    -- www.google.com:80 --
    Dial("tcp4", "", "www.google.com:80") = _, dial tcp4 www.google.com:80: dial udp 
[2001:db8::1]:53: address family not supported by protocol family
    -- 74.125.19.99:http --
    -- www.google.com:http --
    Dial("tcp4", "", "www.google.com:http") = _, dial tcp4 www.google.com:http: dial udp 
[2001:db8::1]:53: address family not supported by protocol family
    -- 074.125.019.099:0080 --
    -- [::ffff:74.125.19.99]:80 --
    -- [::ffff:4a7d:1363]:80 --
    -- [0:0:0:0:0000:ffff:74.125.19.99]:80 --
    -- [0:0:0:0:000000:ffff:74.125.19.99]:80 --
    -- [0:0:0:0:0:ffff::74.125.19.99]:80 --
FAIL

The net test disables IPv6 sockets, and the names can't be resolved.


What is your $GOOS?  $GOARCH? darwin/amd64


Which revision are you using?  release.2010-01-13


Please provide any additional information below.

The attached diff solves the above problems, though the preferIPv4 testing in
dialgoogle_test.go 
could be improved.  Also, while it not automatically tested without the -ipv6 flag, the
address for 
ipv6.google.com appears to be out of date.

Attachments:

  1. go.diff (1477 bytes)
@rsc

Comment 1:

The eventual plan is to replace the net tests with ones that
don't require a network connection.

Owner changed to r...@golang.org.

Status changed to Accepted.

@gopherbot

Comment 2 by csanady:

The tests aside, name resolution is still not functional with an IPv6 name server.  
_DNS_ReadConfig() in 
dnsconfig.go, which parses /etc/resolv.conf, needs to properly bracket the address of
IPv6 nameserver entries.

The attached diff also includes a fix for dnsconfig.go.
@rsc

Comment 3:

Issue #378 has been merged into this issue.

@rsc

Comment 4:

Issue #629 has been merged into this issue.

@adg

Comment 5:

Issue #1205 has been merged into this issue.

@rsc

Comment 6:

Issue #1287 has been merged into this issue.

@adg

Comment 7:

Issue #1292 has been merged into this issue.

@rsc

Comment 8:

the testshort tests (what all.bash runs) don't use an external network anymore.

Status changed to Fixed.

@gopherbot gopherbot added the fixed label Apr 20, 2011
@rsc rsc was assigned by gopherbot Apr 20, 2011
@gopherbot gopherbot locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.