MCPcopy Create free account
hub / github.com/appleboy/easyssh-proxy / TestRootAccount

Function TestRootAccount

easyssh_test.go:471–484  ·  view source on GitHub ↗

TestRootAccount test root account

(t *testing.T)

Source from the content-addressed store, hash-verified

469
470// TestRootAccount test root account
471func 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
487func TestSudoCommand(t *testing.T) {

Callers

nothing calls this directly

Calls 1

RunMethod · 0.95

Tested by

no test coverage detected