Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
lp:1616098: ssh,scp,dh pick reachable address among all #6481
Conversation
added some commits
Oct 20, 2016
|
@nskaggs Why are my PR not picked up by the pre-check job (almost every one I had to poke to get a run)? |
|
!!build!! |
|
@dimitern I'm not sure. Ping me on IRC and I can check the logs when you open a new one to see what the reason is. |
frobware
reviewed
Oct 20, 2016
This is a large change (> 500 lines). Somebody else needs to bless it.
As a nit, I did find the TestSSHCommandHostAddressRetry* functions non-obvious in how/what they were testing.
| @@ -154,6 +220,7 @@ func (s *SSHCommonSuite) setupModel(c *gc.C) { | ||
| m := s.getMachineForUnit(c, u) | ||
| s.setAddresses(c, m) | ||
| s.setKeys(c, m) | ||
| + s.setLinkLayerDevicesAddresses(c, m) |
dimitern
Oct 21, 2016
Contributor
This adds LinkLayerDevices and sets addresses for them, to exercise apiClient.AllAddresses() returns them in addition to m.Addresses() already set above (only the public and private). Also setupModel is used in all 3 commands' test suites, so it seemed best to add it here only.
| - args: []string{"0", "uname", "-a"}, | ||
| + about: "connect to machine 0 (api v2)", | ||
| + args: []string{"0"}, | ||
| + dialWith: dialerFuncFor("0.private", "0.public", "0.1.2.3"), // last one set on machine 0 eth0 |
dimitern
Oct 21, 2016
Contributor
It tries to clarify where that "0.1.2.3" came from - it was set by suite.setLinkLayerDevicesAddresses() for suite.m (machine-0). I'll rephrase it to make it clearer.
|
I did actually QA this change with the LXD provider and it worked as advertised. Subjectively, it also "feels" quicker when running |
|
I can't bless it, but LGTM. |
|
$$fixes-1616098$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$retry-transient-failure$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$windows-this-time$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$again$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
dimitern commentedOct 20, 2016
•
Edited 1 time
-
dimitern
Oct 20, 2016
Uses the new SSHClient API facade v2 (from #6468), if
available, and network.ReachableHostPort() (#6454) in
code shared between the ssh, scp, and debug-hooks CLI
commands, to select a reachable address from all known
addresses of the target (machine/unit/host).
Fixes http://pad.lv/1616098.
QA steps (live tested on both MAAS 1.9 with multiple-
NIC nodes and on lxd - see below):
develop, bootstrap a lxd xenial controller.(add an extra IP on machine-0, from the same subnet)
(bounce the controller agent to pick up the new IP)
(make the preferred public IP unreachable from your laptop)
(switch to this PR's branch and rebuild juju & jujud)
(small delay ~10s observed on lxd, because of 'sudo')