OLD | NEW |
1 // Copyright 2011, 2012, 2013 Canonical Ltd. | 1 // Copyright 2011, 2012, 2013 Canonical Ltd. |
2 // Licensed under the AGPLv3, see LICENCE file for details. | 2 // Licensed under the AGPLv3, see LICENCE file for details. |
3 | 3 |
4 package ec2_test | 4 package ec2_test |
5 | 5 |
6 import ( | 6 import ( |
7 "bytes" | 7 "bytes" |
8 "launchpad.net/goamz/aws" | 8 "launchpad.net/goamz/aws" |
9 amzec2 "launchpad.net/goamz/ec2" | 9 amzec2 "launchpad.net/goamz/ec2" |
10 "launchpad.net/goamz/ec2/ec2test" | 10 "launchpad.net/goamz/ec2/ec2test" |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 t.env = t.Tests.Env | 228 t.env = t.Tests.Env |
229 } | 229 } |
230 | 230 |
231 func (t *localServerSuite) TearDownTest(c *C) { | 231 func (t *localServerSuite) TearDownTest(c *C) { |
232 t.Tests.TearDownTest(c) | 232 t.Tests.TearDownTest(c) |
233 t.srv.stopServer(c) | 233 t.srv.stopServer(c) |
234 t.LoggingSuite.TearDownTest(c) | 234 t.LoggingSuite.TearDownTest(c) |
235 } | 235 } |
236 | 236 |
237 func (t *localServerSuite) TestBootstrapInstanceUserDataAndState(c *C) { | 237 func (t *localServerSuite) TestBootstrapInstanceUserDataAndState(c *C) { |
238 policy := t.env.AssignmentPolicy() | |
239 c.Assert(policy, Equals, state.AssignNew) | |
240 | |
241 envtesting.UploadFakeTools(c, t.env.Storage()) | 238 envtesting.UploadFakeTools(c, t.env.Storage()) |
242 err := environs.Bootstrap(t.env, constraints.Value{}) | 239 err := environs.Bootstrap(t.env, constraints.Value{}) |
243 c.Assert(err, IsNil) | 240 c.Assert(err, IsNil) |
244 | 241 |
245 // check that the state holds the id of the bootstrap machine. | 242 // check that the state holds the id of the bootstrap machine. |
246 bootstrapState, err := ec2.LoadState(t.env) | 243 bootstrapState, err := ec2.LoadState(t.env) |
247 c.Assert(err, IsNil) | 244 c.Assert(err, IsNil) |
248 c.Assert(bootstrapState.StateInstances, HasLen, 1) | 245 c.Assert(bootstrapState.StateInstances, HasLen, 1) |
249 | 246 |
250 insts, err := t.env.Instances(bootstrapState.StateInstances) | 247 insts, err := t.env.Instances(bootstrapState.StateInstances) |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 | 403 |
407 func (t *localNonUSEastSuite) TestPutBucket(c *C) { | 404 func (t *localNonUSEastSuite) TestPutBucket(c *C) { |
408 p := ec2.WritablePublicStorage(t.env).(ec2.Storage) | 405 p := ec2.WritablePublicStorage(t.env).(ec2.Storage) |
409 for i := 0; i < 5; i++ { | 406 for i := 0; i < 5; i++ { |
410 p.ResetMadeBucket() | 407 p.ResetMadeBucket() |
411 var buf bytes.Buffer | 408 var buf bytes.Buffer |
412 err := p.Put("test-file", &buf, 0) | 409 err := p.Put("test-file", &buf, 0) |
413 c.Assert(err, IsNil) | 410 c.Assert(err, IsNil) |
414 } | 411 } |
415 } | 412 } |
OLD | NEW |