Documentation
¶
Overview ¶
Package sshrunnertest is a scripted runner every engine's tests drive a node with.
Index ¶
- type Fake
- func (f *Fake) Close() error
- func (f *Fake) Contexts() []context.Context
- func (f *Fake) Dial(context.Context, string, string) (net.Conn, error)
- func (f *Fake) Files(context.Context) (sshrunner.Files, error)
- func (f *Fake) Lines() []string
- func (f *Fake) Options() []*sshrunner.StartOptions
- func (f *Fake) Ping(ctx context.Context) error
- func (f *Fake) Run(ctx context.Context, line string, _ io.Reader) (*sshrunner.Result, error)
- func (f *Fake) Start(ctx context.Context, line string, opts *sshrunner.StartOptions) (sshrunner.Session, error)
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fake ¶
type Fake struct {
Respond func(line string) *sshrunner.Result
// Started hands one session to each started command in order.
Started []*Session
// StartErr refuses every command started past the ones Started scripts.
StartErr error
// contains filtered or unexported fields
}
Fake records the command lines it is given and answers them from Respond.
func (*Fake) Contexts ¶
Contexts returns the context each started command was bound to, which is its lifetime.
func (*Fake) Options ¶
func (f *Fake) Options() []*sshrunner.StartOptions
Options returns the stream shape the engine asked each started command for.
type Session ¶
type Session struct {
Code int
Out string
Err string
Hold <-chan struct{}
// contains filtered or unexported fields
}
Session is one scripted command with its exit code and output.
func (*Session) Stderr ¶
func (s *Session) Stderr() io.ReadCloser
func (*Session) Stdin ¶
func (s *Session) Stdin() io.WriteCloser
func (*Session) Stdout ¶
func (s *Session) Stdout() io.ReadCloser
Click to show internal directories.
Click to hide internal directories.