~rogpeppe/juju-core/438-local-instance-Addresses

« back to all changes in this revision

Viewing changes to environs/manual/bootstrap_test.go

  • Committer: Tarmac
  • Author(s): William Reade
  • Date: 2013-10-02 10:38:04 UTC
  • mfrom: (1915.1.3 juju-core)
  • Revision ID: tarmac-20131002103804-zxlnv7ik17unxc3p
[r=fwereade] provider/common: Destroy, and tests

Added a common implementation of Destroy, and tests for Bootstrap which had
somehow never been written. Also drive-by removed the machineId arg from
consideration when bootstrapping, because, WTF... a non-0 bootstrap machine
would break *everything*.

https://codereview.appspot.com/14254043/

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
                Host:          hostname,
74
74
                DataDir:       "/var/lib/juju",
75
75
                Environ:       s.env,
76
 
                MachineId:     "0",
77
76
                PossibleTools: toolsList,
78
77
        }
79
78
}
139
138
        c.Assert(Bootstrap(args), gc.ErrorMatches, "environ argument is nil")
140
139
}
141
140
 
142
 
func (s *bootstrapSuite) TestBootstrapInvalidMachineId(c *gc.C) {
143
 
        args := s.getArgs(c)
144
 
        args.MachineId = ""
145
 
        c.Assert(Bootstrap(args), gc.ErrorMatches, `"" is not a valid machine ID`)
146
 
        args.MachineId = "bahhumbug"
147
 
        c.Assert(Bootstrap(args), gc.ErrorMatches, `"bahhumbug" is not a valid machine ID`)
148
 
}
149
 
 
150
 
func (s *bootstrapSuite) TestBootstrapAlternativeMachineId(c *gc.C) {
151
 
        args := s.getArgs(c)
152
 
        args.MachineId = "1"
153
 
        defer fakeSSH{series: s.Conn.Environ.Config().DefaultSeries()}.install(c).Restore()
154
 
        c.Assert(Bootstrap(args), gc.IsNil)
155
 
}
156
 
 
157
141
func (s *bootstrapSuite) TestBootstrapNoMatchingTools(c *gc.C) {
158
142
        // Empty tools list.
159
143
        args := s.getArgs(c)