Documentation
¶
Overview ¶
Package vmtest is a vm.Backend for tests: VMs in memory, every call recorded.
Index ¶
- type Fake
- func (f *Fake) CallLog() string
- func (f *Fake) Clone(_ context.Context, from, to string) error
- func (f *Fake) Create(_ context.Context, name, template string, s vm.Settings, _ io.Writer) error
- func (f *Fake) Delete(_ context.Context, name string) error
- func (f *Fake) Edit(_ context.Context, name string, s vm.Settings) error
- func (f *Fake) Get(_ context.Context, name string) (*vm.Instance, error)
- func (f *Fake) List(context.Context) ([]*vm.Instance, error)
- func (f *Fake) Shell(_ context.Context, name string, o vm.ShellOpts) (int, error)
- func (f *Fake) Start(_ context.Context, name string, _ io.Writer) error
- func (f *Fake) Stop(_ context.Context, name string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fake ¶
type Fake struct {
VMs map[string]*vm.Instance
Calls []string
// Err, when set, is what every call returns.
Err error
// FailOn is what the calls of an operation return ("clone", "edit"...).
FailOn map[string]error
// Sticky VMs survive Delete, and stay running after Stop.
Sticky map[string]bool
// Shell answers Shell calls; exit status 0 when nil.
ShellFunc func(name string, o vm.ShellOpts) int
// contains filtered or unexported fields
}
Fake keeps its VMs in memory.
Click to show internal directories.
Click to hide internal directories.