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

Side by Side Diff: environs/openstack/live_test.go

Issue 8545043: environs: extract tools package
Patch Set: environs: extract tools package Created 10 years, 11 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/maas/environ_test.go ('k') | environs/openstack/local_test.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 package openstack_test 1 package openstack_test
2 2
3 import ( 3 import (
4 "crypto/rand" 4 "crypto/rand"
5 "fmt" 5 "fmt"
6 "io" 6 "io"
7 . "launchpad.net/gocheck" 7 . "launchpad.net/gocheck"
8 "launchpad.net/goose/client" 8 "launchpad.net/goose/client"
9 "launchpad.net/goose/identity" 9 "launchpad.net/goose/identity"
10 "launchpad.net/juju-core/environs" 10 "launchpad.net/juju-core/environs"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 "auth-url": t.cred.URL, 102 "auth-url": t.cred.URL,
103 }) 103 })
104 t.LiveTests.SetUpSuite(c) 104 t.LiveTests.SetUpSuite(c)
105 // Environ.PublicStorage() is read only. 105 // Environ.PublicStorage() is read only.
106 // For testing, we create a specific storage instance which is authorise d to write to 106 // For testing, we create a specific storage instance which is authorise d to write to
107 // the public storage bucket so that we can upload files for testing. 107 // the public storage bucket so that we can upload files for testing.
108 t.writeablePublicStorage = openstack.WritablePublicStorage(t.Env) 108 t.writeablePublicStorage = openstack.WritablePublicStorage(t.Env)
109 // Put some fake tools in place so that tests that are simply 109 // Put some fake tools in place so that tests that are simply
110 // starting instances without any need to check if those instances 110 // starting instances without any need to check if those instances
111 // are running will find them in the public bucket. 111 // are running will find them in the public bucket.
112 » envtesting.PutFakeTools(c, t.writeablePublicStorage) 112 » envtesting.UploadFakeTools(c, t.writeablePublicStorage)
113 } 113 }
114 114
115 func (t *LiveTests) TearDownSuite(c *C) { 115 func (t *LiveTests) TearDownSuite(c *C) {
116 if t.Env == nil { 116 if t.Env == nil {
117 // This can happen if SetUpSuite fails. 117 // This can happen if SetUpSuite fails.
118 return 118 return
119 } 119 }
120 if t.writeablePublicStorage != nil { 120 if t.writeablePublicStorage != nil {
121 err := openstack.DeleteStorageContent(t.writeablePublicStorage) 121 err := openstack.DeleteStorageContent(t.writeablePublicStorage)
122 c.Check(err, IsNil) 122 c.Check(err, IsNil)
(...skipping 20 matching lines...) Expand all
143 c.Assert(flavorId, Not(Equals), "") 143 c.Assert(flavorId, Not(Equals), "")
144 } 144 }
145 145
146 func (t *LiveTests) TestFindImageBadFlavor(c *C) { 146 func (t *LiveTests) TestFindImageBadFlavor(c *C) {
147 imageId, flavorId, err := openstack.FindInstanceSpec(t.Env, "precise", " amd64", "bad.flavor") 147 imageId, flavorId, err := openstack.FindInstanceSpec(t.Env, "precise", " amd64", "bad.flavor")
148 _, ok := err.(environs.NotFoundError) 148 _, ok := err.(environs.NotFoundError)
149 c.Assert(ok, Equals, true) 149 c.Assert(ok, Equals, true)
150 c.Assert(imageId, Equals, "") 150 c.Assert(imageId, Equals, "")
151 c.Assert(flavorId, Equals, "") 151 c.Assert(flavorId, Equals, "")
152 } 152 }
OLDNEW
« no previous file with comments | « environs/maas/environ_test.go ('k') | environs/openstack/local_test.go » ('j') | no next file with comments »

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