Index: utils/ssh/ssh_test.go |
=== modified file 'utils/ssh/ssh_test.go' |
--- utils/ssh/ssh_test.go 2014-02-04 03:12:33 +0000 |
+++ utils/ssh/ssh_test.go 2014-02-06 13:38:47 +0000 |
@@ -11,6 +11,7 @@ |
gc "launchpad.net/gocheck" |
+ "launchpad.net/juju-core/cmd" |
"launchpad.net/juju-core/testing/testbase" |
"launchpad.net/juju-core/utils/ssh" |
) |
@@ -149,6 +150,15 @@ |
) |
} |
+func (s *SSHCommandSuite) TestCommandError(c *gc.C) { |
+ var opts ssh.Options |
+ err := ioutil.WriteFile(s.fakessh, []byte("#!/bin/sh\nexit 42"), 0755) |
+ c.Assert(err, gc.IsNil) |
+ command := s.client.Command("ignored", []string{"echo", "foo"}, &opts) |
+ err = command.Run() |
+ c.Assert(cmd.IsRcPassthroughError(err), gc.Equals, true) |
+} |
+ |
func (s *SSHCommandSuite) TestCommandDefaultIdentities(c *gc.C) { |
var opts ssh.Options |
s.PatchValue(ssh.DefaultIdentities, []string{"def1", "def2"}) |