Merge lp:~pedronis/ubuntu-push/fix-session-dial-tests-for-go1.3 into lp:ubuntu-push/automatic
- fix-session-dial-tests-for-go1.3
- Merge into automatic
Status: | Merged |
---|---|
Approved by: | Samuele Pedroni |
Approved revision: | 398 |
Merged at revision: | 398 |
Proposed branch: | lp:~pedronis/ubuntu-push/fix-session-dial-tests-for-go1.3 |
Merge into: | lp:ubuntu-push/automatic |
Diff against target: |
67 lines (+21/-3) 2 files modified
client/session/session.go (+17/-0) client/session/session_test.go (+4/-3) |
To merge this branch: | bzr merge lp:~pedronis/ubuntu-push/fix-session-dial-tests-for-go1.3 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Roberto Alsina (community) | Approve | ||
Review via email: mp+256659@code.launchpad.net |
Commit message
have the TestDialWorksDi
Description of the change
have the TestDialWorksDi
the new code path is going to be used only in tests/test situations (when we give a cert explicitly)
Roberto Alsina (ralsina) : | # |
Ubuntu One Auto Pilot (otto-pilot) wrote : | # |
Ubuntu One Auto Pilot (otto-pilot) wrote : | # |
The attempt to merge lp:~pedronis/ubuntu-push/fix-session-dial-tests-for-go1.3 into lp:ubuntu-push/automatic failed. Below is the output from the failed tests.
scripts/deps.sh ubuntu-
scripts/deps.sh server/
scripts/deps.sh server/
/mnt/tarmac/
rm -f -r /mnt/tarmac/
mkdir -p /mnt/tarmac/
mkdir -p /mnt/tarmac/
go get -u launchpad.
go get -d -u launchpad.
/mnt/tarmac/
Ubuntu One Auto Pilot (otto-pilot) wrote : | # |
The attempt to merge lp:~pedronis/ubuntu-push/fix-session-dial-tests-for-go1.3 into lp:ubuntu-push/automatic failed. Below is the output from the failed tests.
scripts/deps.sh ubuntu-
scripts/deps.sh server/
scripts/deps.sh server/
/mnt/tarmac/
rm -f -r /mnt/tarmac/
mkdir -p /mnt/tarmac/
mkdir -p /mnt/tarmac/
go get -u launchpad.
go get -d -u launchpad.
/mnt/tarmac/
Ubuntu One Auto Pilot (otto-pilot) wrote : | # |
The attempt to merge lp:~pedronis/ubuntu-push/fix-session-dial-tests-for-go1.3 into lp:ubuntu-push/automatic failed. Below is the output from the failed tests.
scripts/deps.sh ubuntu-
scripts/deps.sh server/
scripts/deps.sh server/
/mnt/tarmac/
rm -f -r /mnt/tarmac/
mkdir -p /mnt/tarmac/
mkdir -p /mnt/tarmac/
go get -u launchpad.
go get -d -u launchpad.
/mnt/tarmac/
Ubuntu One Auto Pilot (otto-pilot) wrote : | # |
The attempt to merge lp:~pedronis/ubuntu-push/fix-session-dial-tests-for-go1.3 into lp:ubuntu-push/automatic failed. Below is the output from the failed tests.
scripts/deps.sh ubuntu-
scripts/deps.sh server/
scripts/deps.sh server/
/mnt/tarmac/
rm -f -r /mnt/tarmac/
mkdir -p /mnt/tarmac/
mkdir -p /mnt/tarmac/
go get -u launchpad.
go get -d -u launchpad.
/mnt/tarmac/
Preview Diff
1 | === modified file 'client/session/session.go' | |||
2 | --- client/session/session.go 2015-04-16 12:16:51 +0000 | |||
3 | +++ client/session/session.go 2015-04-17 12:59:38 +0000 | |||
4 | @@ -23,6 +23,7 @@ | |||
5 | 23 | "crypto/tls" | 23 | "crypto/tls" |
6 | 24 | "crypto/x509" | 24 | "crypto/x509" |
7 | 25 | "encoding/json" | 25 | "encoding/json" |
8 | 26 | "encoding/pem" | ||
9 | 26 | "errors" | 27 | "errors" |
10 | 27 | "fmt" | 28 | "fmt" |
11 | 28 | "math/rand" | 29 | "math/rand" |
12 | @@ -247,6 +248,22 @@ | |||
13 | 247 | return nil, errors.New("could not parse certificate") | 248 | return nil, errors.New("could not parse certificate") |
14 | 248 | } | 249 | } |
15 | 249 | sess.TLS.RootCAs = cp | 250 | sess.TLS.RootCAs = cp |
16 | 251 | block, _ := pem.Decode(sess.PEM) | ||
17 | 252 | if block == nil { | ||
18 | 253 | panic(fmt.Errorf("unexpected error reparsing certificate")) | ||
19 | 254 | } | ||
20 | 255 | cert, err := x509.ParseCertificate(block.Bytes) | ||
21 | 256 | if err != nil { | ||
22 | 257 | panic(fmt.Errorf("unexpected error reparsing certificate: %v", err)) | ||
23 | 258 | } | ||
24 | 259 | // good guess | ||
25 | 260 | var serverName string | ||
26 | 261 | if len(cert.DNSNames) > 0 { | ||
27 | 262 | serverName = cert.DNSNames[0] | ||
28 | 263 | } else { | ||
29 | 264 | serverName = cert.Subject.CommonName | ||
30 | 265 | } | ||
31 | 266 | sess.TLS.ServerName = serverName | ||
32 | 250 | } | 267 | } |
33 | 251 | sess.doneCh = make(chan uint32, 1) | 268 | sess.doneCh = make(chan uint32, 1) |
34 | 252 | sess.stopCh = make(chan struct{}) | 269 | sess.stopCh = make(chan struct{}) |
35 | 253 | 270 | ||
36 | === modified file 'client/session/session_test.go' | |||
37 | --- client/session/session_test.go 2015-04-16 12:16:51 +0000 | |||
38 | +++ client/session/session_test.go 2015-04-17 12:59:38 +0000 | |||
39 | @@ -259,10 +259,9 @@ | |||
40 | 259 | c.Check(sess.getHost, NotNil) | 259 | c.Check(sess.getHost, NotNil) |
41 | 260 | } | 260 | } |
42 | 261 | 261 | ||
43 | 262 | var certfile string = helpers.SourceRelative("../../server/acceptance/ssl/testing.cert") | ||
44 | 263 | var pem, _ = ioutil.ReadFile(certfile) | ||
45 | 264 | |||
46 | 265 | func (cs *clientSessionSuite) TestNewSessionPEMWorks(c *C) { | 262 | func (cs *clientSessionSuite) TestNewSessionPEMWorks(c *C) { |
47 | 263 | pem, err := ioutil.ReadFile(helpers.SourceRelative("../../server/acceptance/ssl/testing.cert")) | ||
48 | 264 | c.Assert(err, IsNil) | ||
49 | 266 | conf := ClientSessionConfig{PEM: pem} | 265 | conf := ClientSessionConfig{PEM: pem} |
50 | 267 | sess, err := NewSession("", conf, "wah", cs.lvls, cs.log) | 266 | sess, err := NewSession("", conf, "wah", cs.lvls, cs.log) |
51 | 268 | c.Check(sess, NotNil) | 267 | c.Check(sess, NotNil) |
52 | @@ -1648,6 +1647,7 @@ | |||
53 | 1648 | 1647 | ||
54 | 1649 | cli, err := lst.Accept() | 1648 | cli, err := lst.Accept() |
55 | 1650 | c.Assert(err, IsNil) | 1649 | c.Assert(err, IsNil) |
56 | 1650 | cli.SetReadDeadline(time.Now().Add(2 * time.Second)) | ||
57 | 1651 | var buf [1]byte | 1651 | var buf [1]byte |
58 | 1652 | _, err = cli.Read(buf[:]) | 1652 | _, err = cli.Read(buf[:]) |
59 | 1653 | c.Assert(err, IsNil) | 1653 | c.Assert(err, IsNil) |
60 | @@ -1673,6 +1673,7 @@ | |||
61 | 1673 | 1673 | ||
62 | 1674 | cli, err := lst.Accept() | 1674 | cli, err := lst.Accept() |
63 | 1675 | c.Assert(err, IsNil) | 1675 | c.Assert(err, IsNil) |
64 | 1676 | cli.SetReadDeadline(time.Now().Add(2 * time.Second)) | ||
65 | 1676 | var buf [1]byte | 1677 | var buf [1]byte |
66 | 1677 | _, err = cli.Read(buf[:]) | 1678 | _, err = cli.Read(buf[:]) |
67 | 1678 | c.Assert(err, IsNil) | 1679 | c.Assert(err, IsNil) |
The attempt to merge lp:~pedronis/ubuntu-push/fix-session-dial-tests-for-go1.3 into lp:ubuntu-push/automatic failed. Below is the output from the failed tests.
scripts/deps.sh ubuntu- push-client. go dev/server. go acceptance/ cmd/acceptancec lient.go cache/ubuntu- push-automatic/ go-ws/bin/ godeps -t launchpad. net/ubuntu- push launchpad. net/ubuntu- push/accounts launchpad. net/ubuntu- push/bus launchpad. net/ubuntu- push/bus/ accounts launchpad. net/ubuntu- push/bus/ connectivity launchpad. net/ubuntu- push/bus/ emblemcounter launchpad. net/ubuntu- push/bus/ haptic launchpad. net/ubuntu- push/bus/ networkmanager launchpad. net/ubuntu- push/bus/ notifications launchpad. net/ubuntu- push/bus/ polld launchpad. net/ubuntu- push/bus/ powerd launchpad. net/ubuntu- push/bus/ systemimage launchpad. net/ubuntu- push/bus/ testing launchpad. net/ubuntu- push/bus/ unitygreeter launchpad. net/ubuntu- push/bus/ urfkill launchpad. net/ubuntu- push/bus/ windowstack launchpad. net/ubuntu- push/click launchpad. net/ubuntu- push/click/ cappinfo launchpad. net/ubuntu- push/click/ cblacklist launchpad. net/ubuntu- push/click/ cclick launchpad. net/ubuntu- push/click/ testing launchpad. net/ubuntu- push/client launchpad. net/ubuntu- push/client/ gethosts launchpad. net/ubuntu- push/client/ service launchpad. net/ubuntu- push/client/ session launchpad. net/ubuntu- push/client/ session/ seenstate launchpad. net/ubuntu- push/config launchpad. net/ubuntu- push/external/ murmur3 launchpad. net/ubuntu- push/identifier launchpad. net/ubuntu- push/identifier /testing launchpad. net/ubuntu- push/launch_ helper launchpad. net/ubuntu- push/launch_ helper/ cual launchpad. net/ubuntu- push/launch_ helper/ helper_ finder launchpad. net/ubuntu- push/launch_ helper/ legacy launchpad. net/ubuntu- push/logger launchpad. net/ubuntu- push/messaging launchpad. net/ubuntu- push/messaging/ cmessaging launchpad. net/ubuntu- push/messaging/ reply launchpad. net/ubuntu- push/nih launchpad. net/ubuntu- push/nih/ cnih launchpad. net/ubuntu- push/poller launchpad. net/ubuntu- push/protocol launchpad. net/ubuntu- push/server launchpad. net/ubuntu- push/server/ api launchpad. net/ubuntu- push/server/ broker launchpad. net/ubuntu- push/server/ broker/ simple launchpad. net/ubuntu- push/server/ broker/ testing launchpad. net/ubuntu- push/server/ broker/ testsuite launchpad. net/ubuntu- push/server/ dev launchpad. net/ubuntu- push/server/ listener launchpad. net/ubuntu- push/server/ session launchpad. net/ubuntu- push/server/ store launchpad. net/ubuntu- push/sounds launchpad. net/ubuntu- push/testing launchpad. net/ubuntu- push/testing/ condition launchpad. net/ubuntu- push/urldispatc her launchpad. net/ubuntu- push/urldispatc her/curldispatc her launchpad. net/ubuntu- push/util launchpad. net/ubuntu- push/server/ acceptance/ cmd/ launchpad. net/ubuntu- push/server/ dev/ launchpad. net/ubuntu- push/ 2>/dev/null | cat > dependencies.tsv cache/ubuntu- push-automatic/ go-ws/pkg cache/ubuntu- push-automatic/ go-ws/bin cache/ubuntu- push-automatic/ go-ws/pkg net/godeps net/gocheck launchpad. net/go- dbus/v1 launchpad. net/go- xdg/v0 code.google. com/p/gosqlite/ sqlite3 code.google. com/p/go- uuid/uuid cache/ubuntu- push...
scripts/deps.sh server/
scripts/deps.sh server/
/mnt/tarmac/
rm -f -r /mnt/tarmac/
mkdir -p /mnt/tarmac/
mkdir -p /mnt/tarmac/
go get -u launchpad.
go get -d -u launchpad.
/mnt/tarmac/