LEFT | RIGHT |
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 if t.cfg.provisioner { | 63 if t.cfg.provisioner { |
64 » » t.checkScripts(c, "jujud provisioning") | 64 » » t.checkScripts(c, "jujud provisioning --zookeeper-servers 'local
host"+zkPortSuffix+"'") |
65 } | 65 } |
66 | 66 |
67 // TODO check machine agent script. | 67 // TODO check machine agent script. |
68 } | 68 } |
69 | 69 |
70 func (t *cloudinitTest) checkScripts(c *C, pattern string) { | 70 func (t *cloudinitTest) checkScripts(c *C, pattern string) { |
71 CheckScripts(c, t.x, pattern, true) | 71 CheckScripts(c, t.x, pattern, true) |
72 } | 72 } |
73 | 73 |
74 // 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 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 c.Assert(err, IsNil) | 205 c.Assert(err, IsNil) |
206 | 206 |
207 for _, test := range verifyTests { | 207 for _, test := range verifyTests { |
208 cfg1 := *cfg | 208 cfg1 := *cfg |
209 test.mutate(&cfg1) | 209 test.mutate(&cfg1) |
210 t, err := newCloudInit(&cfg1) | 210 t, err := newCloudInit(&cfg1) |
211 c.Assert(err, ErrorMatches, "invalid machine configuration: "+te
st.err) | 211 c.Assert(err, ErrorMatches, "invalid machine configuration: "+te
st.err) |
212 c.Assert(t, IsNil) | 212 c.Assert(t, IsNil) |
213 } | 213 } |
214 } | 214 } |
LEFT | RIGHT |