fix testing

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2017-03-04 17:26:30 +08:00
parent 8b10b8c3e9
commit ce947748d1

View File

@ -37,6 +37,7 @@ func TestIncorrectPassword(t *testing.T) {
Port: 22, Port: 22,
Password: "123456", Password: "123456",
Script: []string{"whoami"}, Script: []string{"whoami"},
CommandTimeout: 60,
}, },
} }
@ -50,6 +51,7 @@ func TestSSHScriptFromRawKey(t *testing.T) {
Host: []string{"localhost"}, Host: []string{"localhost"},
UserName: "drone-scp", UserName: "drone-scp",
Port: 22, Port: 22,
CommandTimeout: 60,
Key: `-----BEGIN RSA PRIVATE KEY----- Key: `-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEA4e2D/qPN08pzTac+a8ZmlP1ziJOXk45CynMPtva0rtK/RB26 MIIEpAIBAAKCAQEA4e2D/qPN08pzTac+a8ZmlP1ziJOXk45CynMPtva0rtK/RB26
VbfAF0hIJji7ltvnYnqCU9oFfvEM33cTn7T96+od8ib/Vz25YU8ZbstqtIskPuwC VbfAF0hIJji7ltvnYnqCU9oFfvEM33cTn7T96+od8ib/Vz25YU8ZbstqtIskPuwC
@ -94,6 +96,7 @@ func TestSSHScriptFromKeyFile(t *testing.T) {
Port: 22, Port: 22,
KeyPath: "./tests/.ssh/id_rsa", KeyPath: "./tests/.ssh/id_rsa",
Script: []string{"whoami", "ls -al"}, Script: []string{"whoami", "ls -al"},
CommandTimeout: 60,
}, },
} }
@ -125,7 +128,6 @@ func TestSSHCommandNotFound(t *testing.T) {
Port: 22, Port: 22,
KeyPath: "./tests/.ssh/id_rsa", KeyPath: "./tests/.ssh/id_rsa",
Script: []string{"whoami1234"}, Script: []string{"whoami1234"},
CommandTimeout: 1,
}, },
} }