Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(41)

Side by Side Diff: environs/ec2/local_test.go

Issue 9824043: Move assignment policy to global env config (Closed)
Patch Set: Move assignment policy to global env config Created 10 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « environs/ec2/ec2.go ('k') | environs/interface.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « environs/ec2/ec2.go ('k') | environs/interface.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b