~rogpeppe/juju-core/themue-058-debug-log-api

« back to all changes in this revision

Viewing changes to utils/ssh/ssh_gocrypto_test.go

  • Committer: Frank Mueller
  • Date: 2014-01-23 14:14:49 UTC
  • mfrom: (2152.1.95 juju-core)
  • Revision ID: frank.mueller@canonical.com-20140123141449-b30l57y7gs3wjkpw
debugger: merged trunk and fixed permission and interface problems

Show diffs side-by-side

added added

removed removed

Lines of Context:
101
101
func (s *SSHGoCryptoCommandSuite) TestClientNoKeys(c *gc.C) {
102
102
        client, err := ssh.NewGoCryptoClient()
103
103
        c.Assert(err, gc.IsNil)
104
 
        cmd := client.Command("test.invalid", []string{"echo", "123"}, nil)
 
104
        cmd := client.Command("0.1.2.3", []string{"echo", "123"}, nil)
105
105
        _, err = cmd.Output()
106
106
        c.Assert(err, gc.ErrorMatches, "no private keys available")
107
107
        defer ssh.ClearClientKeys()
108
108
        err = ssh.LoadClientKeys(c.MkDir())
109
109
        c.Assert(err, gc.IsNil)
110
 
        cmd = client.Command("test.invalid", []string{"echo", "123"}, nil)
 
110
        cmd = client.Command("0.1.2.3", []string{"echo", "123"}, nil)
111
111
        _, err = cmd.Output()
112
112
        // error message differs based on whether using cgo or not
113
 
        c.Assert(err, gc.ErrorMatches, "(dial tcp: )?lookup test.invalid: no such host")
 
113
        c.Assert(err, gc.ErrorMatches, `(dial tcp )?0\.1\.2\.3:22: invalid argument`)
114
114
}
115
115
 
116
116
func (s *SSHGoCryptoCommandSuite) TestCommand(c *gc.C) {
140
140
func (s *SSHGoCryptoCommandSuite) TestCopy(c *gc.C) {
141
141
        client, err := ssh.NewGoCryptoClient()
142
142
        c.Assert(err, gc.IsNil)
143
 
        err = client.Copy("test.invalid:b", c.MkDir(), nil)
 
143
        err = client.Copy("0.1.2.3:b", c.MkDir(), nil)
144
144
        c.Assert(err, gc.ErrorMatches, "Copy is not implemented")
145
145
}