mirror of
https://github.com/appleboy/drone-ssh.git
synced 2025-07-05 22:02:49 +08:00
add return error code command example.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
a7c37e0936
commit
0a78278313
@ -191,3 +191,19 @@ func TestProxyCommand(t *testing.T) {
|
|||||||
err := plugin.Exec()
|
err := plugin.Exec()
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestSSHCommandError(t *testing.T) {
|
||||||
|
plugin := Plugin{
|
||||||
|
Config: Config{
|
||||||
|
Host: []string{"localhost"},
|
||||||
|
UserName: "drone-scp",
|
||||||
|
Port: 22,
|
||||||
|
KeyPath: "./tests/.ssh/id_rsa",
|
||||||
|
Script: []string{"mkdir a", "mkdir a"},
|
||||||
|
CommandTimeout: 60,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
err := plugin.Exec()
|
||||||
|
assert.NotNil(t, err)
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user