LEFT | RIGHT |
1 package ec2 | 1 package ec2 |
2 | 2 |
3 import ( | 3 import ( |
4 "io/ioutil" | 4 "io/ioutil" |
5 "launchpad.net/goamz/aws" | 5 "launchpad.net/goamz/aws" |
6 . "launchpad.net/gocheck" | 6 . "launchpad.net/gocheck" |
7 "launchpad.net/goyaml" | 7 "launchpad.net/goyaml" |
8 "launchpad.net/juju-core/environs" | 8 "launchpad.net/juju-core/environs" |
9 "launchpad.net/juju-core/environs/config" | 9 "launchpad.net/juju-core/environs/config" |
10 "launchpad.net/juju-core/testing" | 10 "launchpad.net/juju-core/testing" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 err string | 44 err string |
45 } | 45 } |
46 | 46 |
47 type attrs map[string]interface{} | 47 type attrs map[string]interface{} |
48 | 48 |
49 func (t configTest) check(c *C) { | 49 func (t configTest) check(c *C) { |
50 envs := attrs{ | 50 envs := attrs{ |
51 "environments": attrs{ | 51 "environments": attrs{ |
52 "testenv": attrs{ | 52 "testenv": attrs{ |
53 "type": "ec2", | 53 "type": "ec2", |
54 » » » » "ca-cert": testing.CACertPEM, | 54 » » » » "ca-cert": testing.CACert, |
55 » » » » "ca-private-key": testing.CAKeyPEM, | 55 » » » » "ca-private-key": testing.CAKey, |
56 }, | 56 }, |
57 }, | 57 }, |
58 } | 58 } |
59 testenv := envs["environments"].(attrs)["testenv"].(attrs) | 59 testenv := envs["environments"].(attrs)["testenv"].(attrs) |
60 for k, v := range t.config { | 60 for k, v := range t.config { |
61 testenv[k] = v | 61 testenv[k] = v |
62 } | 62 } |
63 if _, ok := testenv["control-bucket"]; !ok { | 63 if _, ok := testenv["control-bucket"]; !ok { |
64 testenv["control-bucket"] = "x" | 64 testenv["control-bucket"] = "x" |
65 } | 65 } |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 } | 266 } |
267 } | 267 } |
268 | 268 |
269 func (s *ConfigSuite) TestMissingAuth(c *C) { | 269 func (s *ConfigSuite) TestMissingAuth(c *C) { |
270 os.Setenv("AWS_ACCESS_KEY_ID", "") | 270 os.Setenv("AWS_ACCESS_KEY_ID", "") |
271 os.Setenv("AWS_SECRET_ACCESS_KEY", "") | 271 os.Setenv("AWS_SECRET_ACCESS_KEY", "") |
272 test := configTests[0] | 272 test := configTests[0] |
273 test.err = "environment has no access-key or secret-key" | 273 test.err = "environment has no access-key or secret-key" |
274 test.check(c) | 274 test.check(c) |
275 } | 275 } |
LEFT | RIGHT |