Documentation
¶
Overview ¶
Package testssh is a tiny in-process SSH server used by tests in other packages. It's regular (non-test) code so it can be imported; it takes a *testing.T so setup failures are reported at the call site. The server accepts password auth for a single user/pass pair and serves:
- direct-tcpip channels (for tunnel forwarding tests)
- session channels with exec requests (for command tests)
- session channels with the "sftp" subsystem (for transfer tests)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a running SSH server bound to a local port.
func Start ¶
Start starts an SSH server on an ephemeral port. The returned server is auto-closed when the test finishes via t.Cleanup.
func StartAt ¶
StartAt is Start with a caller-chosen bind address. Pass "127.0.0.1:<port>" to bind a specific port — useful for reconnect tests that need to bring the same endpoint back up after a shutdown.