Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(14)

Delta Between Two Patch Sets: worker/provisioner/lxc-broker_test.go

Issue 87560043: errors: Improve tests, unify interfaces, wrapping (Closed)
Left Patch Set: Created 10 years, 11 months ago
Right Patch Set: errors: Improve tests, unify interfaces, wrapping Created 10 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « worker/provisioner/kvm-broker_test.go ('k') | worker/provisioner/provisioner.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2013 Canonical Ltd. 1 // Copyright 2013 Canonical Ltd.
2 // Licensed under the AGPLv3, see LICENCE file for details. 2 // Licensed under the AGPLv3, see LICENCE file for details.
3 3
4 package provisioner_test 4 package provisioner_test
5 5
6 import ( 6 import (
7 "fmt" 7 "fmt"
8 "io/ioutil" 8 "io/ioutil"
9 "path/filepath" 9 "path/filepath"
10 "time" 10 "time"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 func (s *lxcProvisionerSuite) SetUpTest(c *gc.C) { 187 func (s *lxcProvisionerSuite) SetUpTest(c *gc.C) {
188 s.CommonProvisionerSuite.SetUpTest(c) 188 s.CommonProvisionerSuite.SetUpTest(c)
189 s.lxcSuite.SetUpTest(c) 189 s.lxcSuite.SetUpTest(c)
190 190
191 // The lxc provisioner actually needs the machine it is being created on 191 // The lxc provisioner actually needs the machine it is being created on
192 // to be in state, in order to get the watcher. 192 // to be in state, in order to get the watcher.
193 m, err := s.State.AddMachine(coretesting.FakeDefaultSeries, state.JobHos tUnits, state.JobManageEnviron) 193 m, err := s.State.AddMachine(coretesting.FakeDefaultSeries, state.JobHos tUnits, state.JobManageEnviron)
194 c.Assert(err, gc.IsNil) 194 c.Assert(err, gc.IsNil)
195 err = m.SetAddresses(instance.NewAddress("0.1.2.3", instance.NetworkUnkn own)) 195 err = m.SetAddresses(instance.NewAddress("0.1.2.3", instance.NetworkUnkn own))
196 c.Assert(err, gc.IsNil) 196 c.Assert(err, gc.IsNil)
197
198 hostPorts := [][]instance.HostPort{{{
199 Address: instance.NewAddress("0.1.2.3", instance.NetworkUnknown) ,
200 Port: 1234,
201 }}}
202 err = s.State.SetAPIHostPorts(hostPorts)
203 c.Assert(err, gc.IsNil)
204
205 c.Assert(err, gc.IsNil)
197 s.parentMachineId = m.Id() 206 s.parentMachineId = m.Id()
198 s.APILogin(c, m) 207 s.APILogin(c, m)
199 err = m.SetAgentVersion(version.Current) 208 err = m.SetAgentVersion(version.Current)
200 c.Assert(err, gc.IsNil) 209 c.Assert(err, gc.IsNil)
201 210
202 s.events = make(chan mock.Event, 25) 211 s.events = make(chan mock.Event, 25)
203 s.Factory.AddListener(s.events) 212 s.Factory.AddListener(s.events)
204 } 213 }
205 214
206 func (s *lxcProvisionerSuite) expectStarted(c *gc.C, machine *state.Machine) str ing { 215 func (s *lxcProvisionerSuite) expectStarted(c *gc.C, machine *state.Machine) str ing {
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 } 307 }
299 308
300 type fakeAPI struct{} 309 type fakeAPI struct{}
301 310
302 func (*fakeAPI) ContainerConfig() (params.ContainerConfig, error) { 311 func (*fakeAPI) ContainerConfig() (params.ContainerConfig, error) {
303 return params.ContainerConfig{ 312 return params.ContainerConfig{
304 ProviderType: "fake", 313 ProviderType: "fake",
305 AuthorizedKeys: coretesting.FakeAuthKeys, 314 AuthorizedKeys: coretesting.FakeAuthKeys,
306 SSLHostnameVerification: true}, nil 315 SSLHostnameVerification: true}, nil
307 } 316 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b