~fwereade/juju-core/unit-remove-depart-scopes

« back to all changes in this revision

Viewing changes to juju/testing/conn.go

  • Committer: William Reade
  • Date: 2013-11-07 17:30:38 UTC
  • mfrom: (2032.1.6 juju-core)
  • Revision ID: fwereade@gmail.com-20131107173038-d0a72q96dujotc0z
merge parent

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
        "launchpad.net/juju-core/state/api"
28
28
        "launchpad.net/juju-core/testing"
29
29
        "launchpad.net/juju-core/testing/testbase"
 
30
        "launchpad.net/juju-core/utils"
30
31
        "launchpad.net/juju-core/version"
31
32
)
32
33
 
150
151
func (s *JujuConnSuite) OpenAPIAsNewMachine(c *gc.C) (*api.State, *state.Machine) {
151
152
        machine, err := s.State.AddMachine("quantal", state.JobHostUnits)
152
153
        c.Assert(err, gc.IsNil)
153
 
        err = machine.SetPassword("test-password")
 
154
        password, err := utils.RandomPassword()
 
155
        c.Assert(err, gc.IsNil)
 
156
        err = machine.SetPassword(password)
154
157
        c.Assert(err, gc.IsNil)
155
158
        err = machine.SetProvisioned("foo", "fake_nonce", nil)
156
159
        c.Assert(err, gc.IsNil)
157
 
        return s.openAPIAs(c, machine.Tag(), "test-password", "fake_nonce"), machine
 
160
        return s.openAPIAs(c, machine.Tag(), password, "fake_nonce"), machine
158
161
}
159
162
 
160
163
func (s *JujuConnSuite) setUpConn(c *gc.C) {
281
284
}
282
285
 
283
286
func (s *JujuConnSuite) AgentConfigForTag(c *gc.C, tag string) agent.Config {
 
287
        password, err := utils.RandomPassword()
 
288
        c.Assert(err, gc.IsNil)
284
289
        config, err := agent.NewAgentConfig(
285
290
                agent.AgentConfigParams{
286
291
                        DataDir:        s.DataDir(),
287
292
                        Tag:            tag,
288
 
                        Password:       "dummy-secret",
 
293
                        Password:       password,
289
294
                        Nonce:          "nonce",
290
295
                        StateAddresses: s.StateInfo(c).Addrs,
291
296
                        APIAddresses:   s.APIInfo(c).Addrs,