(t *testing.T)
| 396 | } |
| 397 | |
| 398 | func TestWrongRawKey(t *testing.T) { |
| 399 | // wrong key |
| 400 | ssh := &MakeConfig{ |
| 401 | Server: "localhost", |
| 402 | User: "drone-scp", |
| 403 | Port: "22", |
| 404 | Key: "appleboy", |
| 405 | } |
| 406 | |
| 407 | outStr, errStr, isTimeout, err := ssh.Run("whoami") |
| 408 | assert.Equal(t, "", outStr) |
| 409 | assert.Equal(t, "", errStr) |
| 410 | assert.False(t, isTimeout) |
| 411 | assert.Error(t, err) |
| 412 | } |
| 413 | |
| 414 | func TestExitCode(t *testing.T) { |
| 415 | ssh := &MakeConfig{ |