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

Delta Between Two Patch Sets: environs/jujutest/livetests.go

Issue 9738043: cmd/jujud: do not change password
Left Patch Set: cmd/jujud: do not change password Created 11 years, 9 months ago
Right Patch Set: cmd/jujud: do not change password Created 11 years, 9 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « environs/interface.go ('k') | environs/jujutest/tests.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 2011, 2012, 2013 Canonical Ltd. 1 // Copyright 2011, 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 jujutest 4 package jujutest
5 5
6 import ( 6 import (
7 "bytes" 7 "bytes"
8 "fmt" 8 "fmt"
9 "io" 9 "io"
10 "io/ioutil" 10 "io/ioutil"
11 . "launchpad.net/gocheck" 11 . "launchpad.net/gocheck"
12 "launchpad.net/juju-core/charm" 12 "launchpad.net/juju-core/charm"
13 "launchpad.net/juju-core/constraints" 13 "launchpad.net/juju-core/constraints"
14 "launchpad.net/juju-core/environs" 14 "launchpad.net/juju-core/environs"
15 "launchpad.net/juju-core/environs/config" 15 "launchpad.net/juju-core/environs/config"
16 "launchpad.net/juju-core/environs/tools" 16 "launchpad.net/juju-core/environs/tools"
17 "launchpad.net/juju-core/errors" 17 "launchpad.net/juju-core/errors"
18 "launchpad.net/juju-core/instance" 18 "launchpad.net/juju-core/instance"
19 "launchpad.net/juju-core/juju" 19 "launchpad.net/juju-core/juju"
20 "launchpad.net/juju-core/juju/testing" 20 "launchpad.net/juju-core/juju/testing"
21 "launchpad.net/juju-core/state" 21 "launchpad.net/juju-core/state"
22 "launchpad.net/juju-core/state/api"
22 coretesting "launchpad.net/juju-core/testing" 23 coretesting "launchpad.net/juju-core/testing"
23 "launchpad.net/juju-core/utils" 24 "launchpad.net/juju-core/utils"
24 "launchpad.net/juju-core/version" 25 "launchpad.net/juju-core/version"
25 "time" 26 "time"
26 ) 27 )
27 28
28 // LiveTests contains tests that are designed to run against a live server 29 // LiveTests contains tests that are designed to run against a live server
29 // (e.g. Amazon EC2). The Environ is opened once only for all the tests 30 // (e.g. Amazon EC2). The Environ is opened once only for all the tests
30 // in the suite, stored in Env, and Destroyed after the suite has completed. 31 // in the suite, stored in Env, and Destroyed after the suite has completed.
31 type LiveTests struct { 32 type LiveTests struct {
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 t.BootstrapOnce(c) 328 t.BootstrapOnce(c)
328 329
329 // TODO(niemeyer): Stop growing this kitchen sink test and split it into proper parts. 330 // TODO(niemeyer): Stop growing this kitchen sink test and split it into proper parts.
330 331
331 c.Logf("opening connection") 332 c.Logf("opening connection")
332 conn, err := juju.NewConn(t.Env) 333 conn, err := juju.NewConn(t.Env)
333 c.Assert(err, IsNil) 334 c.Assert(err, IsNil)
334 defer conn.Close() 335 defer conn.Close()
335 336
336 c.Logf("opening API connection") 337 c.Logf("opening API connection")
337 » apiConn, err := juju.NewAPIConn(t.Env) 338 » apiConn, err := juju.NewAPIConn(t.Env, api.DefaultDialOpts())
338 c.Assert(err, IsNil) 339 c.Assert(err, IsNil)
339 defer conn.Close() 340 defer conn.Close()
340 341
341 // Check that the agent version has made it through the 342 // Check that the agent version has made it through the
342 // bootstrap process (it's optional in the config.Config) 343 // bootstrap process (it's optional in the config.Config)
343 cfg, err := conn.State.EnvironConfig() 344 cfg, err := conn.State.EnvironConfig()
344 c.Assert(err, IsNil) 345 c.Assert(err, IsNil)
345 agentVersion, ok := cfg.AgentVersion() 346 agentVersion, ok := cfg.AgentVersion()
346 c.Check(ok, Equals, true) 347 c.Check(ok, Equals, true)
347 c.Check(agentVersion, Equals, version.CurrentNumber()) 348 c.Check(agentVersion, Equals, version.CurrentNumber())
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 return err 812 return err
812 } 813 }
813 var buf bytes.Buffer 814 var buf bytes.Buffer
814 _, err = io.Copy(&buf, rc) 815 _, err = io.Copy(&buf, rc)
815 rc.Close() 816 rc.Close()
816 if err != nil { 817 if err != nil {
817 return err 818 return err
818 } 819 }
819 return target.Put(targetPath, &buf, int64(buf.Len())) 820 return target.Put(targetPath, &buf, int64(buf.Len()))
820 } 821 }
LEFTRIGHT

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