vostest

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

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDeterministicOS

func NewDeterministicOS(resolver vos.ProcessResolver) vos.VOS

Types

type Cmd

type Cmd struct {
	// Process function, will be run with any process name unless ProcessResolver
	// is set.
	Process vos.ProcessFunc

	// ProcessResolver to use if process name doesn't match Argv[0]. If not
	// supplied, Process is always used.
	ProcessResolver func(path string) vos.ProcessFunc

	// Process arguments, the first argument should be the process name.
	Argv []string
	// If Dir is non-empty, the child changes into the directory before
	// creating the process.
	Dir string
	// If Env is non-empty, it gives the environment variables for the
	// new process in the form returned by Environ.
	// If it is nil, the result of Environ will be used.
	Env []string

	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer

	ExitStatus int

	// VOS will be initialized after Command is called.
	VOS vos.VOS

	Setup func(vos.VOS) error
}

Cmd is similar to exec.Cmd.

func Command

func Command(process vos.ProcessFunc, name string, arg ...string) *Cmd

func (*Cmd) CombinedOutput

func (c *Cmd) CombinedOutput() ([]byte, error)

func (*Cmd) Run

func (c *Cmd) Run() error

Run starts the comand and waits for it to complete.

type FakeSSHSession

type FakeSSHSession struct {
}

func (*FakeSSHSession) Exit

func (f *FakeSSHSession) Exit(code int) error

func (*FakeSSHSession) RemoteAddr

func (f *FakeSSHSession) RemoteAddr() net.Addr

func (*FakeSSHSession) User

func (f *FakeSSHSession) User() string

func (*FakeSSHSession) Write

func (f *FakeSSHSession) Write(b []byte) (int, error)

type NopEventRecorder

type NopEventRecorder struct{}

func (*NopEventRecorder) Record

func (*NopEventRecorder) Record(event logger.LogType) error

func (*NopEventRecorder) SessionID

func (*NopEventRecorder) SessionID() string

Jump to

Keyboard shortcuts

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