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 | "crypto/tls" |
6 | "crypto/x509" |
7 | "encoding/json" |
8 | + "encoding/pem" |
9 | "errors" |
10 | "fmt" |
11 | "math/rand" |
12 | @@ -247,6 +248,22 @@ |
13 | return nil, errors.New("could not parse certificate") |
14 | } |
15 | sess.TLS.RootCAs = cp |
16 | + block, _ := pem.Decode(sess.PEM) |
17 | + if block == nil { |
18 | + panic(fmt.Errorf("unexpected error reparsing certificate")) |
19 | + } |
20 | + cert, err := x509.ParseCertificate(block.Bytes) |
21 | + if err != nil { |
22 | + panic(fmt.Errorf("unexpected error reparsing certificate: %v", err)) |
23 | + } |
24 | + // good guess |
25 | + var serverName string |
26 | + if len(cert.DNSNames) > 0 { |
27 | + serverName = cert.DNSNames[0] |
28 | + } else { |
29 | + serverName = cert.Subject.CommonName |
30 | + } |
31 | + sess.TLS.ServerName = serverName |
32 | } |
33 | sess.doneCh = make(chan uint32, 1) |
34 | sess.stopCh = make(chan struct{}) |
35 | |
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 | c.Check(sess.getHost, NotNil) |
41 | } |
42 | |
43 | -var certfile string = helpers.SourceRelative("../../server/acceptance/ssl/testing.cert") |
44 | -var pem, _ = ioutil.ReadFile(certfile) |
45 | - |
46 | func (cs *clientSessionSuite) TestNewSessionPEMWorks(c *C) { |
47 | + pem, err := ioutil.ReadFile(helpers.SourceRelative("../../server/acceptance/ssl/testing.cert")) |
48 | + c.Assert(err, IsNil) |
49 | conf := ClientSessionConfig{PEM: pem} |
50 | sess, err := NewSession("", conf, "wah", cs.lvls, cs.log) |
51 | c.Check(sess, NotNil) |
52 | @@ -1648,6 +1647,7 @@ |
53 | |
54 | cli, err := lst.Accept() |
55 | c.Assert(err, IsNil) |
56 | + cli.SetReadDeadline(time.Now().Add(2 * time.Second)) |
57 | var buf [1]byte |
58 | _, err = cli.Read(buf[:]) |
59 | c.Assert(err, IsNil) |
60 | @@ -1673,6 +1673,7 @@ |
61 | |
62 | cli, err := lst.Accept() |
63 | c.Assert(err, IsNil) |
64 | + cli.SetReadDeadline(time.Now().Add(2 * time.Second)) |
65 | var buf [1]byte |
66 | _, err = cli.Read(buf[:]) |
67 | 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/