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

Unified Diff: cmd/juju/ssh_test.go

Issue 66340045: cmd/juju: ssh/scp commands extra arguments; fixes (Closed)
Patch Set: cmd/juju: ssh/scp commands extra arguments; fixes Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cmd/juju/ssh_test.go
=== modified file 'cmd/juju/ssh_test.go'
--- cmd/juju/ssh_test.go 2014-02-18 17:08:55 +0000
+++ cmd/juju/ssh_test.go 2014-02-22 13:45:10 +0000
@@ -54,39 +54,33 @@
const (
commonArgs = `-o StrictHostKeyChecking no -o PasswordAuthentication no `
- sshArgs = commonArgs + `-t `
+ sshArgs = commonArgs + `-t -t `
)
var sshTests = []struct {
+ about string
args []string
result string
}{
{
+ "connect to machine 0",
[]string{"ssh", "0"},
sshArgs + "ubuntu@dummyenv-0.dns\n",
},
- // juju ssh 0 'uname -a'
- {
- []string{"ssh", "0", "uname -a"},
- sshArgs + "ubuntu@dummyenv-0.dns -- uname -a\n",
- },
- // juju ssh 0 -- uname -a
- {
- []string{"ssh", "0", "--", "uname", "-a"},
- sshArgs + "ubuntu@dummyenv-0.dns -- uname -a\n",
- },
- // juju ssh 0 uname -a
- {
+ {
+ "connect to machine 0 and pass extra arguments",
[]string{"ssh", "0", "uname", "-a"},
- sshArgs + "ubuntu@dummyenv-0.dns -- uname -a\n",
+ sshArgs + "ubuntu@dummyenv-0.dns uname -a\n",
},
{
+ "connect to unit mysql/0",
[]string{"ssh", "mysql/0"},
sshArgs + "ubuntu@dummyenv-0.dns\n",
},
{
- []string{"ssh", "mongodb/1"},
- sshArgs + "ubuntu@dummyenv-2.dns\n",
+ "connect to unit mongodb/1 and pass extra arguments",
+ []string{"ssh", "mongodb/1", "ls", "/"},
+ sshArgs + "ubuntu@dummyenv-2.dns ls /\n",
},
}
@@ -107,8 +101,8 @@
s.addUnit(srv, m[1], c)
s.addUnit(srv, m[2], c)
- for _, t := range sshTests {
- c.Logf("testing juju ssh %s", t.args)
+ for i, t := range sshTests {
+ c.Logf("test %d: %s -> %s\n", i, t.about, t.args)
ctx := coretesting.Context(c)
jujucmd := cmd.NewSuperCommand(cmd.SuperCommandParams{})
jujucmd.Register(&SSHCommand{})

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