Merge lp:~jonas-drange/ubuntu-push/fix-tlsservername-failure-automatic into lp:ubuntu-push/automatic

Proposed by Jonas G. Drange
Status: Merged
Approved by: Ken VanDine
Approved revision: 425
Merged at revision: 425
Proposed branch: lp:~jonas-drange/ubuntu-push/fix-tlsservername-failure-automatic
Merge into: lp:ubuntu-push/automatic
Diff against target: 40 lines (+11/-3)
2 files modified
debian/rules (+3/-0)
http13client/client_test.go (+8/-3)
To merge this branch: bzr merge lp:~jonas-drange/ubuntu-push/fix-tlsservername-failure-automatic
Reviewer Review Type Date Requested Status
Ken VanDine Approve
Review via email: mp+288699@code.launchpad.net

Commit message

stop cgo pointer checks at dh_auto_test time, and fix test after go 1.6 broke it (lp #1534417)

Description of the change

This is a copy paste of https://github.com/golang/go/blob/9f08b6c/src/net/http/client_test.go#L643 besides the disabling of cgo checks

To post a comment you must log in.
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Looks fine

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/rules'
2--- debian/rules 2016-01-14 20:58:52 +0000
3+++ debian/rules 2016-03-10 20:26:17 +0000
4@@ -25,6 +25,9 @@
5 dh_auto_build --buildsystem=golang
6 (cd signing-helper && cmake . && make)
7
8+override_dh_auto_test:
9+ GODEBUG=cgocheck=0 dh_auto_test -O--buildsystem=golang
10+
11 override_dh_install:
12 dh_install -Xusr/bin/cmd --fail-missing
13
14
15=== modified file 'http13client/client_test.go'
16--- http13client/client_test.go 2014-06-20 12:59:40 +0000
17+++ http13client/client_test.go 2016-03-10 20:26:17 +0000
18@@ -601,14 +601,19 @@
19
20 func TestClientWithCorrectTLSServerName(t *testing.T) {
21 defer afterTest(t)
22+
23+ const serverName = "example.com"
24 ts := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
25- if r.TLS.ServerName != "127.0.0.1" {
26- t.Errorf("expected client to set ServerName 127.0.0.1, got: %q", r.TLS.ServerName)
27+ if r.TLS.ServerName != serverName {
28+ t.Errorf("expected client to set ServerName %q, got: %q", serverName, r.TLS.ServerName)
29 }
30 }))
31 defer ts.Close()
32
33- c := &Client{Transport: newTLSTransport(t, ts)}
34+ trans := newTLSTransport(t, ts)
35+ trans.TLSClientConfig.ServerName = serverName
36+ c := &Client{Transport: trans}
37+
38 if _, err := c.Get(ts.URL); err != nil {
39 t.Fatalf("expected successful TLS connection, got error: %v", err)
40 }

Subscribers

People subscribed via source and target branches