make outgoing address checker work under Go 1.7 #233

Merged
merged 1 commit into from Aug 15, 2016

Conversation

Projects
None yet
2 participants
Owner

rogpeppe commented Aug 15, 2016

In Go 1.7, http.Transport introduced the DialContext field
which overrides the Dial field and is set in http.DefaultContext.

This means that our hack to override the Dial field to prevent
outgoing network connections in test doesn't work from
Go 1.7 onwards.

This PR fixes that. We change the tests to avoid patching
the dial call because there is no longer a single entry point,
so we use more functional checks instead, and do some
more comprehensive testing of the local address checking
logic.

(Review request: http://reviews.vapour.ws/r/5438/)

make outgoing address checker work under Go 1.7
In Go 1.7, http.Transport introduced the DialContext field
which overrides the Dial field and is set in http.DefaultContext.

This means that our hack to override the Dial field to prevent
outgoing network connections in test doesn't work from
Go 1.7 onwards.

This PR fixes that. We change the tests to avoid patching
the dial call because there is no longer a single entry point,
so we use more functional checks instead, and do some
more comprehensive testing of the local address checking
logic.
Owner

rogpeppe commented Aug 15, 2016

$$merge$$

Contributor

jujubot commented Aug 15, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju-utils

@jujubot jujubot merged commit bdb77b0 into juju:master Aug 15, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment