Merge lp:~pedronis/ubuntu-push/refactor-service-setup into lp:ubuntu-push/automatic
- refactor-service-setup
- Merge into automatic
Proposed by
Samuele Pedroni
Status: | Merged |
---|---|
Approved by: | Samuele Pedroni |
Approved revision: | 217 |
Merged at revision: | 215 |
Proposed branch: | lp:~pedronis/ubuntu-push/refactor-service-setup |
Merge into: | lp:ubuntu-push/automatic |
Diff against target: |
657 lines (+226/-148) 7 files modified
client/client.go (+19/-4) client/client_test.go (+59/-4) client/service/service.go (+54/-68) client/service/service_test.go (+82/-71) debian/config.json (+1/-1) server/session/session_test.go (+1/-0) testing/helpers.go (+10/-0) |
To merge this branch: | bzr merge lp:~pedronis/ubuntu-push/refactor-service-setup |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
John Lenton (community) | Approve | ||
Review via email:
|
This proposal supersedes a proposal from 2014-07-03.
Commit message
* let take NewPushService a setup obj, have a generic manageReg
* update config.json now that registration is a base url
Description of the change
* let take NewPushService a setup obj, have a generic manageReg
* update config.json now that registration is a base url
To post a comment you must log in.
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
John Lenton (chipaca) : | # |
review:
Approve
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu One Auto Pilot (otto-pilot) wrote : | # |
- 217. By Samuele Pedroni
-
wait for inc elapsed time
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'client/client.go' | |||
2 | --- client/client.go 2014-07-02 20:52:56 +0000 | |||
3 | +++ client/client.go 2014-07-03 14:25:59 +0000 | |||
4 | @@ -26,6 +26,7 @@ | |||
5 | 26 | "errors" | 26 | "errors" |
6 | 27 | "fmt" | 27 | "fmt" |
7 | 28 | "io/ioutil" | 28 | "io/ioutil" |
8 | 29 | "net/url" | ||
9 | 29 | "os" | 30 | "os" |
10 | 30 | "os/exec" | 31 | "os/exec" |
11 | 31 | "strings" | 32 | "strings" |
12 | @@ -163,6 +164,19 @@ | |||
13 | 163 | } | 164 | } |
14 | 164 | } | 165 | } |
15 | 165 | 166 | ||
16 | 167 | // derivePushServiceSetup derives the service setup from the client configuration bits. | ||
17 | 168 | func (client *PushClient) derivePushServiceSetup() (*service.PushServiceSetup, error) { | ||
18 | 169 | setup := new(service.PushServiceSetup) | ||
19 | 170 | purl, err := url.Parse(client.config.RegistrationURL) | ||
20 | 171 | if err != nil { | ||
21 | 172 | return nil, fmt.Errorf("cannot parse registration url: %v", err) | ||
22 | 173 | } | ||
23 | 174 | setup.RegURL = purl | ||
24 | 175 | setup.DeviceId = client.deviceId | ||
25 | 176 | setup.AuthGetter = client.getAuthorization | ||
26 | 177 | return setup, nil | ||
27 | 178 | } | ||
28 | 179 | |||
29 | 166 | // getAuthorization gets the authorization blob to send to the server | 180 | // getAuthorization gets the authorization blob to send to the server |
30 | 167 | func (client *PushClient) getAuthorization(url string) string { | 181 | func (client *PushClient) getAuthorization(url string) string { |
31 | 168 | client.log.Debugf("getting authorization for %s", url) | 182 | client.log.Debugf("getting authorization for %s", url) |
32 | @@ -399,6 +413,10 @@ | |||
33 | 399 | } | 413 | } |
34 | 400 | 414 | ||
35 | 401 | func (client *PushClient) startService() error { | 415 | func (client *PushClient) startService() error { |
36 | 416 | setup, err := client.derivePushServiceSetup() | ||
37 | 417 | if err != nil { | ||
38 | 418 | return err | ||
39 | 419 | } | ||
40 | 402 | if client.pushServiceEndpoint == nil { | 420 | if client.pushServiceEndpoint == nil { |
41 | 403 | client.pushServiceEndpoint = bus.SessionBus.Endpoint(service.PushServiceBusAddress, client.log) | 421 | client.pushServiceEndpoint = bus.SessionBus.Endpoint(service.PushServiceBusAddress, client.log) |
42 | 404 | } | 422 | } |
43 | @@ -406,10 +424,7 @@ | |||
44 | 406 | client.postalServiceEndpoint = bus.SessionBus.Endpoint(service.PostalServiceBusAddress, client.log) | 424 | client.postalServiceEndpoint = bus.SessionBus.Endpoint(service.PostalServiceBusAddress, client.log) |
45 | 407 | } | 425 | } |
46 | 408 | 426 | ||
51 | 409 | client.pushService = service.NewPushService(client.pushServiceEndpoint, client.log) | 427 | client.pushService = service.NewPushService(client.pushServiceEndpoint, setup, client.log) |
48 | 410 | client.pushService.SetRegistrationURL(client.config.RegistrationURL) | ||
49 | 411 | client.pushService.SetAuthGetter(client.getAuthorization) | ||
50 | 412 | client.pushService.SetDeviceId(client.deviceId) | ||
52 | 413 | if err := client.pushService.Start(); err != nil { | 428 | if err := client.pushService.Start(); err != nil { |
53 | 414 | return err | 429 | return err |
54 | 415 | } | 430 | } |
55 | 416 | 431 | ||
56 | === modified file 'client/client_test.go' | |||
57 | --- client/client_test.go 2014-07-02 20:52:56 +0000 | |||
58 | +++ client/client_test.go 2014-07-03 14:25:59 +0000 | |||
59 | @@ -289,7 +289,7 @@ | |||
60 | 289 | // finally compare | 289 | // finally compare |
61 | 290 | conf := cli.deriveSessionConfig(info) | 290 | conf := cli.deriveSessionConfig(info) |
62 | 291 | // compare authGetter by string | 291 | // compare authGetter by string |
64 | 292 | c.Check(fmt.Sprintf("%v", conf.AuthGetter), Equals, fmt.Sprintf("%v", cli.getAuthorization)) | 292 | c.Check(fmt.Sprintf("%#v", conf.AuthGetter), Equals, fmt.Sprintf("%#v", cli.getAuthorization)) |
65 | 293 | // and set it to nil | 293 | // and set it to nil |
66 | 294 | conf.AuthGetter = nil | 294 | conf.AuthGetter = nil |
67 | 295 | expected.AuthGetter = nil | 295 | expected.AuthGetter = nil |
68 | @@ -297,6 +297,51 @@ | |||
69 | 297 | } | 297 | } |
70 | 298 | 298 | ||
71 | 299 | /***************************************************************** | 299 | /***************************************************************** |
72 | 300 | derivePushServiceSetup tests | ||
73 | 301 | ******************************************************************/ | ||
74 | 302 | |||
75 | 303 | func (cs *clientSuite) TestDerivePushServiceSetup(c *C) { | ||
76 | 304 | cs.writeTestConfig(map[string]interface{}{}) | ||
77 | 305 | cli := NewPushClient(cs.configPath, cs.leveldbPath) | ||
78 | 306 | err := cli.configure() | ||
79 | 307 | c.Assert(err, IsNil) | ||
80 | 308 | cli.deviceId = "zoo" | ||
81 | 309 | expected := &service.PushServiceSetup{ | ||
82 | 310 | DeviceId: "zoo", | ||
83 | 311 | AuthGetter: func(string) string { return "" }, | ||
84 | 312 | RegURL: helpers.ParseURL("reg://"), | ||
85 | 313 | } | ||
86 | 314 | // sanity check that we are looking at all fields | ||
87 | 315 | vExpected := reflect.ValueOf(expected).Elem() | ||
88 | 316 | nf := vExpected.NumField() | ||
89 | 317 | for i := 0; i < nf; i++ { | ||
90 | 318 | fv := vExpected.Field(i) | ||
91 | 319 | // field isn't empty/zero | ||
92 | 320 | c.Assert(fv.Interface(), Not(DeepEquals), reflect.Zero(fv.Type()).Interface(), Commentf("forgot about: %s", vExpected.Type().Field(i).Name)) | ||
93 | 321 | } | ||
94 | 322 | // finally compare | ||
95 | 323 | setup, err := cli.derivePushServiceSetup() | ||
96 | 324 | c.Assert(err, IsNil) | ||
97 | 325 | // compare authGetter by string | ||
98 | 326 | c.Check(fmt.Sprintf("%#v", setup.AuthGetter), Equals, fmt.Sprintf("%#v", cli.getAuthorization)) | ||
99 | 327 | // and set it to nil | ||
100 | 328 | setup.AuthGetter = nil | ||
101 | 329 | expected.AuthGetter = nil | ||
102 | 330 | c.Check(setup, DeepEquals, expected) | ||
103 | 331 | } | ||
104 | 332 | |||
105 | 333 | func (cs *clientSuite) TestDerivePushServiceSetupError(c *C) { | ||
106 | 334 | cs.writeTestConfig(map[string]interface{}{ | ||
107 | 335 | "registration_url": "%gh", | ||
108 | 336 | }) | ||
109 | 337 | cli := NewPushClient(cs.configPath, cs.leveldbPath) | ||
110 | 338 | err := cli.configure() | ||
111 | 339 | c.Assert(err, IsNil) | ||
112 | 340 | _, err = cli.derivePushServiceSetup() | ||
113 | 341 | c.Check(err, ErrorMatches, "cannot parse registration url:.*") | ||
114 | 342 | } | ||
115 | 343 | |||
116 | 344 | /***************************************************************** | ||
117 | 300 | startService tests | 345 | startService tests |
118 | 301 | ******************************************************************/ | 346 | ******************************************************************/ |
119 | 302 | 347 | ||
120 | @@ -305,7 +350,8 @@ | |||
121 | 305 | "auth_helper": helpers.ScriptAbsPath("dummyauth.sh"), | 350 | "auth_helper": helpers.ScriptAbsPath("dummyauth.sh"), |
122 | 306 | }) | 351 | }) |
123 | 307 | cli := NewPushClient(cs.configPath, cs.leveldbPath) | 352 | cli := NewPushClient(cs.configPath, cs.leveldbPath) |
125 | 308 | cli.configure() | 353 | err := cli.configure() |
126 | 354 | c.Assert(err, IsNil) | ||
127 | 309 | cli.log = cs.log | 355 | cli.log = cs.log |
128 | 310 | cli.deviceId = "fake-id" | 356 | cli.deviceId = "fake-id" |
129 | 311 | cli.pushServiceEndpoint = testibus.NewTestingEndpoint(condition.Work(true), nil) | 357 | cli.pushServiceEndpoint = testibus.NewTestingEndpoint(condition.Work(true), nil) |
130 | @@ -314,8 +360,6 @@ | |||
131 | 314 | c.Check(cli.startService(), IsNil) | 360 | c.Check(cli.startService(), IsNil) |
132 | 315 | c.Assert(cli.pushService, NotNil) | 361 | c.Assert(cli.pushService, NotNil) |
133 | 316 | c.Check(cli.pushService.IsRunning(), Equals, true) | 362 | c.Check(cli.pushService.IsRunning(), Equals, true) |
134 | 317 | c.Check(cli.pushService.GetDeviceId(), Equals, "fake-id") | ||
135 | 318 | c.Check(cli.pushService.GetRegistrationAuthorization(), Equals, "hello reg://") | ||
136 | 319 | c.Assert(cli.setupPostalService(), IsNil) | 363 | c.Assert(cli.setupPostalService(), IsNil) |
137 | 320 | c.Assert(cli.startPostalService(), IsNil) | 364 | c.Assert(cli.startPostalService(), IsNil) |
138 | 321 | c.Check(cli.postalService.IsRunning(), Equals, true) | 365 | c.Check(cli.postalService.IsRunning(), Equals, true) |
139 | @@ -323,6 +367,17 @@ | |||
140 | 323 | cli.postalService.Stop() | 367 | cli.postalService.Stop() |
141 | 324 | } | 368 | } |
142 | 325 | 369 | ||
143 | 370 | func (cs *clientSuite) TestStartServiceSetupError(c *C) { | ||
144 | 371 | cs.writeTestConfig(map[string]interface{}{ | ||
145 | 372 | "registration_url": "%gh", | ||
146 | 373 | }) | ||
147 | 374 | cli := NewPushClient(cs.configPath, cs.leveldbPath) | ||
148 | 375 | err := cli.configure() | ||
149 | 376 | c.Assert(err, IsNil) | ||
150 | 377 | err = cli.startService() | ||
151 | 378 | c.Check(err, ErrorMatches, "cannot parse registration url:.*") | ||
152 | 379 | } | ||
153 | 380 | |||
154 | 326 | func (cs *clientSuite) TestStartServiceErrorsOnNilLog(c *C) { | 381 | func (cs *clientSuite) TestStartServiceErrorsOnNilLog(c *C) { |
155 | 327 | cli := NewPushClient(cs.configPath, cs.leveldbPath) | 382 | cli := NewPushClient(cs.configPath, cs.leveldbPath) |
156 | 328 | c.Check(cli.log, IsNil) | 383 | c.Check(cli.log, IsNil) |
157 | 329 | 384 | ||
158 | === modified file 'client/service/service.go' | |||
159 | --- client/service/service.go 2014-07-01 11:55:30 +0000 | |||
160 | +++ client/service/service.go 2014-07-03 14:25:59 +0000 | |||
161 | @@ -23,6 +23,7 @@ | |||
162 | 23 | "fmt" | 23 | "fmt" |
163 | 24 | "io/ioutil" | 24 | "io/ioutil" |
164 | 25 | "net/http" | 25 | "net/http" |
165 | 26 | "net/url" | ||
166 | 26 | "os" | 27 | "os" |
167 | 27 | "strings" | 28 | "strings" |
168 | 28 | 29 | ||
169 | @@ -32,10 +33,17 @@ | |||
170 | 32 | "launchpad.net/ubuntu-push/nih" | 33 | "launchpad.net/ubuntu-push/nih" |
171 | 33 | ) | 34 | ) |
172 | 34 | 35 | ||
173 | 36 | // PushServiceSetup encapsulates the params for setting up a PushService. | ||
174 | 37 | type PushServiceSetup struct { | ||
175 | 38 | RegURL *url.URL | ||
176 | 39 | DeviceId string | ||
177 | 40 | AuthGetter func(string) string | ||
178 | 41 | } | ||
179 | 42 | |||
180 | 35 | // PushService is the dbus api | 43 | // PushService is the dbus api |
181 | 36 | type PushService struct { | 44 | type PushService struct { |
182 | 37 | DBusService | 45 | DBusService |
184 | 38 | regURL string | 46 | regURL *url.URL |
185 | 39 | deviceId string | 47 | deviceId string |
186 | 40 | authGetter func(string) string | 48 | authGetter func(string) string |
187 | 41 | httpCli http13.Client | 49 | httpCli http13.Client |
188 | @@ -50,59 +58,28 @@ | |||
189 | 50 | ) | 58 | ) |
190 | 51 | 59 | ||
191 | 52 | // NewPushService() builds a new service and returns it. | 60 | // NewPushService() builds a new service and returns it. |
193 | 53 | func NewPushService(bus bus.Endpoint, log logger.Logger) *PushService { | 61 | func NewPushService(bus bus.Endpoint, setup *PushServiceSetup, log logger.Logger) *PushService { |
194 | 54 | var svc = &PushService{} | 62 | var svc = &PushService{} |
195 | 55 | svc.Log = log | 63 | svc.Log = log |
196 | 56 | svc.Bus = bus | 64 | svc.Bus = bus |
197 | 65 | svc.regURL = setup.RegURL | ||
198 | 66 | svc.deviceId = setup.DeviceId | ||
199 | 67 | svc.authGetter = setup.AuthGetter | ||
200 | 57 | return svc | 68 | return svc |
201 | 58 | } | 69 | } |
202 | 59 | 70 | ||
249 | 60 | // SetRegistrationURL() sets the registration url for the service | 71 | // getAuthorization() returns the URL and the authorization header for |
250 | 61 | func (svc *PushService) SetRegistrationURL(url string) { | 72 | // POSTing to the registration HTTP endpoint for op |
251 | 62 | svc.lock.Lock() | 73 | func (svc *PushService) getAuthorization(op string) (string, string) { |
252 | 63 | defer svc.lock.Unlock() | 74 | if svc.authGetter == nil || svc.regURL == nil { |
253 | 64 | svc.regURL = url | 75 | return "", "" |
254 | 65 | } | 76 | } |
255 | 66 | 77 | purl, err := svc.regURL.Parse(op) | |
256 | 67 | // SetAuthGetter() sets the authorization getter for the service | 78 | if err != nil { |
257 | 68 | func (svc *PushService) SetAuthGetter(authGetter func(string) string) { | 79 | panic("op to getAuthorization was invalid") |
258 | 69 | svc.lock.Lock() | 80 | } |
259 | 70 | defer svc.lock.Unlock() | 81 | url := purl.String() |
260 | 71 | svc.authGetter = authGetter | 82 | return url, svc.authGetter(url) |
215 | 72 | } | ||
216 | 73 | |||
217 | 74 | // getRegistrationAuthorization() returns the authorization header for | ||
218 | 75 | // POSTing to the registration HTTP endpoint | ||
219 | 76 | // | ||
220 | 77 | // (this is for calling with the lock held) | ||
221 | 78 | func (svc *PushService) getRegistrationAuthorization() string { | ||
222 | 79 | if svc.authGetter != nil && svc.regURL != "" { | ||
223 | 80 | return svc.authGetter(svc.regURL) | ||
224 | 81 | } else { | ||
225 | 82 | return "" | ||
226 | 83 | } | ||
227 | 84 | } | ||
228 | 85 | |||
229 | 86 | // GetRegistrationAuthorization() returns the authorization header for | ||
230 | 87 | // POSTing to the registration HTTP endpoint | ||
231 | 88 | func (svc *PushService) GetRegistrationAuthorization() string { | ||
232 | 89 | svc.lock.RLock() | ||
233 | 90 | defer svc.lock.RUnlock() | ||
234 | 91 | return svc.getRegistrationAuthorization() | ||
235 | 92 | } | ||
236 | 93 | |||
237 | 94 | // SetDeviceId() sets the device id | ||
238 | 95 | func (svc *PushService) SetDeviceId(deviceId string) { | ||
239 | 96 | svc.lock.Lock() | ||
240 | 97 | defer svc.lock.Unlock() | ||
241 | 98 | svc.deviceId = deviceId | ||
242 | 99 | } | ||
243 | 100 | |||
244 | 101 | // GetDeviceId() returns the device id | ||
245 | 102 | func (svc *PushService) GetDeviceId() string { | ||
246 | 103 | svc.lock.RLock() | ||
247 | 104 | defer svc.lock.RUnlock() | ||
248 | 105 | return svc.deviceId | ||
261 | 106 | } | 83 | } |
262 | 107 | 84 | ||
263 | 108 | func (svc *PushService) Start() error { | 85 | func (svc *PushService) Start() error { |
264 | @@ -130,32 +107,21 @@ | |||
265 | 130 | Message string `json:"message"` // | 107 | Message string `json:"message"` // |
266 | 131 | } | 108 | } |
267 | 132 | 109 | ||
283 | 133 | func (svc *PushService) register(path string, args, _ []interface{}) ([]interface{}, error) { | 110 | func (svc *PushService) manageReg(op, appId string) (*registrationReply, error) { |
284 | 134 | svc.lock.RLock() | 111 | req_body, err := json.Marshal(registrationRequest{svc.deviceId, appId}) |
270 | 135 | defer svc.lock.RUnlock() | ||
271 | 136 | if len(args) != 0 { | ||
272 | 137 | return nil, BadArgCount | ||
273 | 138 | } | ||
274 | 139 | raw_appname := path[strings.LastIndex(path, "/")+1:] | ||
275 | 140 | appname := string(nih.Unquote([]byte(raw_appname))) | ||
276 | 141 | |||
277 | 142 | rv := os.Getenv("PUSH_REG_" + raw_appname) | ||
278 | 143 | if rv != "" { | ||
279 | 144 | return []interface{}{rv}, nil | ||
280 | 145 | } | ||
281 | 146 | |||
282 | 147 | req_body, err := json.Marshal(registrationRequest{svc.deviceId, appname}) | ||
285 | 148 | if err != nil { | 112 | if err != nil { |
286 | 149 | return nil, fmt.Errorf("unable to marshal register request body: %v", err) | 113 | return nil, fmt.Errorf("unable to marshal register request body: %v", err) |
287 | 150 | } | 114 | } |
293 | 151 | req, err := http13.NewRequest("POST", svc.regURL, bytes.NewReader(req_body)) | 115 | |
294 | 152 | if err != nil { | 116 | url, auth := svc.getAuthorization(op) |
290 | 153 | return nil, fmt.Errorf("unable to build register request: %v", err) | ||
291 | 154 | } | ||
292 | 155 | auth := svc.getRegistrationAuthorization() | ||
295 | 156 | if auth == "" { | 117 | if auth == "" { |
296 | 157 | return nil, BadAuth | 118 | return nil, BadAuth |
297 | 158 | } | 119 | } |
298 | 120 | |||
299 | 121 | req, err := http13.NewRequest("POST", url, bytes.NewReader(req_body)) | ||
300 | 122 | if err != nil { | ||
301 | 123 | panic(fmt.Errorf("unable to build register request: %v", err)) | ||
302 | 124 | } | ||
303 | 159 | req.Header.Add("Authorization", auth) | 125 | req.Header.Add("Authorization", auth) |
304 | 160 | req.Header.Add("Content-Type", "application/json") | 126 | req.Header.Add("Content-Type", "application/json") |
305 | 161 | 127 | ||
306 | @@ -188,6 +154,26 @@ | |||
307 | 188 | return nil, fmt.Errorf("unable to unmarshal register response: %v", err) | 154 | return nil, fmt.Errorf("unable to unmarshal register response: %v", err) |
308 | 189 | } | 155 | } |
309 | 190 | 156 | ||
310 | 157 | return &reply, nil | ||
311 | 158 | } | ||
312 | 159 | |||
313 | 160 | func (svc *PushService) register(path string, args, _ []interface{}) ([]interface{}, error) { | ||
314 | 161 | if len(args) != 0 { | ||
315 | 162 | return nil, BadArgCount | ||
316 | 163 | } | ||
317 | 164 | raw_appname := path[strings.LastIndex(path, "/")+1:] | ||
318 | 165 | appname := string(nih.Unquote([]byte(raw_appname))) | ||
319 | 166 | |||
320 | 167 | rv := os.Getenv("PUSH_REG_" + raw_appname) | ||
321 | 168 | if rv != "" { | ||
322 | 169 | return []interface{}{rv}, nil | ||
323 | 170 | } | ||
324 | 171 | |||
325 | 172 | reply, err := svc.manageReg("/register", appname) | ||
326 | 173 | if err != nil { | ||
327 | 174 | return nil, err | ||
328 | 175 | } | ||
329 | 176 | |||
330 | 191 | if !reply.Ok || reply.Token == "" { | 177 | if !reply.Ok || reply.Token == "" { |
331 | 192 | svc.Log.Errorf("Unexpected response: %#v", reply) | 178 | svc.Log.Errorf("Unexpected response: %#v", reply) |
332 | 193 | return nil, BadToken | 179 | return nil, BadToken |
333 | 194 | 180 | ||
334 | === modified file 'client/service/service_test.go' | |||
335 | --- client/service/service_test.go 2014-06-20 12:33:03 +0000 | |||
336 | +++ client/service/service_test.go 2014-07-03 14:25:59 +0000 | |||
337 | @@ -47,8 +47,25 @@ | |||
338 | 47 | ss.bus = testibus.NewTestingEndpoint(condition.Work(true), nil) | 47 | ss.bus = testibus.NewTestingEndpoint(condition.Work(true), nil) |
339 | 48 | } | 48 | } |
340 | 49 | 49 | ||
341 | 50 | var testSetup = &PushServiceSetup{} | ||
342 | 51 | |||
343 | 52 | func (ss *serviceSuite) TestBuild(c *C) { | ||
344 | 53 | setup := &PushServiceSetup{ | ||
345 | 54 | RegURL: helpers.ParseURL("http://reg"), | ||
346 | 55 | DeviceId: "FOO", | ||
347 | 56 | AuthGetter: func(s string) string { | ||
348 | 57 | return "" | ||
349 | 58 | }, | ||
350 | 59 | } | ||
351 | 60 | svc := NewPushService(ss.bus, setup, ss.log) | ||
352 | 61 | c.Check(svc.Bus, Equals, ss.bus) | ||
353 | 62 | c.Check(svc.regURL, DeepEquals, helpers.ParseURL("http://reg")) | ||
354 | 63 | c.Check(fmt.Sprintf("%#v", svc.authGetter), Equals, fmt.Sprintf("%#v", setup.AuthGetter)) | ||
355 | 64 | // ... | ||
356 | 65 | } | ||
357 | 66 | |||
358 | 50 | func (ss *serviceSuite) TestStart(c *C) { | 67 | func (ss *serviceSuite) TestStart(c *C) { |
360 | 51 | svc := NewPushService(ss.bus, ss.log) | 68 | svc := NewPushService(ss.bus, testSetup, ss.log) |
361 | 52 | c.Check(svc.IsRunning(), Equals, false) | 69 | c.Check(svc.IsRunning(), Equals, false) |
362 | 53 | c.Check(svc.Start(), IsNil) | 70 | c.Check(svc.Start(), IsNil) |
363 | 54 | c.Check(svc.IsRunning(), Equals, true) | 71 | c.Check(svc.IsRunning(), Equals, true) |
364 | @@ -56,31 +73,31 @@ | |||
365 | 56 | } | 73 | } |
366 | 57 | 74 | ||
367 | 58 | func (ss *serviceSuite) TestStartTwice(c *C) { | 75 | func (ss *serviceSuite) TestStartTwice(c *C) { |
369 | 59 | svc := NewPushService(ss.bus, ss.log) | 76 | svc := NewPushService(ss.bus, testSetup, ss.log) |
370 | 60 | c.Check(svc.Start(), IsNil) | 77 | c.Check(svc.Start(), IsNil) |
371 | 61 | c.Check(svc.Start(), Equals, AlreadyStarted) | 78 | c.Check(svc.Start(), Equals, AlreadyStarted) |
372 | 62 | svc.Stop() | 79 | svc.Stop() |
373 | 63 | } | 80 | } |
374 | 64 | 81 | ||
375 | 65 | func (ss *serviceSuite) TestStartNoLog(c *C) { | 82 | func (ss *serviceSuite) TestStartNoLog(c *C) { |
377 | 66 | svc := NewPushService(ss.bus, nil) | 83 | svc := NewPushService(ss.bus, testSetup, nil) |
378 | 67 | c.Check(svc.Start(), Equals, NotConfigured) | 84 | c.Check(svc.Start(), Equals, NotConfigured) |
379 | 68 | } | 85 | } |
380 | 69 | 86 | ||
381 | 70 | func (ss *serviceSuite) TestStartNoBus(c *C) { | 87 | func (ss *serviceSuite) TestStartNoBus(c *C) { |
383 | 71 | svc := NewPushService(nil, ss.log) | 88 | svc := NewPushService(nil, testSetup, ss.log) |
384 | 72 | c.Check(svc.Start(), Equals, NotConfigured) | 89 | c.Check(svc.Start(), Equals, NotConfigured) |
385 | 73 | } | 90 | } |
386 | 74 | 91 | ||
387 | 75 | func (ss *serviceSuite) TestStartFailsOnBusDialFailure(c *C) { | 92 | func (ss *serviceSuite) TestStartFailsOnBusDialFailure(c *C) { |
388 | 76 | bus := testibus.NewTestingEndpoint(condition.Work(false), nil) | 93 | bus := testibus.NewTestingEndpoint(condition.Work(false), nil) |
390 | 77 | svc := NewPushService(bus, ss.log) | 94 | svc := NewPushService(bus, testSetup, ss.log) |
391 | 78 | c.Check(svc.Start(), ErrorMatches, `.*(?i)cond said no.*`) | 95 | c.Check(svc.Start(), ErrorMatches, `.*(?i)cond said no.*`) |
392 | 79 | svc.Stop() | 96 | svc.Stop() |
393 | 80 | } | 97 | } |
394 | 81 | 98 | ||
395 | 82 | func (ss *serviceSuite) TestStartGrabsName(c *C) { | 99 | func (ss *serviceSuite) TestStartGrabsName(c *C) { |
397 | 83 | svc := NewPushService(ss.bus, ss.log) | 100 | svc := NewPushService(ss.bus, testSetup, ss.log) |
398 | 84 | c.Assert(svc.Start(), IsNil) | 101 | c.Assert(svc.Start(), IsNil) |
399 | 85 | callArgs := testibus.GetCallArgs(ss.bus) | 102 | callArgs := testibus.GetCallArgs(ss.bus) |
400 | 86 | defer svc.Stop() | 103 | defer svc.Stop() |
401 | @@ -89,7 +106,7 @@ | |||
402 | 89 | } | 106 | } |
403 | 90 | 107 | ||
404 | 91 | func (ss *serviceSuite) TestStopClosesBus(c *C) { | 108 | func (ss *serviceSuite) TestStopClosesBus(c *C) { |
406 | 92 | svc := NewPushService(ss.bus, ss.log) | 109 | svc := NewPushService(ss.bus, testSetup, ss.log) |
407 | 93 | c.Assert(svc.Start(), IsNil) | 110 | c.Assert(svc.Start(), IsNil) |
408 | 94 | svc.Stop() | 111 | svc.Stop() |
409 | 95 | callArgs := testibus.GetCallArgs(ss.bus) | 112 | callArgs := testibus.GetCallArgs(ss.bus) |
410 | @@ -99,35 +116,27 @@ | |||
411 | 99 | 116 | ||
412 | 100 | // registration tests | 117 | // registration tests |
413 | 101 | 118 | ||
414 | 102 | func (ss *serviceSuite) TestSetRegURLWorks(c *C) { | ||
415 | 103 | svc := NewPushService(ss.bus, ss.log) | ||
416 | 104 | c.Check(svc.regURL, Equals, "") | ||
417 | 105 | svc.SetRegistrationURL("xyzzy://") | ||
418 | 106 | c.Check(svc.regURL, Equals, "xyzzy://") | ||
419 | 107 | } | ||
420 | 108 | |||
421 | 109 | func (ss *serviceSuite) TestSetAuthGetterWorks(c *C) { | ||
422 | 110 | svc := NewPushService(ss.bus, ss.log) | ||
423 | 111 | c.Check(svc.authGetter, IsNil) | ||
424 | 112 | f := func(string) string { return "" } | ||
425 | 113 | svc.SetAuthGetter(f) | ||
426 | 114 | c.Check(fmt.Sprintf("%#v", svc.authGetter), Equals, fmt.Sprintf("%#v", f)) | ||
427 | 115 | } | ||
428 | 116 | |||
429 | 117 | func (ss *serviceSuite) TestGetRegAuthWorks(c *C) { | 119 | func (ss *serviceSuite) TestGetRegAuthWorks(c *C) { |
430 | 118 | svc := NewPushService(ss.bus, ss.log) | ||
431 | 119 | svc.SetRegistrationURL("xyzzy://") | ||
432 | 120 | ch := make(chan string, 1) | 120 | ch := make(chan string, 1) |
436 | 121 | f := func(s string) string { ch <- s; return "Auth " + s } | 121 | setup := &PushServiceSetup{ |
437 | 122 | svc.SetAuthGetter(f) | 122 | RegURL: helpers.ParseURL("http://foo"), |
438 | 123 | c.Check(svc.getRegistrationAuthorization(), Equals, "Auth xyzzy://") | 123 | AuthGetter: func(s string) string { |
439 | 124 | ch <- s | ||
440 | 125 | return "Auth " + s | ||
441 | 126 | }, | ||
442 | 127 | } | ||
443 | 128 | svc := NewPushService(ss.bus, setup, ss.log) | ||
444 | 129 | url, auth := svc.getAuthorization("/op") | ||
445 | 130 | c.Check(auth, Equals, "Auth http://foo/op") | ||
446 | 124 | c.Assert(len(ch), Equals, 1) | 131 | c.Assert(len(ch), Equals, 1) |
448 | 125 | c.Check(<-ch, Equals, "xyzzy://") | 132 | c.Check(<-ch, Equals, "http://foo/op") |
449 | 133 | c.Check(url, Equals, "http://foo/op") | ||
450 | 126 | } | 134 | } |
451 | 127 | 135 | ||
452 | 128 | func (ss *serviceSuite) TestGetRegAuthDoesNotPanic(c *C) { | 136 | func (ss *serviceSuite) TestGetRegAuthDoesNotPanic(c *C) { |
455 | 129 | svc := NewPushService(ss.bus, ss.log) | 137 | svc := NewPushService(ss.bus, testSetup, ss.log) |
456 | 130 | c.Check(svc.getRegistrationAuthorization(), Equals, "") | 138 | _, auth := svc.getAuthorization("/op") |
457 | 139 | c.Check(auth, Equals, "") | ||
458 | 131 | } | 140 | } |
459 | 132 | 141 | ||
460 | 133 | func (ss *serviceSuite) TestRegistrationFailsIfBadArgs(c *C) { | 142 | func (ss *serviceSuite) TestRegistrationFailsIfBadArgs(c *C) { |
461 | @@ -149,11 +158,12 @@ | |||
462 | 149 | fmt.Fprintln(w, `{"ok":true,"token":"blob-of-bytes"}`) | 158 | fmt.Fprintln(w, `{"ok":true,"token":"blob-of-bytes"}`) |
463 | 150 | })) | 159 | })) |
464 | 151 | defer ts.Close() | 160 | defer ts.Close() |
470 | 152 | 161 | setup := &PushServiceSetup{ | |
471 | 153 | svc := NewPushService(ss.bus, ss.log) | 162 | DeviceId: "fake-device-id", |
472 | 154 | svc.SetAuthGetter(func(string) string { return "tok" }) | 163 | RegURL: helpers.ParseURL(ts.URL), |
473 | 155 | svc.SetRegistrationURL(ts.URL) | 164 | AuthGetter: func(string) string { return "tok" }, |
474 | 156 | svc.SetDeviceId("fake-device-id") | 165 | } |
475 | 166 | svc := NewPushService(ss.bus, setup, ss.log) | ||
476 | 157 | // this'll check (un)quoting, too | 167 | // this'll check (un)quoting, too |
477 | 158 | reg, err := svc.register("/an_2dapp_2did", nil, nil) | 168 | reg, err := svc.register("/an_2dapp_2did", nil, nil) |
478 | 159 | c.Assert(err, IsNil) | 169 | c.Assert(err, IsNil) |
479 | @@ -175,60 +185,59 @@ | |||
480 | 175 | c.Check(err, IsNil) | 185 | c.Check(err, IsNil) |
481 | 176 | } | 186 | } |
482 | 177 | 187 | ||
493 | 178 | func (ss *serviceSuite) TestRegistrationFailsOnBadReqURL(c *C) { | 188 | func (ss *serviceSuite) TestManageRegFailsOnBadAuth(c *C) { |
484 | 179 | svc := NewPushService(ss.bus, ss.log) | ||
485 | 180 | svc.SetRegistrationURL("%gh") | ||
486 | 181 | reg, err := svc.register("thing", nil, nil) | ||
487 | 182 | c.Check(reg, IsNil) | ||
488 | 183 | c.Check(err, ErrorMatches, "unable to build register request: .*") | ||
489 | 184 | } | ||
490 | 185 | |||
491 | 186 | func (ss *serviceSuite) TestRegistrationFailsOnBadAuth(c *C) { | ||
492 | 187 | svc := NewPushService(ss.bus, ss.log) | ||
494 | 188 | // ... no auth added | 189 | // ... no auth added |
495 | 190 | svc := NewPushService(ss.bus, testSetup, ss.log) | ||
496 | 189 | reg, err := svc.register("thing", nil, nil) | 191 | reg, err := svc.register("thing", nil, nil) |
497 | 190 | c.Check(reg, IsNil) | 192 | c.Check(reg, IsNil) |
498 | 191 | c.Check(err, Equals, BadAuth) | 193 | c.Check(err, Equals, BadAuth) |
499 | 192 | } | 194 | } |
500 | 193 | 195 | ||
505 | 194 | func (ss *serviceSuite) TestRegistrationFailsOnNoServer(c *C) { | 196 | func (ss *serviceSuite) TestManageRegFailsOnNoServer(c *C) { |
506 | 195 | svc := NewPushService(ss.bus, ss.log) | 197 | setup := &PushServiceSetup{ |
507 | 196 | svc.SetRegistrationURL("xyzzy://") | 198 | DeviceId: "fake-device-id", |
508 | 197 | svc.SetAuthGetter(func(string) string { return "tok" }) | 199 | RegURL: helpers.ParseURL("xyzzy://"), |
509 | 200 | AuthGetter: func(string) string { return "tok" }, | ||
510 | 201 | } | ||
511 | 202 | svc := NewPushService(ss.bus, setup, ss.log) | ||
512 | 198 | reg, err := svc.register("thing", nil, nil) | 203 | reg, err := svc.register("thing", nil, nil) |
513 | 199 | c.Check(reg, IsNil) | 204 | c.Check(reg, IsNil) |
514 | 200 | c.Check(err, ErrorMatches, "unable to request registration: .*") | 205 | c.Check(err, ErrorMatches, "unable to request registration: .*") |
515 | 201 | } | 206 | } |
516 | 202 | 207 | ||
518 | 203 | func (ss *serviceSuite) TestRegistrationFailsOn40x(c *C) { | 208 | func (ss *serviceSuite) TestManageRegFailsOn40x(c *C) { |
519 | 204 | ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | 209 | ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
520 | 205 | http.Error(w, "I'm a teapot", 418) | 210 | http.Error(w, "I'm a teapot", 418) |
521 | 206 | })) | 211 | })) |
522 | 207 | defer ts.Close() | 212 | defer ts.Close() |
527 | 208 | 213 | setup := &PushServiceSetup{ | |
528 | 209 | svc := NewPushService(ss.bus, ss.log) | 214 | DeviceId: "fake-device-id", |
529 | 210 | svc.SetAuthGetter(func(string) string { return "tok" }) | 215 | RegURL: helpers.ParseURL(ts.URL), |
530 | 211 | svc.SetRegistrationURL(ts.URL) | 216 | AuthGetter: func(string) string { return "tok" }, |
531 | 217 | } | ||
532 | 218 | svc := NewPushService(ss.bus, setup, ss.log) | ||
533 | 212 | reg, err := svc.register("/thing", nil, nil) | 219 | reg, err := svc.register("/thing", nil, nil) |
534 | 213 | c.Check(err, Equals, BadRequest) | 220 | c.Check(err, Equals, BadRequest) |
535 | 214 | c.Check(reg, IsNil) | 221 | c.Check(reg, IsNil) |
536 | 215 | } | 222 | } |
537 | 216 | 223 | ||
539 | 217 | func (ss *serviceSuite) TestRegistrationFailsOn50x(c *C) { | 224 | func (ss *serviceSuite) TestManageRegFailsOn50x(c *C) { |
540 | 218 | ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | 225 | ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
541 | 219 | http.Error(w, "Not implemented", 501) | 226 | http.Error(w, "Not implemented", 501) |
542 | 220 | })) | 227 | })) |
543 | 221 | defer ts.Close() | 228 | defer ts.Close() |
548 | 222 | 229 | setup := &PushServiceSetup{ | |
549 | 223 | svc := NewPushService(ss.bus, ss.log) | 230 | DeviceId: "fake-device-id", |
550 | 224 | svc.SetAuthGetter(func(string) string { return "tok" }) | 231 | RegURL: helpers.ParseURL(ts.URL), |
551 | 225 | svc.SetRegistrationURL(ts.URL) | 232 | AuthGetter: func(string) string { return "tok" }, |
552 | 233 | } | ||
553 | 234 | svc := NewPushService(ss.bus, setup, ss.log) | ||
554 | 226 | reg, err := svc.register("/thing", nil, nil) | 235 | reg, err := svc.register("/thing", nil, nil) |
555 | 227 | c.Check(err, Equals, BadServer) | 236 | c.Check(err, Equals, BadServer) |
556 | 228 | c.Check(reg, IsNil) | 237 | c.Check(reg, IsNil) |
557 | 229 | } | 238 | } |
558 | 230 | 239 | ||
560 | 231 | func (ss *serviceSuite) TestRegistrationFailsOnBadJSON(c *C) { | 240 | func (ss *serviceSuite) TestManageRegFailsOnBadJSON(c *C) { |
561 | 232 | ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | 241 | ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
562 | 233 | buf := make([]byte, 256) | 242 | buf := make([]byte, 256) |
563 | 234 | n, e := r.Body.Read(buf) | 243 | n, e := r.Body.Read(buf) |
564 | @@ -241,18 +250,19 @@ | |||
565 | 241 | fmt.Fprintln(w, `{`) | 250 | fmt.Fprintln(w, `{`) |
566 | 242 | })) | 251 | })) |
567 | 243 | defer ts.Close() | 252 | defer ts.Close() |
573 | 244 | 253 | setup := &PushServiceSetup{ | |
574 | 245 | svc := NewPushService(ss.bus, ss.log) | 254 | DeviceId: "fake-device-id", |
575 | 246 | svc.SetAuthGetter(func(string) string { return "tok" }) | 255 | RegURL: helpers.ParseURL(ts.URL), |
576 | 247 | svc.SetRegistrationURL(ts.URL) | 256 | AuthGetter: func(string) string { return "tok" }, |
577 | 248 | svc.SetDeviceId("fake-device-id") | 257 | } |
578 | 258 | svc := NewPushService(ss.bus, setup, ss.log) | ||
579 | 249 | // this'll check (un)quoting, too | 259 | // this'll check (un)quoting, too |
580 | 250 | reg, err := svc.register("/an_2dapp_2did", nil, nil) | 260 | reg, err := svc.register("/an_2dapp_2did", nil, nil) |
581 | 251 | c.Check(reg, IsNil) | 261 | c.Check(reg, IsNil) |
582 | 252 | c.Check(err, ErrorMatches, "unable to unmarshal register response: .*") | 262 | c.Check(err, ErrorMatches, "unable to unmarshal register response: .*") |
583 | 253 | } | 263 | } |
584 | 254 | 264 | ||
586 | 255 | func (ss *serviceSuite) TestRegistrationFailsOnBadJSONDocument(c *C) { | 265 | func (ss *serviceSuite) TestManageRegFailsOnBadJSONDocument(c *C) { |
587 | 256 | ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | 266 | ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
588 | 257 | buf := make([]byte, 256) | 267 | buf := make([]byte, 256) |
589 | 258 | n, e := r.Body.Read(buf) | 268 | n, e := r.Body.Read(buf) |
590 | @@ -265,11 +275,12 @@ | |||
591 | 265 | fmt.Fprintln(w, `{"bananas": "very yes"}`) | 275 | fmt.Fprintln(w, `{"bananas": "very yes"}`) |
592 | 266 | })) | 276 | })) |
593 | 267 | defer ts.Close() | 277 | defer ts.Close() |
599 | 268 | 278 | setup := &PushServiceSetup{ | |
600 | 269 | svc := NewPushService(ss.bus, ss.log) | 279 | DeviceId: "fake-device-id", |
601 | 270 | svc.SetAuthGetter(func(string) string { return "tok" }) | 280 | RegURL: helpers.ParseURL(ts.URL), |
602 | 271 | svc.SetRegistrationURL(ts.URL) | 281 | AuthGetter: func(string) string { return "tok" }, |
603 | 272 | svc.SetDeviceId("fake-device-id") | 282 | } |
604 | 283 | svc := NewPushService(ss.bus, setup, ss.log) | ||
605 | 273 | // this'll check (un)quoting, too | 284 | // this'll check (un)quoting, too |
606 | 274 | reg, err := svc.register("/an_2dapp_2did", nil, nil) | 285 | reg, err := svc.register("/an_2dapp_2did", nil, nil) |
607 | 275 | c.Check(reg, IsNil) | 286 | c.Check(reg, IsNil) |
608 | 276 | 287 | ||
609 | === modified file 'debian/config.json' | |||
610 | --- debian/config.json 2014-06-19 21:12:04 +0000 | |||
611 | +++ debian/config.json 2014-07-03 14:25:59 +0000 | |||
612 | @@ -1,7 +1,7 @@ | |||
613 | 1 | { | 1 | { |
614 | 2 | "auth_helper": "/usr/lib/ubuntu-push-client/signing-helper", | 2 | "auth_helper": "/usr/lib/ubuntu-push-client/signing-helper", |
615 | 3 | "session_url": "https://push.ubuntu.com/", | 3 | "session_url": "https://push.ubuntu.com/", |
617 | 4 | "registration_url": "https://push.ubuntu.com/register", | 4 | "registration_url": "https://push.ubuntu.com", |
618 | 5 | "connect_timeout": "20s", | 5 | "connect_timeout": "20s", |
619 | 6 | "exchange_timeout": "30s", | 6 | "exchange_timeout": "30s", |
620 | 7 | "hosts_cache_expiry": "12h", | 7 | "hosts_cache_expiry": "12h", |
621 | 8 | 8 | ||
622 | === modified file 'server/session/session_test.go' | |||
623 | --- server/session/session_test.go 2014-06-19 13:06:52 +0000 | |||
624 | +++ server/session/session_test.go 2014-07-03 14:25:59 +0000 | |||
625 | @@ -373,6 +373,7 @@ | |||
626 | 373 | pingTimer: time.NewTimer(pingInterval), | 373 | pingTimer: time.NewTimer(pingInterval), |
627 | 374 | intervalStart: now, | 374 | intervalStart: now, |
628 | 375 | } | 375 | } |
629 | 376 | time.Sleep(10 * time.Millisecond) | ||
630 | 376 | l.pingTimer.Stop() | 377 | l.pingTimer.Stop() |
631 | 377 | done := l.pingTimerReset(true) | 378 | done := l.pingTimerReset(true) |
632 | 378 | c.Assert(done, Equals, true) | 379 | c.Assert(done, Equals, true) |
633 | 379 | 380 | ||
634 | === modified file 'testing/helpers.go' | |||
635 | --- testing/helpers.go 2014-06-23 12:46:28 +0000 | |||
636 | +++ testing/helpers.go 2014-07-03 14:25:59 +0000 | |||
637 | @@ -20,6 +20,7 @@ | |||
638 | 20 | import ( | 20 | import ( |
639 | 21 | "encoding/json" | 21 | "encoding/json" |
640 | 22 | "fmt" | 22 | "fmt" |
641 | 23 | "net/url" | ||
642 | 23 | "os" | 24 | "os" |
643 | 24 | "path" | 25 | "path" |
644 | 25 | "path/filepath" | 26 | "path/filepath" |
645 | @@ -160,3 +161,12 @@ | |||
646 | 160 | } | 161 | } |
647 | 161 | return res | 162 | return res |
648 | 162 | } | 163 | } |
649 | 164 | |||
650 | 165 | // ParseURL parses a URL conveniently. | ||
651 | 166 | func ParseURL(s string) *url.URL { | ||
652 | 167 | purl, err := url.Parse(s) | ||
653 | 168 | if err != nil { | ||
654 | 169 | panic(err) | ||
655 | 170 | } | ||
656 | 171 | return purl | ||
657 | 172 | } |
The attempt to merge lp:~pedronis/ubuntu-push/refactor-service-setup 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/bus launchpad. net/ubuntu- push/bus/ connectivity launchpad. net/ubuntu- push/bus/ networkmanager launchpad. net/ubuntu- push/bus/ notifications launchpad. net/ubuntu- push/bus/ notifications/ app_helper launchpad. net/ubuntu- push/bus/ systemimage launchpad. net/ubuntu- push/bus/ testing launchpad. net/ubuntu- push/bus/ urldispatcher 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/launch_ helper 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/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/testing launchpad. net/ubuntu- push/testing/ condition launchpad. net/ubuntu- push/util launchpad. net/ubuntu- push/whoopsie launchpad. net/ubuntu- push/whoopsie/ identifier launchpad. net/ubuntu- push/whoopsie/ identifier/ testing 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-automatic/ go-ws/bin/ godeps -u dependencies.tsv 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 net/ubuntu- push launchpad. net/ubuntu- push/bus launchpad. net/ubuntu- push/bus/ connectivity launchpad. net/ubuntu- push/bus/ networkmanager launchpad. net/ubuntu- push/bus/ notifications launchpad. net/ubuntu- push/bus/ notifications/ app_helper launchpad. net/ubuntu- push/bus/ systemimage launchpad. net/ubuntu- push/bus/ testing launchpad. net/ubuntu- push/bus/ urldispatcher launchpad. net/ubuntu- push/client launchpad. net/ubuntu- push/client/ gethosts launchpad. net/ubuntu- push/client/ service launchpad. net/ubuntu- pu...
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/
go install launchpad.
go test launchpad.