add return error code command example.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2017-05-12 14:21:33 +08:00
parent a7c37e0936
commit 0a78278313
No known key found for this signature in database
GPG Key ID: 0F84B2110C500B1F

View File

@ -191,3 +191,19 @@ func TestProxyCommand(t *testing.T) {
err := plugin.Exec()
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)
}