~themue/juju-core/014-deployer-lxc-context

« back to all changes in this revision

Viewing changes to cmd/jujud/unit_test.go

  • Committer: Frank Mueller
  • Date: 2013-03-08 15:52:51 UTC
  • mfrom: (964.1.7 juju-core)
  • Revision ID: themue@gmail.com-20130308155251-t7qj6b3s2rycsp9j
deployer: merged trunk and renamed manager to context

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
func (s *UnitSuite) TestRunStop(c *C) {
71
71
        unit, conf, _ := s.primeAgent(c)
72
72
        a := s.newAgent(c, unit)
73
 
        mgr, reset := patchDeployManager(c, conf.StateInfo, conf.DataDir)
 
73
        ctx, reset := patchDeployContext(c, conf.StateInfo, conf.DataDir)
74
74
        defer reset()
75
75
        go func() { c.Check(a.Run(nil), IsNil) }()
76
76
        defer func() { c.Check(a.Stop(), IsNil) }()
103
103
        }
104
104
 
105
105
        // Check no subordinates have been deployed.
106
 
        mgr.waitDeployed(c)
 
106
        ctx.waitDeployed(c)
107
107
 
108
108
        // Add a relation with a subordinate service and wait for the subordinate
109
109
        // to be deployed...
113
113
        c.Assert(err, IsNil)
114
114
        _, err = s.State.AddRelation(eps...)
115
115
        c.Assert(err, IsNil)
116
 
        mgr.waitDeployed(c, "logging/0")
 
116
        ctx.waitDeployed(c, "logging/0")
117
117
 
118
118
        // ...then kill the subordinate and wait for it to be recalled and removed.
119
119
        logging0, err := s.State.Unit("logging/0")
120
120
        c.Assert(err, IsNil)
121
121
        err = logging0.EnsureDead()
122
122
        c.Assert(err, IsNil)
123
 
        mgr.waitDeployed(c)
 
123
        ctx.waitDeployed(c)
124
124
        err = logging0.Refresh()
125
125
        c.Assert(state.IsNotFound(err), Equals, true)
126
126
}