From 0a78278313381de96a838f6819fe7e8c925407b9 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Fri, 12 May 2017 14:21:33 +0800 Subject: [PATCH] add return error code command example. Signed-off-by: Bo-Yi Wu --- plugin_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/plugin_test.go b/plugin_test.go index 202adb7..de3e771 100644 --- a/plugin_test.go +++ b/plugin_test.go @@ -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) +}