Merge lp:~axwalk/juju-core/lp1254642-manual-provision-apiinfo into lp:~go-bot/juju-core/trunk

Proposed by Andrew Wilkins
Status: Merged
Approved by: Andrew Wilkins
Approved revision: no longer in the source branch.
Merged at revision: 2105
Proposed branch: lp:~axwalk/juju-core/lp1254642-manual-provision-apiinfo
Merge into: lp:~go-bot/juju-core/trunk
Diff against target: 36 lines (+22/-0)
1 file modified
environs/manual/provisioner_test.go (+22/-0)
To merge this branch: bzr merge lp:~axwalk/juju-core/lp1254642-manual-provision-apiinfo
Reviewer Review Type Date Requested Status
Juju Engineering Pending
Review via email: mp+197011@code.launchpad.net

Commit message

environs/manual: add test for API/State info

There was a regression in manual provisioning
wherein the APIInfo was being populated with
state server (mongo) addresses. This led to
manually provisioned machines being unable to
connect to the API server.

Kapil fixed this in another branch; this is
a test to ensure that it doesn't regress
again.

https://codereview.appspot.com/34630043/

Description of the change

environs/manual: add test for API/State info

There was a regression in manual provisioning
wherein the APIInfo was being populated with
state server (mongo) addresses. This led to
manually provisioned machines being unable to
connect to the API server.

Kapil fixed this in another branch; this is
a test to ensure that it doesn't regress
again.

https://codereview.appspot.com/34630043/

To post a comment you must log in.
Revision history for this message
Andrew Wilkins (axwalk) wrote :

Reviewers: mp+197011_code.launchpad.net,

Message:
Please take a look.

Description:
environs/manual: add test for API/State info

There was a regression in manual provisioning
wherein the APIInfo was being populated with
state server (mongo) addresses. This led to
manually provisioned machines being unable to
connect to the API server.

Kapil fixed this in another branch; this is
a test to ensure that it doesn't regress
again.

https://code.launchpad.net/~axwalk/juju-core/lp1254642-manual-provision-apiinfo/+merge/197011

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/34630043/

Affected files (+24, -0 lines):
   A [revision details]
   M environs/manual/provisioner_test.go

Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-20131128012708-7muo6qwh39wu805f
+New revision: <email address hidden>

Index: environs/manual/provisioner_test.go
=== modified file 'environs/manual/provisioner_test.go'
--- environs/manual/provisioner_test.go 2013-11-18 05:41:36 +0000
+++ environs/manual/provisioner_test.go 2013-11-28 05:33:34 +0000
@@ -12,6 +12,7 @@
   envtesting "launchpad.net/juju-core/environs/testing"
   "launchpad.net/juju-core/instance"
   "launchpad.net/juju-core/juju/testing"
+ "launchpad.net/juju-core/state"
   "launchpad.net/juju-core/state/api/params"
   jc "launchpad.net/juju-core/testing/checkers"
   "launchpad.net/juju-core/version"
@@ -89,3 +90,24 @@
   _, err = ProvisionMachine(args)
   c.Assert(err, gc.ErrorMatches, "error checking if provisioned: exit
status 255")
  }
+
+func (s *provisionerSuite) TestCreateMachineConfig(c *gc.C) {
+ const series = "precise"
+ const arch = "amd64"
+ defer fakeSSH{Series: series, Arch: arch}.install(c).Restore()
+ machineId, err := ProvisionMachine(s.getArgs(c))
+ c.Assert(err, gc.IsNil)
+
+ // Now check what we would've configured it with.
+ client := s.APIConn.State.Client()
+ mcfg, err := createMachineConfig(client, machineId, series, arch,
state.BootstrapNonce, "/var/lib/juju")
+ c.Assert(err, gc.IsNil)
+ c.Assert(mcfg, gc.NotNil)
+ c.Assert(mcfg.APIInfo, gc.NotNil)
+ c.Assert(mcfg.StateInfo, gc.NotNil)
+
+ stateInfo, apiInfo, err := s.APIConn.Environ.StateInfo()
+ c.Assert(err, gc.IsNil)
+ c.Assert(mcfg.APIInfo.Addrs, gc.DeepEquals, apiInfo.Addrs)
+ c.Assert(mcfg.StateInfo.Addrs, gc.DeepEquals, stateInfo.Addrs)
+}

Revision history for this message
John A Meinel (jameinel) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'environs/manual/provisioner_test.go'
2--- environs/manual/provisioner_test.go 2013-11-18 05:41:36 +0000
3+++ environs/manual/provisioner_test.go 2013-11-28 05:44:15 +0000
4@@ -12,6 +12,7 @@
5 envtesting "launchpad.net/juju-core/environs/testing"
6 "launchpad.net/juju-core/instance"
7 "launchpad.net/juju-core/juju/testing"
8+ "launchpad.net/juju-core/state"
9 "launchpad.net/juju-core/state/api/params"
10 jc "launchpad.net/juju-core/testing/checkers"
11 "launchpad.net/juju-core/version"
12@@ -89,3 +90,24 @@
13 _, err = ProvisionMachine(args)
14 c.Assert(err, gc.ErrorMatches, "error checking if provisioned: exit status 255")
15 }
16+
17+func (s *provisionerSuite) TestCreateMachineConfig(c *gc.C) {
18+ const series = "precise"
19+ const arch = "amd64"
20+ defer fakeSSH{Series: series, Arch: arch}.install(c).Restore()
21+ machineId, err := ProvisionMachine(s.getArgs(c))
22+ c.Assert(err, gc.IsNil)
23+
24+ // Now check what we would've configured it with.
25+ client := s.APIConn.State.Client()
26+ mcfg, err := createMachineConfig(client, machineId, series, arch, state.BootstrapNonce, "/var/lib/juju")
27+ c.Assert(err, gc.IsNil)
28+ c.Assert(mcfg, gc.NotNil)
29+ c.Assert(mcfg.APIInfo, gc.NotNil)
30+ c.Assert(mcfg.StateInfo, gc.NotNil)
31+
32+ stateInfo, apiInfo, err := s.APIConn.Environ.StateInfo()
33+ c.Assert(err, gc.IsNil)
34+ c.Assert(mcfg.APIInfo.Addrs, gc.DeepEquals, apiInfo.Addrs)
35+ c.Assert(mcfg.StateInfo.Addrs, gc.DeepEquals, stateInfo.Addrs)
36+}

Subscribers

People subscribed via source and target branches

to status/vote changes: