integtest

package
v0.0.0-...-6b2d232 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FirecrackerRuntime is the Firecracker-containerd runtime
	FirecrackerRuntime = "aws.firecracker"
)

Variables

View Source
var (
	// ContainerdSockPath is the default Firecracker-containerd socket path
	ContainerdSockPath = "/run/firecracker-containerd/containerd.sock"

	// NumberOfVms is the number of VMs used in integration testing set
	// by either environment variable read or defaults to 5 VMs.
	NumberOfVms = 5
)
View Source
var DefaultRuntimeConfig = config.Config{
	FirecrackerBinaryPath: "/usr/local/bin/firecracker",
	KernelImagePath:       "/var/lib/firecracker-containerd/runtime/default-vmlinux.bin",
	KernelArgs:            "ro console=ttyS0 noapic reboot=k panic=1 pci=off nomodules systemd.unified_cgroup_hierarchy=0 systemd.journald.forward_to_console systemd.log_color=false systemd.unit=firecracker.target init=/sbin/overlay-init",
	RootDrive:             "/var/lib/firecracker-containerd/runtime/default-rootfs.img",
	LogLevels:             []string{"debug"},
	ShimBaseDir:           ShimBaseDir(),
	JailerConfig: config.JailerConfig{
		RuncBinaryPath: "/usr/local/bin/runc",
		RuncConfigPath: "/etc/containerd/firecracker-runc-config.json",
	},
}

DefaultRuntimeConfig represents a simple firecracker-containerd configuration.

Functions

func NewFCControlClient

func NewFCControlClient(socket string) (*client.Client, error)

NewFCControlClient returns a Firecracker control client for the given socket.

func Prepare

func Prepare(t testing.TB, options ...func(*config.Config))

Prepare is a common integration test setup function which ensures isolation and prepares the runtime configuration for firecracker-containerd

func ShimBaseDir

func ShimBaseDir() string

ShimBaseDir checks the "SHIM_BASE_DIR" environment variable and returns its value if it exists, else returns the default value

func WithDefaultNetwork

func WithDefaultNetwork() func(c *config.Config)

WithDefaultNetwork is an option to use the default network configuration in the runtime configuration for integration testing

Types

type CommandResult

type CommandResult struct {
	Stdout   string
	Stderr   string
	ExitCode uint32
}

CommandResult encapsulates the stdout, stderr, and exit code returned from a task.

func RunTask

RunTask is a utility function for running a task and returning the result.

Jump to

Keyboard shortcuts

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