dut

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0, MIT Imports: 12 Imported by: 0

Documentation

Overview

Package dut provides common definitions and utilities to be shared by DUTs.

Index

Constants

View Source
const (

	// PosixServerPort is the port the posix server should listen on.
	PosixServerPort = 54321
	// CtrlIface is the command switch name for passing name of the control interface.
	CtrlIface = "ctrl_iface"
	// TestIface is the command switch name for passing name of the test interface.
	TestIface = "test_iface"
)

Variables

This section is empty.

Functions

func Run

func Run(dut DUT) error

Run is the provided function that calls dut's Bootstrap and Cleanup methods and returns the DUT information to the parent through the pipe.

func WaitForServer

func WaitForServer(output io.Reader) error

WaitForServer waits for a pattern to occur in posix_server's logs.

Types

type DUT

type DUT interface {
	// Bootstrap starts a DUT and returns the collected DUTInfo and a function
	// for the caller to call to wait for the completion of the DUT.
	Bootstrap(ctx context.Context) (testbench.DUTInfo, func() error, error)
	// Cleanup stops the DUT and cleans up the resources being used.
	Cleanup()
}

DUT is an interface for different platforms of DUTs.

type Ifaces

type Ifaces struct {
	// Ctrl is the name of the control interface.
	Ctrl string
	// Test is the name of the test interface.
	Test string
}

Ifaces describe the names of the interfaces on DUT.

func Init

func Init(fs *flag.FlagSet) (Ifaces, error)

Init puts the current process into the target network namespace, the user of this library should call this function in the beginning.

Directories

Path Synopsis
Package linux provides utilities specific to bringing up linux DUTs.
Package linux provides utilities specific to bringing up linux DUTs.
The native binary is used to bring up a native linux DUT.
The native binary is used to bring up a native linux DUT.
The devid binary is used to get the device ID in the runsc container.
The devid binary is used to get the device ID in the runsc container.

Jump to

Keyboard shortcuts

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