~themue/juju-core/050-prepare-openstack

« back to all changes in this revision

Viewing changes to state/machine_test.go

  • Committer: Dimiter Naydenov
  • Date: 2013-07-29 15:15:41 UTC
  • mto: This revision was merged to the branch mainline in revision 1565.
  • Revision ID: dimiter.naydenov@canonical.com-20130729151541-zm8murwo9u7mtsdu
names: new package

Show diffs side-by-side

added added

removed removed

Lines of Context:
243
243
        c.Assert(s.machine.Tag(), Equals, "machine-0")
244
244
}
245
245
 
246
 
func (s *MachineSuite) TestMachineTag(c *C) {
247
 
        c.Assert(state.MachineTag("10"), Equals, "machine-10")
248
 
        // Check a container id.
249
 
        c.Assert(state.MachineTag("10/lxc/1"), Equals, "machine-10-lxc-1")
250
 
}
251
 
 
252
 
func (s *MachineSuite) TestMachineIdFromTag(c *C) {
253
 
        c.Assert(state.MachineIdFromTag("machine-10"), Equals, "10")
254
 
        // Check a container id.
255
 
        c.Assert(state.MachineIdFromTag("machine-10-lxc-1"), Equals, "10/lxc/1")
256
 
        // Check reversability.
257
 
        nested := "2/kvm/0/lxc/3"
258
 
        c.Assert(state.MachineIdFromTag(state.MachineTag(nested)), Equals, nested)
259
 
        // Try with an invalid tag format.
260
 
        c.Assert(state.MachineIdFromTag("foo"), Equals, "")
261
 
}
262
 
 
263
246
func (s *MachineSuite) TestSetMongoPassword(c *C) {
264
247
        testSetMongoPassword(c, func(st *state.State) (entity, error) {
265
248
                return st.Machine(s.machine.Id())