testnetwork

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 7 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 testnetwork holds the integration labs: nodes booted through the node's own assembly, services.BootApp, on the loopback hosts the labs draw, beside the fixtures they share — the address draws and the polls; the test WebPKI standing in for the core's certificate authority comes from pkg/core/webpki/webpkitest. The labs import the node's assembly, so no package under pkg can host them.

Index

Constants

View Source
const (
	Propagation  = 100 * time.Millisecond
	Registration = 200 * time.Millisecond
	EnrollRetry  = 100 * time.Millisecond
	TestTimeout  = 20 * time.Second
	// RestartTimeout budgets the restart lab's convergence: the reboot puts
	// the joiner's loop through serial stages — re-rendezvous, a fresh
	// prompt, the press, the chain — whose wall-clock pacing stretches
	// several-fold on a loaded runner under the race detector, where the
	// fixed TestTimeout missed a pipeline still progressing.
	RestartTimeout = 3 * TestTimeout
)

Test intervals, fast enough for the integration tests to watch the loops.

Variables

This section is empty.

Functions

func FreeUDPAddrOn

func FreeUDPAddrOn(t *testing.T, ip netip.Addr) string

FreeUDPAddrOn returns a free UDP address on the given host.

func PinnedTCPAddrOn

func PinnedTCPAddrOn(t *testing.T, ip netip.Addr) string

PinnedTCPAddrOn returns a TCP address on the given host for a listener to bind: the band's next free port, probed by listening on it and released for the listener's own bind, safe for the same reason as PinnedUDPAddrOn.

func PinnedUDPAddrOn

func PinnedUDPAddrOn(t *testing.T, ip netip.Addr) string

PinnedUDPAddrOn returns a UDP address on the given host for the node to rebind: the band's next free port, probed by binding it and released for the node's own bind. The release is safe — nothing that binds :0 draws from the band.

func Poll

func Poll(t *testing.T, what string, cond func() bool)

Poll waits for cond to hold, failing the test at the timeout.

func PollErr

func PollErr(t *testing.T, what string, attempt func() error)

PollErr waits for attempt to return nil, failing the test at the timeout with the last error attempt returned.

func PollFor

func PollFor(t *testing.T, budget time.Duration, what string, cond func() bool)

PollFor is Poll under an explicit budget, for labs whose convergence outgrows TestTimeout on a loaded runner.

Types

This section is empty.

Directories

Path Synopsis
Package fabric is the integration labs' userspace network: one gVisor netstack per node — the SOCKS application's own recipe — connected by a forwarder the harness owns, so a lab's nodes hold no kernel port at all and the network's behaviors are taps the lab draws: delay, loss, blackhole, cut, and the translation boundary.
Package fabric is the integration labs' userspace network: one gVisor netstack per node — the SOCKS application's own recipe — connected by a forwarder the harness owns, so a lab's nodes hold no kernel port at all and the network's behaviors are taps the lab draws: delay, loss, blackhole, cut, and the translation boundary.

Jump to

Keyboard shortcuts

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