mirror of
https://github.com/appleboy/drone-ssh.git
synced 2026-06-14 05:12:39 +08:00
Support stream output logs. (#79)
* Support stream output logs. Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * fix block channel. Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
@@ -121,6 +121,22 @@ func TestSSHScriptFromKeyFile(t *testing.T) {
|
||||
assert.Nil(t, err)
|
||||
}
|
||||
|
||||
func TestStreamFromSSHCommand(t *testing.T) {
|
||||
plugin := Plugin{
|
||||
Config: Config{
|
||||
Host: []string{"localhost", "127.0.0.1"},
|
||||
UserName: "drone-scp",
|
||||
Port: 22,
|
||||
KeyPath: "./tests/.ssh/id_rsa",
|
||||
Script: []string{"whoami", "for i in {1..5}; do echo ${i}; sleep 1; done", "echo 'done'"},
|
||||
CommandTimeout: 60,
|
||||
},
|
||||
}
|
||||
|
||||
err := plugin.Exec()
|
||||
assert.Nil(t, err)
|
||||
}
|
||||
|
||||
func TestSSHScriptWithError(t *testing.T) {
|
||||
plugin := Plugin{
|
||||
Config: Config{
|
||||
|
||||
Reference in New Issue
Block a user