TestRootAccount test root account
(t *testing.T)
| 469 | |
| 470 | // TestRootAccount test root account |
| 471 | func TestRootAccount(t *testing.T) { |
| 472 | ssh := &MakeConfig{ |
| 473 | Server: "localhost", |
| 474 | User: "root", |
| 475 | Port: "22", |
| 476 | KeyPath: "./tests/.ssh/id_rsa", |
| 477 | } |
| 478 | |
| 479 | outStr, errStr, isTimeout, err := ssh.Run("whoami") |
| 480 | assert.Equal(t, "root\n", outStr) |
| 481 | assert.Equal(t, "", errStr) |
| 482 | assert.True(t, isTimeout) |
| 483 | assert.NoError(t, err) |
| 484 | } |
| 485 | |
| 486 | // TestSudoCommand |
| 487 | func TestSudoCommand(t *testing.T) { |