mirror of
https://github.com/appleboy/drone-ssh.git
synced 2026-06-04 10:15:07 +08:00
Add sync mode. (#101)
* Add sync mode. Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * close channel in sync mode. Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * close channel in sync mode. Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
@@ -256,3 +256,20 @@ func TestSetENV(t *testing.T) {
|
||||
err := plugin.Exec()
|
||||
assert.Nil(t, err)
|
||||
}
|
||||
|
||||
func TestSyncMode(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..3}; do echo ${i}; sleep 1; done", "echo 'done'"},
|
||||
CommandTimeout: 60,
|
||||
Sync: true,
|
||||
},
|
||||
}
|
||||
|
||||
err := plugin.Exec()
|
||||
assert.Nil(t, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user