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

Delta Between Two Patch Sets: cmd/juju/upgradejuju_test.go

Issue 70190050: Update and Validate Environ Config in State
Left Patch Set: Created 11 years, 1 month ago
Right Patch Set: Update and Validate Environ Config in State Created 11 years 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « cmd/juju/environment_test.go ('k') | cmd/jujud/machine_test.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
1 // Copyright 2012, 2013 Canonical Ltd. 1 // Copyright 2012, 2013 Canonical Ltd.
2 // Licensed under the AGPLv3, see LICENCE file for details. 2 // Licensed under the AGPLv3, see LICENCE file for details.
3 3
4 package main 4 package main
5 5
6 import ( 6 import (
7 "archive/tar" 7 "archive/tar"
8 "bytes" 8 "bytes"
9 "compress/gzip" 9 "compress/gzip"
10 "io" 10 "io"
11 "io/ioutil" 11 "io/ioutil"
12 "strings" 12 "strings"
13 13
14 jc "github.com/juju/testing/checkers"
14 gc "launchpad.net/gocheck" 15 gc "launchpad.net/gocheck"
15 16
16 "launchpad.net/juju-core/environs/filestorage" 17 "launchpad.net/juju-core/environs/filestorage"
17 "launchpad.net/juju-core/environs/storage" 18 "launchpad.net/juju-core/environs/storage"
18 "launchpad.net/juju-core/environs/sync" 19 "launchpad.net/juju-core/environs/sync"
19 envtesting "launchpad.net/juju-core/environs/testing" 20 envtesting "launchpad.net/juju-core/environs/testing"
20 envtools "launchpad.net/juju-core/environs/tools" 21 envtools "launchpad.net/juju-core/environs/tools"
21 "launchpad.net/juju-core/juju/testing" 22 "launchpad.net/juju-core/juju/testing"
22 coretesting "launchpad.net/juju-core/testing" 23 coretesting "launchpad.net/juju-core/testing"
23 jc "launchpad.net/juju-core/testing/checkers"
24 coretools "launchpad.net/juju-core/tools"
25 "launchpad.net/juju-core/version" 24 "launchpad.net/juju-core/version"
26 ) 25 )
27 26
28 type UpgradeJujuSuite struct { 27 type UpgradeJujuSuite struct {
29 testing.JujuConnSuite 28 testing.JujuConnSuite
29 toolsDir string
30 } 30 }
31 31
32 var _ = gc.Suite(&UpgradeJujuSuite{}) 32 var _ = gc.Suite(&UpgradeJujuSuite{})
33 33
34 var upgradeJujuTests = []struct { 34 var upgradeJujuTests = []struct {
35 about string 35 about string
36 tools []string 36 tools []string
37 currentVersion string 37 currentVersion string
38 agentVersion string 38 agentVersion string
39 39
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 args: []string{"--series", "precise,quantal"}, 83 args: []string{"--series", "precise,quantal"},
84 expectInitErr: "--series requires --upload-tools", 84 expectInitErr: "--series requires --upload-tools",
85 }, { 85 }, {
86 about: "--upload-tools with inappropriate version 1", 86 about: "--upload-tools with inappropriate version 1",
87 currentVersion: "4.2.0-quantal-amd64", 87 currentVersion: "4.2.0-quantal-amd64",
88 args: []string{"--upload-tools", "--version", "3.1.0"}, 88 args: []string{"--upload-tools", "--version", "3.1.0"},
89 expectInitErr: "cannot upgrade to version incompatible with CLI", 89 expectInitErr: "cannot upgrade to version incompatible with CLI",
90 }, { 90 }, {
91 about: "--upload-tools with inappropriate version 2", 91 about: "--upload-tools with inappropriate version 2",
92 currentVersion: "3.2.7-quantal-amd64", 92 currentVersion: "3.2.7-quantal-amd64",
93 » args: []string{"--upload-tools", "--version", "3.1.0.4"}, 93 » args: []string{"--upload-tools", "--version", "3.2.8.4"},
94 expectInitErr: "cannot specify build number when uploading tools", 94 expectInitErr: "cannot specify build number when uploading tools",
95 }, { 95 }, {
96 about: "latest supported stable release", 96 about: "latest supported stable release",
97 tools: []string{"2.2.0-quantal-amd64", "2.2.2-quantal-i386", "2 .2.3-quantal-amd64"}, 97 tools: []string{"2.2.0-quantal-amd64", "2.2.2-quantal-i386", "2 .2.3-quantal-amd64"},
98 currentVersion: "2.0.0-quantal-amd64", 98 currentVersion: "2.0.0-quantal-amd64",
99 agentVersion: "2.0.0", 99 agentVersion: "2.0.0",
100 expectVersion: "2.2.3", 100 expectVersion: "2.2.3",
101 }, { 101 }, {
102 about: "latest current release", 102 about: "latest current release",
103 tools: []string{"2.0.5-quantal-amd64", "2.0.1-quantal-i386", "2 .3.3-quantal-amd64"}, 103 tools: []string{"2.0.5-quantal-amd64", "2.0.1-quantal-i386", "2 .3.3-quantal-amd64"},
104 currentVersion: "2.0.0-quantal-amd64", 104 currentVersion: "2.0.0-quantal-amd64",
105 agentVersion: "2.0.0", 105 agentVersion: "2.0.0",
106 expectVersion: "2.0.5", 106 expectVersion: "2.0.5",
107 }, {
108 about: "latest current release matching CLI, major version",
109 tools: []string{"3.2.0-quantal-amd64"},
110 currentVersion: "3.2.0-quantal-amd64",
111 agentVersion: "2.8.2",
112 expectVersion: "3.2.0",
113 }, {
114 about: "latest current release matching CLI, major version, no matching major tools",
115 tools: []string{"2.8.2-quantal-amd64"},
116 currentVersion: "3.2.0-quantal-amd64",
117 agentVersion: "2.8.2",
118 expectErr: "no matching tools available",
119 }, {
120 about: "latest current release matching CLI, major version, no matching tools",
121 tools: []string{"3.3.0-quantal-amd64"},
122 currentVersion: "3.2.0-quantal-amd64",
123 agentVersion: "2.8.2",
124 expectErr: "no compatible tools available",
107 }, { 125 }, {
108 about: "no next supported available", 126 about: "no next supported available",
109 tools: []string{"2.1.0-quantal-amd64", "2.1.5-quantal-i386", "2 .3.3-quantal-amd64"}, 127 tools: []string{"2.1.0-quantal-amd64", "2.1.5-quantal-i386", "2 .3.3-quantal-amd64"},
110 currentVersion: "2.0.0-quantal-amd64", 128 currentVersion: "2.0.0-quantal-amd64",
111 agentVersion: "2.0.0", 129 agentVersion: "2.0.0",
112 expectErr: "no more recent supported versions available", 130 expectErr: "no more recent supported versions available",
113 }, { 131 }, {
114 about: "latest supported stable, when client is dev", 132 about: "latest supported stable, when client is dev",
115 tools: []string{"2.1.1-quantal-amd64", "2.2.0-quantal-amd64", " 2.3.0-quantal-amd64", "3.0.1-quantal-amd64"}, 133 tools: []string{"2.1.1-quantal-amd64", "2.2.0-quantal-amd64", " 2.3.0-quantal-amd64", "3.0.1-quantal-amd64"},
116 currentVersion: "2.1.0-quantal-amd64", 134 currentVersion: "2.1.0-quantal-amd64",
117 agentVersion: "2.0.0", 135 agentVersion: "2.0.0",
118 expectVersion: "2.2.0", 136 expectVersion: "2.2.0",
119 }, { 137 }, {
120 about: "latest current, when agent is dev", 138 about: "latest current, when agent is dev",
121 tools: []string{"2.1.1-quantal-amd64", "2.2.0-quantal-amd64", " 2.3.0-quantal-amd64", "3.0.1-quantal-amd64"}, 139 tools: []string{"2.1.1-quantal-amd64", "2.2.0-quantal-amd64", " 2.3.0-quantal-amd64", "3.0.1-quantal-amd64"},
122 currentVersion: "2.0.0-quantal-amd64", 140 currentVersion: "2.0.0-quantal-amd64",
123 agentVersion: "2.1.0", 141 agentVersion: "2.1.0",
124 expectVersion: "2.2.0", 142 expectVersion: "2.2.0",
125 }, { 143 }, {
126 about: "specified version", 144 about: "specified version",
127 tools: []string{"2.3.0-quantal-amd64"}, 145 tools: []string{"2.3.0-quantal-amd64"},
128 currentVersion: "2.0.0-quantal-amd64", 146 currentVersion: "2.0.0-quantal-amd64",
129 agentVersion: "2.0.0", 147 agentVersion: "2.0.0",
130 args: []string{"--version", "2.3.0"}, 148 args: []string{"--version", "2.3.0"},
131 expectVersion: "2.3.0", 149 expectVersion: "2.3.0",
132 }, { 150 }, {
151 about: "specified major version",
152 tools: []string{"3.2.0-quantal-amd64"},
153 currentVersion: "3.2.0-quantal-amd64",
154 agentVersion: "2.8.2",
155 args: []string{"--version", "3.2.0"},
156 expectVersion: "3.2.0",
157 }, {
133 about: "specified version missing, but already set", 158 about: "specified version missing, but already set",
134 currentVersion: "3.0.0-quantal-amd64", 159 currentVersion: "3.0.0-quantal-amd64",
135 agentVersion: "3.0.0", 160 agentVersion: "3.0.0",
136 args: []string{"--version", "3.0.0"}, 161 args: []string{"--version", "3.0.0"},
137 expectVersion: "3.0.0", 162 expectVersion: "3.0.0",
138 }, { 163 }, {
139 about: "specified version, no tools", 164 about: "specified version, no tools",
140 currentVersion: "3.0.0-quantal-amd64", 165 currentVersion: "3.0.0-quantal-amd64",
141 agentVersion: "3.0.0", 166 agentVersion: "3.0.0",
142 args: []string{"--version", "3.2.0"}, 167 args: []string{"--version", "3.2.0"},
143 » expectErr: "no matching tools available", 168 » expectErr: "no tools available",
144 }, { 169 }, {
145 about: "specified version, no matching major version", 170 about: "specified version, no matching major version",
146 tools: []string{"4.2.0-quantal-amd64"}, 171 tools: []string{"4.2.0-quantal-amd64"},
147 currentVersion: "3.0.0-quantal-amd64", 172 currentVersion: "3.0.0-quantal-amd64",
148 agentVersion: "3.0.0", 173 agentVersion: "3.0.0",
149 args: []string{"--version", "3.2.0"}, 174 args: []string{"--version", "3.2.0"},
150 expectErr: "no matching tools available", 175 expectErr: "no matching tools available",
151 }, { 176 }, {
152 about: "specified version, no matching minor version", 177 about: "specified version, no matching minor version",
153 tools: []string{"3.4.0-quantal-amd64"}, 178 tools: []string{"3.4.0-quantal-amd64"},
(...skipping 14 matching lines...) Expand all
168 currentVersion: "3.0.0-quantal-amd64", 193 currentVersion: "3.0.0-quantal-amd64",
169 agentVersion: "3.0.0", 194 agentVersion: "3.0.0",
170 args: []string{"--version", "3.2.0"}, 195 args: []string{"--version", "3.2.0"},
171 expectErr: "no matching tools available", 196 expectErr: "no matching tools available",
172 }, { 197 }, {
173 about: "major version downgrade to incompatible version", 198 about: "major version downgrade to incompatible version",
174 tools: []string{"3.2.0-quantal-amd64"}, 199 tools: []string{"3.2.0-quantal-amd64"},
175 currentVersion: "3.2.0-quantal-amd64", 200 currentVersion: "3.2.0-quantal-amd64",
176 agentVersion: "4.2.0", 201 agentVersion: "4.2.0",
177 args: []string{"--version", "3.2.0"}, 202 args: []string{"--version", "3.2.0"},
178 » expectErr: "cannot change major version from 4 to 3", 203 » expectErr: "cannot change version from 4.2.0 to 3.2.0",
179 }, { 204 }, {
180 » about: "major version upgrade to compatible version", 205 » about: "minor version downgrade to incompatible version",
181 tools: []string{"3.2.0-quantal-amd64"}, 206 tools: []string{"3.2.0-quantal-amd64"},
182 currentVersion: "3.2.0-quantal-amd64", 207 currentVersion: "3.2.0-quantal-amd64",
183 » agentVersion: "2.8.2", 208 » agentVersion: "3.3.0",
184 » args: []string{"--version", "3.2.0"}, 209 » args: []string{"--version", "3.2.0"},
185 » expectErr: "major version upgrades are not supported yet", 210 » expectErr: "cannot change version from 3.3.0 to 3.2.0",
186 }, { 211 }, {
187 about: "nothing available", 212 about: "nothing available",
188 currentVersion: "2.0.0-quantal-amd64", 213 currentVersion: "2.0.0-quantal-amd64",
189 agentVersion: "2.0.0", 214 agentVersion: "2.0.0",
190 expectVersion: "2.0.0", 215 expectVersion: "2.0.0",
191 }, { 216 }, {
192 about: "nothing available 2", 217 about: "nothing available 2",
193 currentVersion: "2.0.0-quantal-amd64", 218 currentVersion: "2.0.0-quantal-amd64",
194 tools: []string{"3.2.0-quantal-amd64"}, 219 tools: []string{"3.2.0-quantal-amd64"},
195 agentVersion: "2.0.0", 220 agentVersion: "2.0.0",
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 }, { 266 }, {
242 about: "upload with explicit version bumps when necessary", 267 about: "upload with explicit version bumps when necessary",
243 currentVersion: "2.2.0-quantal-amd64", 268 currentVersion: "2.2.0-quantal-amd64",
244 tools: []string{"2.7.3.1-quantal-amd64"}, 269 tools: []string{"2.7.3.1-quantal-amd64"},
245 agentVersion: "2.0.0", 270 agentVersion: "2.0.0",
246 args: []string{"--upload-tools", "--version", "2.7.3"}, 271 args: []string{"--upload-tools", "--version", "2.7.3"},
247 expectVersion: "2.7.3.2", 272 expectVersion: "2.7.3.2",
248 expectUploaded: []string{"2.7.3.2-quantal-amd64", "2.7.3.2-precise-amd64 ", "2.7.3.2-raring-amd64"}, 273 expectUploaded: []string{"2.7.3.2-quantal-amd64", "2.7.3.2-precise-amd64 ", "2.7.3.2-raring-amd64"},
249 }} 274 }}
250 275
251 // mockUploadTools simulates the effect of tools.Upload, but skips the time- 276 // getMockBuildTools returns a sync.BuildToolsTarballFunc implementation which g enerates
252 // consuming build from source. 277 // a fake tools tarball.
253 // TODO(fwereade) better factor agent/tools such that build logic is 278 func (s *UpgradeJujuSuite) getMockBuildTools(c *gc.C) sync.BuildToolsTarballFunc {
254 // exposed and can itself be neatly mocked? 279 » return func(forceVersion *version.Number) (*sync.BuiltTools, error) {
255 func mockUploadTools(stor storage.Storage, forceVersion *version.Number, series ...string) (*coretools.Tools, error) { 280 » » // UploadFakeToolsVersions requires a storage to write to.
256 » vers := version.Current 281 » » stor, err := filestorage.NewFileStorageWriter(s.toolsDir)
257 » if forceVersion != nil { 282 » » c.Assert(err, gc.IsNil)
258 » » vers.Number = *forceVersion 283 » » vers := version.Current
284 » » if forceVersion != nil {
285 » » » vers.Number = *forceVersion
286 » » }
287 » » versions := []version.Binary{vers}
288 » » uploadedTools, err := envtesting.UploadFakeToolsVersions(stor, v ersions...)
289 » » c.Assert(err, gc.IsNil)
290 » » agentTools := uploadedTools[0]
291 » » return &sync.BuiltTools{
292 » » » Dir: s.toolsDir,
293 » » » StorageName: envtools.StorageName(vers),
294 » » » Version: vers,
295 » » » Size: agentTools.Size,
296 » » » Sha256Hash: agentTools.SHA256,
297 » » }, nil
259 } 298 }
260 versions := []version.Binary{vers}
261 for _, series := range series {
262 if series != version.Current.Series {
263 newVers := vers
264 newVers.Series = series
265 versions = append(versions, newVers)
266 }
267 }
268 agentTools, err := envtesting.UploadFakeToolsVersions(stor, versions...)
269 if err != nil {
270 return nil, err
271 }
272 return agentTools[0], nil
273 } 299 }
274 300
275 func (s *UpgradeJujuSuite) TestUpgradeJuju(c *gc.C) { 301 func (s *UpgradeJujuSuite) TestUpgradeJuju(c *gc.C) {
276 » s.PatchValue(&sync.Upload, mockUploadTools) 302 » s.PatchValue(&sync.BuildToolsTarball, s.getMockBuildTools(c))
277 oldVersion := version.Current 303 oldVersion := version.Current
278 defer func() { 304 defer func() {
279 version.Current = oldVersion 305 version.Current = oldVersion
280 }() 306 }()
281 307
282 for i, test := range upgradeJujuTests { 308 for i, test := range upgradeJujuTests {
283 c.Logf("\ntest %d: %s", i, test.about) 309 c.Logf("\ntest %d: %s", i, test.about)
284 s.Reset(c) 310 s.Reset(c)
285 311
286 // Set up apparent CLI version and initialize the command. 312 // Set up apparent CLI version and initialize the command.
287 version.Current = version.MustParseBinary(test.currentVersion) 313 version.Current = version.MustParseBinary(test.currentVersion)
288 com := &UpgradeJujuCommand{} 314 com := &UpgradeJujuCommand{}
289 if err := coretesting.InitCommand(com, test.args); err != nil { 315 if err := coretesting.InitCommand(com, test.args); err != nil {
290 if test.expectInitErr != "" { 316 if test.expectInitErr != "" {
291 c.Check(err, gc.ErrorMatches, test.expectInitErr ) 317 c.Check(err, gc.ErrorMatches, test.expectInitErr )
292 } else { 318 } else {
293 c.Check(err, gc.IsNil) 319 c.Check(err, gc.IsNil)
294 } 320 }
295 continue 321 continue
296 } 322 }
297 323
298 // Set up state and environ, and run the command. 324 // Set up state and environ, and run the command.
299 toolsDir := c.MkDir() 325 toolsDir := c.MkDir()
300 updateAttrs := map[string]interface{}{ 326 updateAttrs := map[string]interface{}{
301 "agent-version": test.agentVersion, 327 "agent-version": test.agentVersion,
302 "tools-metadata-url": "file://" + toolsDir, 328 "tools-metadata-url": "file://" + toolsDir,
303 } 329 }
304 » » err := s.State.UpdateEnvironConfig(updateAttrs, []string{}) 330 » » err := s.State.UpdateEnvironConfig(updateAttrs, nil, nil)
305 c.Assert(err, gc.IsNil) 331 c.Assert(err, gc.IsNil)
306 versions := make([]version.Binary, len(test.tools)) 332 versions := make([]version.Binary, len(test.tools))
307 for i, v := range test.tools { 333 for i, v := range test.tools {
308 versions[i] = version.MustParseBinary(v) 334 versions[i] = version.MustParseBinary(v)
309 } 335 }
310 » » envtesting.MustUploadFakeToolsVersions(s.Conn.Environ.Storage(), versions...) 336 » » if len(versions) > 0 {
311 » » stor, err := filestorage.NewFileStorageWriter(toolsDir, "") 337 » » » envtesting.MustUploadFakeToolsVersions(s.Conn.Environ.St orage(), versions...)
312 » » c.Assert(err, gc.IsNil) 338 » » » stor, err := filestorage.NewFileStorageWriter(toolsDir)
313 » » envtesting.MustUploadFakeToolsVersions(stor, versions...) 339 » » » c.Assert(err, gc.IsNil)
340 » » » envtesting.MustUploadFakeToolsVersions(stor, versions... )
341 » » }
342
314 err = com.Run(coretesting.Context(c)) 343 err = com.Run(coretesting.Context(c))
315 if test.expectErr != "" { 344 if test.expectErr != "" {
316 c.Check(err, gc.ErrorMatches, test.expectErr) 345 c.Check(err, gc.ErrorMatches, test.expectErr)
317 continue 346 continue
318 } else if !c.Check(err, gc.IsNil) { 347 } else if !c.Check(err, gc.IsNil) {
319 continue 348 continue
320 } 349 }
321 350
322 // Check expected changes to environ/state. 351 // Check expected changes to environ/state.
323 cfg, err := s.State.EnvironConfig() 352 cfg, err := s.State.EnvironConfig()
324 c.Check(err, gc.IsNil) 353 c.Check(err, gc.IsNil)
325 agentVersion, ok := cfg.AgentVersion() 354 agentVersion, ok := cfg.AgentVersion()
326 c.Check(ok, gc.Equals, true) 355 c.Check(ok, gc.Equals, true)
327 c.Check(agentVersion, gc.Equals, version.MustParse(test.expectVe rsion)) 356 c.Check(agentVersion, gc.Equals, version.MustParse(test.expectVe rsion))
328 357
329 for _, uploaded := range test.expectUploaded { 358 for _, uploaded := range test.expectUploaded {
330 vers := version.MustParseBinary(uploaded) 359 vers := version.MustParseBinary(uploaded)
331 r, err := storage.Get(s.Conn.Environ.Storage(), envtools .StorageName(vers)) 360 r, err := storage.Get(s.Conn.Environ.Storage(), envtools .StorageName(vers))
332 if !c.Check(err, gc.IsNil) { 361 if !c.Check(err, gc.IsNil) {
333 continue 362 continue
334 } 363 }
335 data, err := ioutil.ReadAll(r) 364 data, err := ioutil.ReadAll(r)
336 r.Close() 365 r.Close()
337 c.Check(err, gc.IsNil) 366 c.Check(err, gc.IsNil)
338 » » » checkToolsContent(c, data, "jujud contents "+uploaded) 367 » » » expectContent := version.Current
368 » » » expectContent.Number = agentVersion
369 » » » checkToolsContent(c, data, "jujud contents "+expectConte nt.String())
339 } 370 }
340 } 371 }
341 } 372 }
342 373
343 func checkToolsContent(c *gc.C, data []byte, uploaded string) { 374 func checkToolsContent(c *gc.C, data []byte, uploaded string) {
344 zr, err := gzip.NewReader(bytes.NewReader(data)) 375 zr, err := gzip.NewReader(bytes.NewReader(data))
345 c.Check(err, gc.IsNil) 376 c.Check(err, gc.IsNil)
346 defer zr.Close() 377 defer zr.Close()
347 tr := tar.NewReader(zr) 378 tr := tar.NewReader(zr)
348 found := false 379 found := false
(...skipping 21 matching lines...) Expand all
370 // tools to the environment's storage. We don't want 401 // tools to the environment's storage. We don't want
371 // 'em there; but we do want a consistent default-series 402 // 'em there; but we do want a consistent default-series
372 // in the environment state. 403 // in the environment state.
373 func (s *UpgradeJujuSuite) Reset(c *gc.C) { 404 func (s *UpgradeJujuSuite) Reset(c *gc.C) {
374 s.JujuConnSuite.Reset(c) 405 s.JujuConnSuite.Reset(c)
375 envtesting.RemoveTools(c, s.Conn.Environ.Storage()) 406 envtesting.RemoveTools(c, s.Conn.Environ.Storage())
376 updateAttrs := map[string]interface{}{ 407 updateAttrs := map[string]interface{}{
377 "default-series": "raring", 408 "default-series": "raring",
378 "agent-version": "1.2.3", 409 "agent-version": "1.2.3",
379 } 410 }
380 » err := s.State.UpdateEnvironConfig(updateAttrs, []string{}) 411 » err := s.State.UpdateEnvironConfig(updateAttrs, nil, nil)
381 c.Assert(err, gc.IsNil) 412 c.Assert(err, gc.IsNil)
413 s.toolsDir = c.MkDir()
382 } 414 }
383 415
384 func (s *UpgradeJujuSuite) TestUpgradeJujuWithRealUpload(c *gc.C) { 416 func (s *UpgradeJujuSuite) TestUpgradeJujuWithRealUpload(c *gc.C) {
385 s.Reset(c) 417 s.Reset(c)
386 _, err := coretesting.RunCommand(c, &UpgradeJujuCommand{}, []string{"--u pload-tools"}) 418 _, err := coretesting.RunCommand(c, &UpgradeJujuCommand{}, []string{"--u pload-tools"})
387 c.Assert(err, gc.IsNil) 419 c.Assert(err, gc.IsNil)
388 vers := version.Current 420 vers := version.Current
389 vers.Build = 1 421 vers.Build = 1
390 tools, err := envtools.FindInstanceTools(s.Conn.Environ, vers.Number, ve rs.Series, &vers.Arch) 422 tools, err := envtools.FindInstanceTools(s.Conn.Environ, vers.Number, ve rs.Series, &vers.Arch)
391 c.Assert(err, gc.IsNil) 423 c.Assert(err, gc.IsNil)
392 c.Assert(len(tools), gc.Equals, 1) 424 c.Assert(len(tools), gc.Equals, 1)
393 } 425 }
LEFTRIGHT

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