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
=== modified file 'debian/rules'
--- debian/rules 2016-01-14 20:58:52 +0000
+++ debian/rules 2016-03-10 20:26:17 +0000
@@ -25,6 +25,9 @@
25 dh_auto_build --buildsystem=golang25 dh_auto_build --buildsystem=golang
26 (cd signing-helper && cmake . && make)26 (cd signing-helper && cmake . && make)
2727
28override_dh_auto_test:
29 GODEBUG=cgocheck=0 dh_auto_test -O--buildsystem=golang
30
28override_dh_install:31override_dh_install:
29 dh_install -Xusr/bin/cmd --fail-missing32 dh_install -Xusr/bin/cmd --fail-missing
3033
3134
=== modified file 'http13client/client_test.go'
--- http13client/client_test.go 2014-06-20 12:59:40 +0000
+++ http13client/client_test.go 2016-03-10 20:26:17 +0000
@@ -601,14 +601,19 @@
601601
602func TestClientWithCorrectTLSServerName(t *testing.T) {602func TestClientWithCorrectTLSServerName(t *testing.T) {
603 defer afterTest(t)603 defer afterTest(t)
604
605 const serverName = "example.com"
604 ts := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {606 ts := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
605 if r.TLS.ServerName != "127.0.0.1" {607 if r.TLS.ServerName != serverName {
606 t.Errorf("expected client to set ServerName 127.0.0.1, got: %q", r.TLS.ServerName)608 t.Errorf("expected client to set ServerName %q, got: %q", serverName, r.TLS.ServerName)
607 }609 }
608 }))610 }))
609 defer ts.Close()611 defer ts.Close()
610612
611 c := &Client{Transport: newTLSTransport(t, ts)}613 trans := newTLSTransport(t, ts)
614 trans.TLSClientConfig.ServerName = serverName
615 c := &Client{Transport: trans}
616
612 if _, err := c.Get(ts.URL); err != nil {617 if _, err := c.Get(ts.URL); err != nil {
613 t.Fatalf("expected successful TLS connection, got error: %v", err)618 t.Fatalf("expected successful TLS connection, got error: %v", err)
614 }619 }

Subscribers

People subscribed via source and target branches