~jameinel/juju-core/api-rpc-reflect-version

« back to all changes in this revision

Viewing changes to provider/common/bootstrap_test.go

  • Committer: John Arbash Meinel
  • Date: 2014-05-14 12:29:15 UTC
  • mfrom: (2715.2.15 juju-core)
  • Revision ID: john@arbash-meinel.com-20140514122915-lf70e9bkkxx9m11q
Merge trunk r2730

Show diffs side-by-side

added added

removed removed

Lines of Context:
117
117
                return &mockInstance{id: "i-blah"}, nil, nil, nil
118
118
        }
119
119
 
120
 
        var stopped []instance.Instance
121
 
        stopInstances := func(instances []instance.Instance) error {
122
 
                stopped = append(stopped, instances...)
 
120
        var stopped []instance.Id
 
121
        stopInstances := func(ids []instance.Id) error {
 
122
                stopped = append(stopped, ids...)
123
123
                return nil
124
124
        }
125
125
 
134
134
        err := common.Bootstrap(ctx, env, environs.BootstrapParams{})
135
135
        c.Assert(err, gc.ErrorMatches, "cannot save state: suddenly a wild blah")
136
136
        c.Assert(stopped, gc.HasLen, 1)
137
 
        c.Assert(stopped[0].Id(), gc.Equals, instance.Id("i-blah"))
 
137
        c.Assert(stopped[0], gc.Equals, instance.Id("i-blah"))
138
138
}
139
139
 
140
140
func (s *BootstrapSuite) TestCannotRecordThenCannotStop(c *gc.C) {
150
150
                return &mockInstance{id: "i-blah"}, nil, nil, nil
151
151
        }
152
152
 
153
 
        var stopped []instance.Instance
154
 
        stopInstances := func(instances []instance.Instance) error {
 
153
        var stopped []instance.Id
 
154
        stopInstances := func(instances []instance.Id) error {
155
155
                stopped = append(stopped, instances...)
156
156
                return fmt.Errorf("bork bork borken")
157
157
        }
171
171
        err := common.Bootstrap(ctx, env, environs.BootstrapParams{})
172
172
        c.Assert(err, gc.ErrorMatches, "cannot save state: suddenly a wild blah")
173
173
        c.Assert(stopped, gc.HasLen, 1)
174
 
        c.Assert(stopped[0].Id(), gc.Equals, instance.Id("i-blah"))
 
174
        c.Assert(stopped[0], gc.Equals, instance.Id("i-blah"))
175
175
        c.Assert(tw.Log, jc.LogMatches, []jc.SimpleMessage{{
176
176
                loggo.ERROR, `cannot stop failed bootstrap instance "i-blah": bork bork borken`,
177
177
        }})