package testutils

import "github.com/docker/docker/libnetwork/testutils"

Index

Functions

func SetupTestOSContext

func SetupTestOSContext(t *testing.T) func()

SetupTestOSContext joins the current goroutine to a new network namespace, and returns its associated teardown function.

Example usage:

defer SetupTestOSContext(t)()

Types

type Logger

type Logger interface {
	Logf(format string, args ...any)
}

Logger is used to log non-fatal messages during tests.

type OSContext

type OSContext struct{}

func SetupTestOSContextEx

func SetupTestOSContextEx(*testing.T) *OSContext

func (*OSContext) Cleanup

func (*OSContext) Cleanup(t *testing.T)

func (*OSContext) Go

func (c *OSContext) Go(t *testing.T, fn func())

Go starts running fn in a new goroutine inside the test OS context.

func (*OSContext) Set

func (*OSContext) Set() (func(Logger), error)

Source Files

context.go context_windows.go

Version
v24.0.0-rc.2+incompatible
Published
May 5, 2023
Platform
windows/amd64
Imports
1 packages
Last checked
2 hours ago

Tools for package owners.