LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2012, 2013 Canonical Ltd. | 1 // Copyright 2012, 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 "strings" | 8 "strings" |
9 stdtesting "testing" | 9 stdtesting "testing" |
10 "time" | 10 "time" |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 } | 287 } |
288 c.Logf("machine %v is still unprovisioned", m) | 288 c.Logf("machine %v is still unprovisioned", m) |
289 return false | 289 return false |
290 }) | 290 }) |
291 } | 291 } |
292 | 292 |
293 func (s *ProvisionerSuite) SetUpTest(c *gc.C) { | 293 func (s *ProvisionerSuite) SetUpTest(c *gc.C) { |
294 s.CommonProvisionerSuite.SetUpTest(c) | 294 s.CommonProvisionerSuite.SetUpTest(c) |
295 | 295 |
296 // Add an environment manager machine and login to the API. | 296 // Add an environment manager machine and login to the API. |
297 » machine, err := s.State.AddMachine("quantal", state.JobManageEnviron) | 297 » machine, err := s.State.AddMachine("quantal", state.JobManageEnviron, st
ate.JobManageState) |
298 c.Assert(err, gc.IsNil) | 298 c.Assert(err, gc.IsNil) |
299 c.Assert(machine.Id(), gc.Equals, "0") | 299 c.Assert(machine.Id(), gc.Equals, "0") |
| 300 err = machine.SetAddresses([]instance.Address{ |
| 301 instance.NewAddress("0.1.2.3"), |
| 302 }) |
| 303 c.Assert(err, gc.IsNil) |
300 s.APILogin(c, machine) | 304 s.APILogin(c, machine) |
301 } | 305 } |
302 | 306 |
303 func (s *ProvisionerSuite) newEnvironProvisioner(c *gc.C) *provisioner.Provision
er { | 307 func (s *ProvisionerSuite) newEnvironProvisioner(c *gc.C) *provisioner.Provision
er { |
304 machineTag := "machine-0" | 308 machineTag := "machine-0" |
305 agentConfig := s.AgentConfigForTag(c, machineTag) | 309 agentConfig := s.AgentConfigForTag(c, machineTag) |
306 return provisioner.NewProvisioner(provisioner.ENVIRON, s.provisioner, ag
entConfig) | 310 return provisioner.NewProvisioner(provisioner.ENVIRON, s.provisioner, ag
entConfig) |
307 } | 311 } |
308 | 312 |
309 func (s *ProvisionerSuite) TestProvisionerStartStop(c *gc.C) { | 313 func (s *ProvisionerSuite) TestProvisionerStartStop(c *gc.C) { |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 c.Fatalf("PA did not action config change") | 600 c.Fatalf("PA did not action config change") |
597 } | 601 } |
598 | 602 |
599 // create a third machine | 603 // create a third machine |
600 m, err = s.addMachine() | 604 m, err = s.addMachine() |
601 c.Assert(err, gc.IsNil) | 605 c.Assert(err, gc.IsNil) |
602 | 606 |
603 // the PA should create it using the new environment | 607 // the PA should create it using the new environment |
604 s.checkStartInstanceCustom(c, m, "beef", s.defaultConstraints) | 608 s.checkStartInstanceCustom(c, m, "beef", s.defaultConstraints) |
605 } | 609 } |
LEFT | RIGHT |