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

Delta Between Two Patch Sets: environs/openstack/local_test.go

Issue 6855054: state: add CACert to Info.
Left Patch Set: state: add RootCertPEM to Info. Created 12 years, 4 months ago
Right Patch Set: state: add CACert to Info. Created 12 years, 4 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:
Right: Side by side diff | Download
« no previous file with change/comment | « environs/openstack/config_test.go ('k') | environs/openstack/provider.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 package openstack_test 1 package openstack_test
2 2
3 import ( 3 import (
4 . "launchpad.net/gocheck" 4 . "launchpad.net/gocheck"
5 "launchpad.net/juju-core/environs" 5 "launchpad.net/juju-core/environs"
6 "launchpad.net/juju-core/environs/openstack" 6 "launchpad.net/juju-core/environs/openstack"
7 coretesting "launchpad.net/juju-core/testing" 7 coretesting "launchpad.net/juju-core/testing"
8 "testing" 8 "testing"
9 ) 9 )
10 10
11 func init() { 11 func init() {
12 } 12 }
13 13
14 type LocalSuite struct { 14 type LocalSuite struct {
15 env environs.Environ 15 env environs.Environ
16 } 16 }
17 17
18 var _ = Suite(&LocalSuite{}) 18 var _ = Suite(&LocalSuite{})
19 19
20 func Test(t *testing.T) { 20 func Test(t *testing.T) {
21 TestingT(t) 21 TestingT(t)
22 } 22 }
23 23
24 func (s *LocalSuite) SetUpSuite(c *C) { 24 func (s *LocalSuite) SetUpSuite(c *C) {
25 env, err := environs.NewFromAttrs(map[string]interface{}{ 25 env, err := environs.NewFromAttrs(map[string]interface{}{
26 "name": "test", 26 "name": "test",
27 "type": "openstack", 27 "type": "openstack",
28 "authorized-keys": "foo", 28 "authorized-keys": "foo",
29 » » "ca-cert": coretesting.CACertPEM, 29 » » "ca-cert": coretesting.CACert,
30 » » "ca-private-key": coretesting.CAKeyPEM, 30 » » "ca-private-key": coretesting.CAKey,
31 }) 31 })
32 c.Assert(err, IsNil) 32 c.Assert(err, IsNil)
33 s.env = env 33 s.env = env
34 openstack.UseTestMetadata(true) 34 openstack.UseTestMetadata(true)
35 openstack.ShortTimeouts(true) 35 openstack.ShortTimeouts(true)
36 } 36 }
37 37
38 func (s *LocalSuite) TearDownSuite(c *C) { 38 func (s *LocalSuite) TearDownSuite(c *C) {
39 openstack.UseTestMetadata(false) 39 openstack.UseTestMetadata(false)
40 openstack.ShortTimeouts(false) 40 openstack.ShortTimeouts(false)
41 s.env = nil 41 s.env = nil
42 } 42 }
43 43
44 func (s *LocalSuite) TestPrivateAddress(c *C) { 44 func (s *LocalSuite) TestPrivateAddress(c *C) {
45 p := s.env.Provider() 45 p := s.env.Provider()
46 addr, err := p.PrivateAddress() 46 addr, err := p.PrivateAddress()
47 c.Assert(err, IsNil) 47 c.Assert(err, IsNil)
48 c.Assert(addr, Equals, "private.dummy.address.example.com") 48 c.Assert(addr, Equals, "private.dummy.address.example.com")
49 } 49 }
50 50
51 func (s *LocalSuite) TestPublicAddress(c *C) { 51 func (s *LocalSuite) TestPublicAddress(c *C) {
52 p := s.env.Provider() 52 p := s.env.Provider()
53 addr, err := p.PublicAddress() 53 addr, err := p.PublicAddress()
54 c.Assert(err, IsNil) 54 c.Assert(err, IsNil)
55 c.Assert(addr, Equals, "public.dummy.address.example.com") 55 c.Assert(addr, Equals, "public.dummy.address.example.com")
56 } 56 }
LEFTRIGHT

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