MCPcopy
hub / github.com/ContainerSSH/ContainerSSH / NewTestClient

Function NewTestClient

internal/sshserver/NewTestClient.go:14–31  ·  view source on GitHub ↗

NewTestClient creates a new TestClient instance with the specified parameters - server is the host and IP pair of the server. - hostPrivateKey is the PEM-encoded private host key. The public key and fingerprint are automatically extracted. - username is the username. - password is the password used

(
	server string,
	hostPrivateKey string,
	user *TestUser,
	logger log.Logger,
)

Source from the content-addressed store, hash-verified

12// - username is the username.
13// - password is the password used for authentication.
14func NewTestClient(
15 server string,
16 hostPrivateKey string,
17 user *TestUser,
18 logger log.Logger,
19) TestClient {
20 private, err := ssh.ParsePrivateKey([]byte(hostPrivateKey))
21 if err != nil {
22 panic(err)
23 }
24
25 return &testClientImpl{
26 server: server,
27 hostKey: private.PublicKey().Marshal(),
28 user: user,
29 logger: logger,
30 }
31}

Calls 1

MarshalMethod · 0.65

Tested by 4

createTestServerFunction · 0.74
TestProperShutdownFunction · 0.74