sshtest

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package sshtest is a stand-in for ssh in tests, so the files of a host a terminal is logged in to (fs.ssh.v1) are tested without a network: the test binary, run under the name ssh, logs in by waiting as a shell would, and asked for sftp serves a folder of this machine as the host's home.

A test package calls Main from TestMain and Install before it starts a terminal or a server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main()

Main runs the stand-in when this binary was started as ssh, and never returns then. Hosts called denied, nosftp and hang fail as ssh does: a password wanted, no sftp server, and no answer at all.

Types

type Host

type Host struct {
	SSH  string // the program, to run as a terminal's command
	Home string // what the host's home is
	// contains filtered or unexported fields
}

Host is the stand-in, installed for one test.

func Install

func Install(t *testing.T) *Host

Install makes the stand-in the ssh conch runs ($CONCH_SSH), with a fresh home for its host.

func (*Host) Runs

func (h *Host) Runs() string

Runs is every command line the stand-in was run with, one a line.

func (*Host) Sessions

func (h *Host) Sessions() int

Sessions counts the sftp sessions made.

Jump to

Keyboard shortcuts

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