Documentation
¶
Overview ¶
Package testenv starts in-process protocol servers for tests: an S3 fake over HTTP and an SSH server with a read-only SFTP subsystem. Synthetic data only; nothing here is used outside tests.
Index ¶
- Variables
- func BuildPlugin(t testing.TB, name string) []byte
- func ClientKey(t testing.TB, passphrase []byte) ([]byte, ssh.PublicKey)
- func Install(t testing.TB, s plugin.Store, qualified string, bin []byte, question string, ...) plugin.LockEntry
- func Manifest(name, question string, timeoutS int) []byte
- func RepoRoot() string
- func TempStore(t testing.TB) plugin.Store
- type S3
- type SFTP
- type SFTPOptions
- type Vocab
Constants ¶
This section is empty.
Variables ¶
var ClientKeys = []string{"consoles", "console", "sources", "plugins", "refusal"}
ClientKeys are the keys the CLI and MCP outputs add around the wire's values: the MCP structured outputs and the CLI's JSON refusal.
Functions ¶
func BuildPlugin ¶
BuildPlugin builds sandbox/testdata/plugins/<name> once per test binary.
func ClientKey ¶
ClientKey generates an ed25519 client key: its OpenSSH PEM, encrypted with passphrase when not empty, and its public key.
func Install ¶
func Install(t testing.TB, s plugin.Store, qualified string, bin []byte, question string, timeoutS int) plugin.LockEntry
Install installs bin as the plugin qualified (marketplace/name, or a bare name for the official marketplace) at version 1.0.0.
Types ¶
type SFTP ¶
type SFTP struct {
Host string
Port int
User string
KnownHosts string // a known_hosts file holding the server's key
}
SFTP is a running SFTP server.
type SFTPOptions ¶
SFTPOptions are the accepted logins: a password, an authorized key, or both.
type Vocab ¶ added in v0.3.0
Vocab is the closed vocabulary of what the agent may read (docs/security-model.md), plus what the agent sent and the fixed texts of the output under test. Tests check every agent-visible output against it as a whitelist: a value, a key or a word outside it fails.
func ClosedVocab ¶ added in v0.3.0
ClosedVocab is the closed vocabulary plus extra: the agent's own inputs, the test plugins' manifest texts and the fixed texts of the output checked.
func (Vocab) CheckJSON ¶ added in v0.3.0
CheckJSON fails on anything of a JSON document outside the vocabulary.
func (Vocab) CheckText ¶ added in v0.3.0
CheckText fails on any word of text outside the vocabulary.
func (Vocab) JSONOutside ¶ added in v0.3.0
JSONOutside lists every key, string or number of one JSON document outside the vocabulary.
func (Vocab) TextOutside ¶ added in v0.3.0
TextOutside lists every word of text that is not a word of the vocabulary's strings, an id of its patterns, or a small count.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package consoletest runs a real lockfile console in the test process: lockkit's console.Run on lockfile's backend, attached to a fake lockhub (hubtest), a local source, plugins built from sandbox/testdata, a scripted human and a real socket in the test's private runtime directory.
|
Package consoletest runs a real lockfile console in the test process: lockkit's console.Run on lockfile's backend, attached to a fake lockhub (hubtest), a local source, plugins built from sandbox/testdata, a scripted human and a real socket in the test's private runtime directory. |