containerztest

package
v0.0.0-...-b343c7a Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Client

func Client(t *testing.T, dut *ondatra.DUTDevice) *client.Client

Client returns a new containerz client.

func DeployAndStart

func DeployAndStart(ctx context.Context, t *testing.T, cli *client.Client, opts StartContainerOptions) error

DeployAndStart sets up and starts a container according to the provided options.

func Setup

func Setup(ctx context.Context, t *testing.T, dut *ondatra.DUTDevice, opts StartContainerOptions) (*client.Client, func())

Setup is a helper function that deploys and starts a container, and returns a client and a cleanup function that stops and removes the container. It calls t.Fatalf on failure.

func Stop

func Stop(ctx context.Context, t *testing.T, cli *client.Client, instNameToStop string)

Stop stops and removes a container instance.

func WaitForRunning

func WaitForRunning(ctx context.Context, t *testing.T, cli *client.Client, instanceName string, timeout time.Duration) error

WaitForRunning polls until a container instance is in the RUNNING state.

Types

type StartContainerOptions

type StartContainerOptions struct {
	ImageName           string
	ImageTag            string
	TarPath             string
	InstanceName        string
	Command             string
	Ports               []string
	RemoveExistingImage bool
	PollForRunningState bool
	PollTimeout         time.Duration
	PollInterval        time.Duration
	Network             string
}

StartContainerOptions holds parameters for starting a container.

Jump to

Keyboard shortcuts

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