Merge lp:~axwalk/juju-core/lp1233601-test-network-isolation into lp:~go-bot/juju-core/trunk
Proposed by
Andrew Wilkins
Status: | Merged |
---|---|
Approved by: | Andrew Wilkins |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2327 |
Proposed branch: | lp:~axwalk/juju-core/lp1233601-test-network-isolation |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
87 lines (+20/-2) 4 files modified
cmd/juju/upgradecharm_test.go (+10/-0) utils/ssh/export_test.go (+1/-0) utils/ssh/ssh_gocrypto.go (+3/-1) utils/ssh/ssh_gocrypto_test.go (+6/-1) |
To merge this branch: | bzr merge lp:~axwalk/juju-core/lp1233601-test-network-isolation |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+206332@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Reviewers: mp+206332_ code.launchpad. net,
Message:
Please take a look.
Description:
Fix test network isolation
Some tests were dialing out. We shouldn't do that.
Fixes lp:1233601
https:/ /code.launchpad .net/~axwalk/ juju-core/ lp1233601- test-network- isolation/ +merge/ 206332
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/63700043/
Affected files (+22, -2 lines): upgradecharm_ test.go export_ test.go ssh_gocrypto. go ssh_gocrypto_ test.go
A [revision details]
M cmd/juju/
M utils/ssh/
M utils/ssh/
M utils/ssh/
Index: [revision details] 20140214031125- wjgoipxnambtbvw 9
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-
+New revision: <email address hidden>
Index: cmd/juju/ upgradecharm_ test.go upgradecharm_ test.go' upgradecharm_ test.go 2013-12-19 16:24:12 +0000 upgradecharm_ test.go 2014-02-14 04:58:10 +0000 net/gocheck"
=== modified file 'cmd/juju/
--- cmd/juju/
+++ cmd/juju/
@@ -12,6 +12,7 @@
gc "launchpad.
"launchpad. net/juju- core/charm" net/juju- core/charm/ testing" net/juju- core/juju/ testing" net/juju- core/state" net/juju- core/testing" RepoSuite
+ charmtesting "launchpad.
jujutesting "launchpad.
"launchpad.
"launchpad.
@@ -21,6 +22,15 @@
jujutesting.
}
+func (s *UpgradeCharmEr rorsSuite) SetUpTest(c *gc.C) { SetUpTest( c) NewMockStore( c, map[string]int{}) func(*gc. C) { mockstore.Close() }) &charm. Store, &charm.CharmStore{ Address( ), &UpgradeCharmEr rorsSuite{ })
+ s.RepoSuite.
+ mockstore := charmtesting.
+ s.AddCleanup(
+ s.PatchValue(
+ BaseURL: mockstore.
+ })
+}
+
var _ = gc.Suite(
func runUpgradeCharm(c *gc.C, args ...string) error {
Index: utils/ssh/ export_ test.go ssh/export_ test.go' export_ test.go 2014-02-04 03:12:33 +0000 export_ test.go 2014-02-14 04:58:10 +0000 sedKeys = writeAuthorisedKeys lient = initDefaultClient ities = &defaultIdentities
=== modified file 'utils/
--- utils/ssh/
+++ utils/ssh/
@@ -8,4 +8,5 @@
WriteAuthori
InitDefaultC
DefaultIdent
+ SSHDial = &sshDial
)
Index: utils/ssh/ ssh_gocrypto. go ssh/ssh_ gocrypto. go' ssh_gocrypto. go 2014-01-17 02:35:28 +0000 ssh_gocrypto. go 2014-02-14 04:58:10 +0000
=== modified file 'utils/
--- utils/ssh/
+++ utils/ssh/
@@ -77,6 +77,8 @@
sess *ssh.Session
}
+var sshDial = ssh.Dial ClientAuthKeyri ng(keyring{ c.signers} ),
+
func (c *goCryptoCommand) ensureSession() (*ssh.Session, error) {
if c.sess != nil {
return c.sess, nil
@@ -97,7 +99,7 @@
ssh.
},
}
- conn, err := ssh.Dial("tcp", c.addr, config)
+ conn, err := sshDial("tcp", c.addr, config)
if err != nil {
return nil, err
}
Index: utils/ssh/ ssh_gocrypto_ test.go ssh/ssh_ gocrypto_ test.go' ssh_gocrypto_ test.go 2014-01-23 08:58:16 +0000 ssh_gocrypto_ test.go 2014-02-14 04:58:10 +0000
=== modified file 'utils/
--- utils/ssh/
+++ utils/ssh/
@@ -5,6 +5,7 @@
import ( binary"
"encoding/
+ "errors"
"net"
"sync"
@@ -107,10 +108,14 @@ Keys() eys(c.MkDir( )) ssh.S.. .
defer ssh.ClearClient
err = ssh.LoadClientK
c.Assert(err, gc.IsNil)
+
+ s.PatchValue(