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

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

Issue 6347044: environs/ec2: bootstrap (Closed)
Patch Set: environs/ec2: bootstrap Created 11 years, 8 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
OLDNEW
1 package ec2 1 package ec2
2 2
3 import ( 3 import (
4 . "launchpad.net/gocheck" 4 . "launchpad.net/gocheck"
5 "launchpad.net/goyaml" 5 "launchpad.net/goyaml"
6 "launchpad.net/juju-core/state" 6 "launchpad.net/juju-core/state"
7 "regexp" 7 "regexp"
8 "strings" 8 "strings"
9 ) 9 )
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 if t.cfg.zookeeper { 53 if t.cfg.zookeeper {
54 t.checkPackage(c, "zookeeperd") 54 t.checkPackage(c, "zookeeperd")
55 t.checkScripts(c, "jujud initzk") 55 t.checkScripts(c, "jujud initzk")
56 t.checkScripts(c, regexp.QuoteMeta(t.cfg.instanceIdAccessor)) 56 t.checkScripts(c, regexp.QuoteMeta(t.cfg.instanceIdAccessor))
57 t.checkScripts(c, "JUJU_ZOOKEEPER='localhost"+zkPortSuffix+"'") 57 t.checkScripts(c, "JUJU_ZOOKEEPER='localhost"+zkPortSuffix+"'")
58 } else { 58 } else {
59 t.checkScripts(c, "JUJU_ZOOKEEPER='"+strings.Join(t.cfg.stateInf o.Addrs, ",")+"'") 59 t.checkScripts(c, "JUJU_ZOOKEEPER='"+strings.Join(t.cfg.stateInf o.Addrs, ",")+"'")
60 } 60 }
61 t.checkScripts(c, "JUJU_MACHINE_ID=[0-9]+") 61 t.checkScripts(c, "JUJU_MACHINE_ID=[0-9]+")
62 62
63 » // TODO check provisioner and machine agent scripts. 63 » if t.cfg.provisioner {
64 » » t.checkScripts(c, "jujud provisioning")
niemeyer 2012/07/06 19:44:56 Could this be slightly richer, checking that the p
dfc 2012/07/09 00:52:58 Done.
65 » }
66
67 » // TODO check machine agent script.
64 } 68 }
65 69
66 func (t *cloudinitTest) checkScripts(c *C, pattern string) { 70 func (t *cloudinitTest) checkScripts(c *C, pattern string) {
67 CheckScripts(c, t.x, pattern, true) 71 CheckScripts(c, t.x, pattern, true)
68 } 72 }
69 73
70 // If match is true, CheckScripts checks that at least one script started 74 // If match is true, CheckScripts checks that at least one script started
71 // by the cloudinit data matches the given regexp pattern, otherwise it 75 // by the cloudinit data matches the given regexp pattern, otherwise it
72 // checks that no script matches. It's exported so it can be used by tests 76 // checks that no script matches. It's exported so it can be used by tests
73 // defined in ec2_test. 77 // defined in ec2_test.
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 c.Assert(err, IsNil) 205 c.Assert(err, IsNil)
202 206
203 for _, test := range verifyTests { 207 for _, test := range verifyTests {
204 cfg1 := *cfg 208 cfg1 := *cfg
205 test.mutate(&cfg1) 209 test.mutate(&cfg1)
206 t, err := newCloudInit(&cfg1) 210 t, err := newCloudInit(&cfg1)
207 c.Assert(err, ErrorMatches, "invalid machine configuration: "+te st.err) 211 c.Assert(err, ErrorMatches, "invalid machine configuration: "+te st.err)
208 c.Assert(t, IsNil) 212 c.Assert(t, IsNil)
209 } 213 }
210 } 214 }
OLDNEW

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