OLD | NEW |
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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 s.lxcSuite.TearDownSuite(c) | 177 s.lxcSuite.TearDownSuite(c) |
178 s.CommonProvisionerSuite.TearDownSuite(c) | 178 s.CommonProvisionerSuite.TearDownSuite(c) |
179 } | 179 } |
180 | 180 |
181 func (s *lxcProvisionerSuite) SetUpTest(c *gc.C) { | 181 func (s *lxcProvisionerSuite) SetUpTest(c *gc.C) { |
182 s.CommonProvisionerSuite.SetUpTest(c) | 182 s.CommonProvisionerSuite.SetUpTest(c) |
183 s.lxcSuite.SetUpTest(c) | 183 s.lxcSuite.SetUpTest(c) |
184 | 184 |
185 // The lxc provisioner actually needs the machine it is being created on | 185 // The lxc provisioner actually needs the machine it is being created on |
186 // to be in state, in order to get the watcher. | 186 // to be in state, in order to get the watcher. |
187 » m, err := s.State.AddMachine(config.DefaultSeries, state.JobHostUnits) | 187 » m, err := s.State.AddMachine(config.DefaultSeries, state.JobHostUnits, s
tate.JobManageState) |
| 188 » c.Assert(err, gc.IsNil) |
| 189 » err = m.SetAddresses([]instance.Address{ |
| 190 » » instance.NewAddress("0.1.2.3"), |
| 191 » }) |
188 c.Assert(err, gc.IsNil) | 192 c.Assert(err, gc.IsNil) |
189 s.parentMachineId = m.Id() | 193 s.parentMachineId = m.Id() |
190 s.APILogin(c, m) | 194 s.APILogin(c, m) |
191 err = m.SetAgentVersion(version.Current) | 195 err = m.SetAgentVersion(version.Current) |
192 c.Assert(err, gc.IsNil) | 196 c.Assert(err, gc.IsNil) |
193 | 197 |
194 s.events = make(chan mock.Event, 25) | 198 s.events = make(chan mock.Event, 25) |
195 s.Factory.AddListener(s.events) | 199 s.Factory.AddListener(s.events) |
196 } | 200 } |
197 | 201 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 defer stop(c, p) | 270 defer stop(c, p) |
267 | 271 |
268 container := s.addContainer(c) | 272 container := s.addContainer(c) |
269 instId := s.expectStarted(c, container) | 273 instId := s.expectStarted(c, container) |
270 | 274 |
271 // ...and removed, along with the machine, when the machine is Dead. | 275 // ...and removed, along with the machine, when the machine is Dead. |
272 c.Assert(container.EnsureDead(), gc.IsNil) | 276 c.Assert(container.EnsureDead(), gc.IsNil) |
273 s.expectStopped(c, instId) | 277 s.expectStopped(c, instId) |
274 s.waitRemoved(c, container) | 278 s.waitRemoved(c, container) |
275 } | 279 } |
OLD | NEW |