Documentation
¶
Overview ¶
Package remotehost runs SSH and docker/podman commands on remote test machines.
Index ¶
- Constants
- func ConfigureVRFDHCP(mtu int, links []VRFLink, hosts []Host)
- func RemoveVRFNetworkd(links []VRFLink, hosts []Host)
- func RunIBWriteBW(client, server Host, cfg Net, duration time.Duration, minAvgBWGbit float32, ...)
- func RunTrafficTest(client, server Host, cfg Net)
- func SpinUpAll(hosts []Host, image string)
- type Host
- func (h Host) AssertPingFailure(cfg Net)
- func (h Host) FlushIface(iface, subnet string, family IPFamily)
- func (h Host) GetLinkMAC(iface string) string
- func (h Host) Login()
- func (h Host) Ping(cfg Net)
- func (h Host) Remove()
- func (h Host) SSH(cmd string) (string, error)
- func (h Host) SpinUp(image string)
- type IPFamily
- type Net
- type RegistryAuth
- type VRFLink
Constants ¶
const ( // DefaultTimeout is the default Eventually timeout. DefaultTimeout = 1 * time.Minute // LongTimeout is the Eventually timeout for slow host operations. LongTimeout = 6 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
func ConfigureVRFDHCP ¶
ConfigureVRFDHCP writes transient networkd drop-ins and runs DHCP for each link Family.
func RemoveVRFNetworkd ¶
RemoveVRFNetworkd removes transient networkd drop-ins (best-effort).
func RunIBWriteBW ¶
func RunIBWriteBW( client, server Host, cfg Net, duration time.Duration, minAvgBWGbit float32, mtu int, extraArgs ...string, )
RunIBWriteBW runs ib_write_bw and asserts average BW above minAvgBWGbit.
func RunTrafficTest ¶
RunTrafficTest runs bidirectional iperf3 using cfg Destination and optional ClientBindIP.
Types ¶
type Host ¶
type Host struct {
// Addr is the SSH address.
Addr string
// User is the SSH user, empty defaults to root.
User string
// Password is the SSH password for sshpass.
Password string
// ContainerName is the docker/podman container name.
ContainerName string
// Runtime is docker or podman.
Runtime string
// RegistryAuth is the registry credentials for pulling images, nil skips the login.
RegistryAuth *RegistryAuth
}
Host is a remote SSH machine with an optional container runtime.
func (Host) AssertPingFailure ¶
AssertPingFailure asserts ping to Destination consistently fails.
func (Host) FlushIface ¶
FlushIface best-effort flushes host addresses on iface and drops the subnet route.
func (Host) GetLinkMAC ¶
GetLinkMAC returns the link MAC for iface on the remote host.
func (Host) Login ¶
func (h Host) Login()
Login authenticates the host runtime against RegistryAuth, no-op when unset.
type IPFamily ¶
type IPFamily int
IPFamily is IPv4 or IPv6 for DHCP and traffic helpers, zero value is IPv4, no dual-stack until a caller needs it.
type Net ¶
type Net struct {
// VRF, when set, wraps commands with ip vrf exec.
VRF string
// Destination is the ping, iperf, or RDMA peer IP.
Destination string
// ClientBindIP is the optional iperf -B address.
ClientBindIP string
// RDMADev is the RDMA device for ib_write_bw.
RDMADev string
// Family is IPv4 or IPv6, zero value is IPv4.
Family IPFamily
}
Net is the network context for traffic helpers, empty VRF uses the default namespace.
type RegistryAuth ¶
type RegistryAuth struct {
// Registry is the registry host.
Registry string
// Username is the registry user.
Username string
// Password is the registry password or API key.
Password string
}
RegistryAuth are credentials for pulling images on the remote host.