sshfixture

package
v0.0.0-...-f7438ca Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package sshfixture starts ephemeral OpenSSH server containers for the integration tests. It exposes one host and an optional jump-host pair so the examples can exercise remote.Command and CopyToRemote without any cloud credentials.

Index

Constants

View Source
const User = "testuser"

User is the SSH login on every fixture container.

Variables

This section is empty.

Functions

This section is empty.

Types

type Proxy

type Proxy struct {
	Proxy         Server
	Target        Server // Host is a Docker-network DNS name, Port is 2222.
	PrivateKeyPEM string
}

Proxy describes a jump-host scenario: the test connects to Proxy from the host, and the proxy reaches Target via a Docker network alias. Both servers share the same SSH key.

func NewProxy

func NewProxy(t *testing.T) Proxy

NewProxy starts two openssh-server containers wired through a private Docker network so the second is only reachable via the first.

type Server

type Server struct {
	Host          string
	Port          int
	PrivateKeyPEM string
}

Server describes one running OpenSSH container as seen from the host running the test.

func New

func New(t *testing.T) Server

New starts a single openssh-server container reachable from the host.

func (Server) Endpoint

func (s Server) Endpoint() string

Endpoint formats a host:port string for logging.

Jump to

Keyboard shortcuts

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