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, )
| 12 | // - username is the username. |
| 13 | // - password is the password used for authentication. |
| 14 | func 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 | } |