~dave-cheney/juju-core/153-fix-release-tools-script

« back to all changes in this revision

Viewing changes to cloudinit/cloudinit_test.go

  • Committer: Tarmac
  • Author(s): Andrew Wilkins
  • Date: 2013-08-30 01:48:39 UTC
  • mfrom: (1628.11.22 juju-add-machine)
  • Revision ID: tarmac-20130830014839-infsllif52ywy6yq
[r=axwalk] Update add-machine for manual provisioning

juju add-machine is updated to use a new package,
environs/manual, to manually provision tools and
a machine agent to an existing machine.

When a manually provisioned machine is destroyed
via juju destroy-machine, the machine agent will
detect its termination and remove its upstart
configuration file. There is currently no cleanup
of the data or log directories; this will be done
in a follow-up pending discussion.

When the machine goes to Dead, a provisioner will
remove the machine from state just like any other
machine.

TODO: destroy-environment will currently leak
manually provisioned machines. A follow-up will
address this by requiring users to individually
destroy-machine before destroy-environment will
proceed. Alternatively (or perhaps additionally),
destroy-environment may take a flag to automatically
do this.

https://codereview.appspot.com/12831043/

Show diffs side-by-side

added added

removed removed

Lines of Context:
257
257
        }
258
258
}
259
259
 
 
260
func (S) TestRunCmds(c *gc.C) {
 
261
        cfg := cloudinit.New()
 
262
        c.Assert(cfg.RunCmds(), gc.HasLen, 0)
 
263
        cfg.AddScripts("a", "b")
 
264
        cfg.AddRunCmdArgs("c", "d")
 
265
        cfg.AddRunCmd("e")
 
266
        c.Assert(cfg.RunCmds(), gc.DeepEquals, []interface{}{
 
267
                "a", "b", []string{"c", "d"}, "e",
 
268
        })
 
269
}
 
270
 
 
271
func (S) TestPackages(c *gc.C) {
 
272
        cfg := cloudinit.New()
 
273
        c.Assert(cfg.Packages(), gc.HasLen, 0)
 
274
        cfg.AddPackage("a b c")
 
275
        cfg.AddPackage("d!")
 
276
        c.Assert(cfg.Packages(), gc.DeepEquals, []string{"a b c", "d!"})
 
277
}
 
278
 
260
279
//#cloud-config
261
280
//packages:
262
281
//- juju