mirror of
https://github.com/appleboy/drone-ssh.git
synced 2025-05-09 18:23:21 +08:00
add exit code example.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
0a78278313
commit
26b3d47ee2
@ -207,3 +207,25 @@ func TestSSHCommandError(t *testing.T) {
|
||||
err := plugin.Exec()
|
||||
assert.NotNil(t, err)
|
||||
}
|
||||
|
||||
func TestSSHCommandExitCodeError(t *testing.T) {
|
||||
plugin := Plugin{
|
||||
Config: Config{
|
||||
Host: []string{"localhost"},
|
||||
UserName: "drone-scp",
|
||||
Port: 22,
|
||||
KeyPath: "./tests/.ssh/id_rsa",
|
||||
Script: []string{
|
||||
"set -e",
|
||||
"echo 1",
|
||||
"mkdir a",
|
||||
"mkdir a",
|
||||
"echo 2",
|
||||
},
|
||||
CommandTimeout: 60,
|
||||
},
|
||||
}
|
||||
|
||||
err := plugin.Exec()
|
||||
assert.NotNil(t, err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user