mirror of
https://github.com/appleboy/drone-ssh.git
synced 2025-09-13 20:00:10 +08:00
fix testing
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
8b10b8c3e9
commit
ce947748d1
@ -32,11 +32,12 @@ func TestMissingKeyOrPassword(t *testing.T) {
|
|||||||
func TestIncorrectPassword(t *testing.T) {
|
func TestIncorrectPassword(t *testing.T) {
|
||||||
plugin := Plugin{
|
plugin := Plugin{
|
||||||
Config: Config{
|
Config: Config{
|
||||||
Host: []string{"localhost"},
|
Host: []string{"localhost"},
|
||||||
UserName: "drone-scp",
|
UserName: "drone-scp",
|
||||||
Port: 22,
|
Port: 22,
|
||||||
Password: "123456",
|
Password: "123456",
|
||||||
Script: []string{"whoami"},
|
Script: []string{"whoami"},
|
||||||
|
CommandTimeout: 60,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,9 +48,10 @@ func TestIncorrectPassword(t *testing.T) {
|
|||||||
func TestSSHScriptFromRawKey(t *testing.T) {
|
func TestSSHScriptFromRawKey(t *testing.T) {
|
||||||
plugin := Plugin{
|
plugin := Plugin{
|
||||||
Config: Config{
|
Config: Config{
|
||||||
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
|
||||||
@ -89,11 +91,12 @@ ib4KbP5ovZlrjL++akMQ7V2fHzuQIFWnCkDA5c2ZAqzlM+ZN+HRG7gWur7Bt4XH1
|
|||||||
func TestSSHScriptFromKeyFile(t *testing.T) {
|
func TestSSHScriptFromKeyFile(t *testing.T) {
|
||||||
plugin := Plugin{
|
plugin := Plugin{
|
||||||
Config: Config{
|
Config: Config{
|
||||||
Host: []string{"localhost", "127.0.0.1"},
|
Host: []string{"localhost", "127.0.0.1"},
|
||||||
UserName: "drone-scp",
|
UserName: "drone-scp",
|
||||||
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,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,12 +123,11 @@ func TestSSHCommandTimeOut(t *testing.T) {
|
|||||||
func TestSSHCommandNotFound(t *testing.T) {
|
func TestSSHCommandNotFound(t *testing.T) {
|
||||||
plugin := Plugin{
|
plugin := Plugin{
|
||||||
Config: Config{
|
Config: Config{
|
||||||
Host: []string{"localhost"},
|
Host: []string{"localhost"},
|
||||||
UserName: "drone-scp",
|
UserName: "drone-scp",
|
||||||
Port: 22,
|
Port: 22,
|
||||||
KeyPath: "./tests/.ssh/id_rsa",
|
KeyPath: "./tests/.ssh/id_rsa",
|
||||||
Script: []string{"whoami1234"},
|
Script: []string{"whoami1234"},
|
||||||
CommandTimeout: 1,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user