testsession

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package testsession provides utilities to test SSH sessions.

more or less copied from charmbracelet/ssh tests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Listen added in v0.4.0

func Listen(tb testing.TB, srv *ssh.Server) string

Listen starts a test server.

func New

func New(tb testing.TB, srv *ssh.Server, cfg *gossh.ClientConfig) *gossh.Session

New starts a local SSH server with the given config and returns a client session. It automatically closes everything afterwards.

func NewClientSession added in v0.4.0

func NewClientSession(tb testing.TB, addr string, config *gossh.ClientConfig) (*gossh.Session, error)

NewClientSession creates a new client session to the given address.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL