cmd

package
v0.0.0-...-66a6fc1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Rendered for windows/amd64

Overview

This package provides testing wrappers around github.com/Microsoft/hcsshim/internal/cmd

Index

Constants

View Source
const CopyAfterExitTimeout = time.Second
View Source
const ForcedKilledExitCode = 137

ForcedKilledExitCode is the (Linux) exit code when processes are foreably killed.

Variables

This section is empty.

Functions

func Create

func Create(ctx context.Context, _ testing.TB, c cow.ProcessHost, p *specs.Process, io *BufferedIO) *cmd.Cmd

func Kill

func Kill(ctx context.Context, tb testing.TB, c *cmd.Cmd)

func Run

func Run(ctx context.Context, tb testing.TB, c *cmd.Cmd) int

func Start

func Start(_ context.Context, tb testing.TB, c *cmd.Cmd)

func Wait

func Wait(_ context.Context, tb testing.TB, c *cmd.Cmd) int

func WaitExitCode

func WaitExitCode(ctx context.Context, tb testing.TB, c *cmd.Cmd, e int)

Types

type BufferedIO

type BufferedIO struct {
	// contains filtered or unexported fields
}

func NewBufferedIO

func NewBufferedIO() *BufferedIO

func NewBufferedIOFromString

func NewBufferedIOFromString(in string) *BufferedIO

func (*BufferedIO) AddToCmd

func (b *BufferedIO) AddToCmd(c *cmd.Cmd)

func (*BufferedIO) Output

func (b *BufferedIO) Output() (_ string, err error)

func (*BufferedIO) TestOutput

func (b *BufferedIO) TestOutput(tb testing.TB, out string, err error)

func (*BufferedIO) TestStdOutContains

func (b *BufferedIO) TestStdOutContains(tb testing.TB, want, notWant []string)

Jump to

Keyboard shortcuts

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