fakes

package
v0.0.56 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyInput

type ApplyInput struct {
	ApplySpec bias.ApplySpec
}

type AttachDiskInput

type AttachDiskInput struct {
	Disk bidisk.Disk
}

type CreateInput

type CreateInput struct {
	Stemcell bistemcell.CloudStemcell
	Manifest bideplmanifest.Manifest
}

type DeployInput

type DeployInput struct {
	DiskPool         bideplmanifest.DiskPool
	Cloud            bicloud.Cloud
	VM               bivm.VM
	EventLoggerStage biui.Stage
}

type DetachDiskInput

type DetachDiskInput struct {
	Disk bidisk.Disk
}

type FakeDiskDeployer

type FakeDiskDeployer struct {
	DeployInputs []DeployInput
	// contains filtered or unexported fields
}

func NewFakeDiskDeployer

func NewFakeDiskDeployer() *FakeDiskDeployer

func (*FakeDiskDeployer) Deploy

func (d *FakeDiskDeployer) Deploy(
	diskPool bideplmanifest.DiskPool,
	cloud bicloud.Cloud,
	vm bivm.VM,
	eventLoggerStage biui.Stage,
) ([]bidisk.Disk, error)

func (*FakeDiskDeployer) SetDeployBehavior

func (d *FakeDiskDeployer) SetDeployBehavior(disks []bidisk.Disk, err error)

type FakeManager

type FakeManager struct {
	CreateInput CreateInput
	CreateVM    bivm.VM
	CreateErr   error
	// contains filtered or unexported fields
}

func NewFakeManager

func NewFakeManager() *FakeManager

func (*FakeManager) Create

func (m *FakeManager) Create(stemcell bistemcell.CloudStemcell, deploymentManifest bideplmanifest.Manifest) (bivm.VM, error)

func (*FakeManager) FindCurrent

func (m *FakeManager) FindCurrent() (bivm.VM, bool, error)

func (*FakeManager) SetFindCurrentBehavior

func (m *FakeManager) SetFindCurrentBehavior(vm bivm.VM, found bool, err error)

type FakeManagerFactory

type FakeManagerFactory struct {
	NewManagerInputs []NewManagerInput
	// contains filtered or unexported fields
}

func NewFakeManagerFactory

func NewFakeManagerFactory() *FakeManagerFactory

func (*FakeManagerFactory) NewManager

func (f *FakeManagerFactory) NewManager(cloud bicloud.Cloud, mbusURL string) bivm.Manager

func (*FakeManagerFactory) SetNewManagerBehavior

func (f *FakeManagerFactory) SetNewManagerBehavior(cloud bicloud.Cloud, mbusURL string, manager bivm.Manager)

type FakeVM

type FakeVM struct {
	ExistsCalled int
	ExistsFound  bool
	ExistsErr    error

	AgentClientReturn biagentclient.AgentClient

	UpdateDisksInputs []UpdateDisksInput
	UpdateDisksDisks  []bidisk.Disk
	UpdateDisksErr    error

	ApplyInputs []ApplyInput
	ApplyErr    error

	StartCalled int
	StartErr    error

	AttachDiskInputs []AttachDiskInput

	DetachDiskInputs []DetachDiskInput

	WaitUntilReadyInputs []WaitUntilReadyInput
	WaitUntilReadyErr    error

	WaitToBeRunningInputs []WaitInput
	WaitToBeRunningErr    error

	DeleteCalled int
	DeleteErr    error

	StopCalled int
	StopErr    error

	ListDisksDisks []bidisk.Disk
	ListDisksErr   error

	UnmountDiskInputs []UnmountDiskInput
	UnmountDiskErr    error

	MigrateDiskCalledTimes int
	MigrateDiskErr         error

	RunScriptInputs []string
	RunScriptErrors map[string]error

	GetStateResult biagentclient.AgentState
	GetStateCalled int
	GetStateErr    error
	// contains filtered or unexported fields
}

func NewFakeVM

func NewFakeVM(cid string) *FakeVM

func (*FakeVM) AgentClient

func (vm *FakeVM) AgentClient() biagentclient.AgentClient

func (*FakeVM) Apply

func (vm *FakeVM) Apply(applySpec bias.ApplySpec) error

func (*FakeVM) AttachDisk

func (vm *FakeVM) AttachDisk(disk bidisk.Disk) error

func (*FakeVM) CID

func (vm *FakeVM) CID() string

func (*FakeVM) Delete

func (vm *FakeVM) Delete() error

func (*FakeVM) DetachDisk

func (vm *FakeVM) DetachDisk(disk bidisk.Disk) error

func (*FakeVM) Disks

func (vm *FakeVM) Disks() ([]bidisk.Disk, error)

func (*FakeVM) Exists

func (vm *FakeVM) Exists() (bool, error)

func (*FakeVM) GetState

func (vm *FakeVM) GetState() (biagentclient.AgentState, error)

func (*FakeVM) MigrateDisk

func (vm *FakeVM) MigrateDisk() error

func (*FakeVM) RunScript

func (vm *FakeVM) RunScript(script string, options map[string]interface{}) error

func (*FakeVM) SetAttachDiskBehavior

func (vm *FakeVM) SetAttachDiskBehavior(disk bidisk.Disk, err error)

func (*FakeVM) SetDetachDiskBehavior

func (vm *FakeVM) SetDetachDiskBehavior(disk bidisk.Disk, err error)

func (*FakeVM) Start

func (vm *FakeVM) Start() error

func (*FakeVM) Stop

func (vm *FakeVM) Stop() error

func (*FakeVM) UnmountDisk

func (vm *FakeVM) UnmountDisk(disk bidisk.Disk) error

func (*FakeVM) UpdateDisks

func (vm *FakeVM) UpdateDisks(diskPool bideplmanifest.DiskPool, eventLoggerStage biui.Stage) ([]bidisk.Disk, error)

func (*FakeVM) WaitToBeRunning

func (vm *FakeVM) WaitToBeRunning(maxAttempts int, delay time.Duration) error

func (*FakeVM) WaitUntilReady

func (vm *FakeVM) WaitUntilReady(timeout time.Duration, delay time.Duration) error

type NewManagerInput

type NewManagerInput struct {
	Cloud   bicloud.Cloud
	MbusURL string
}

type UnmountDiskInput

type UnmountDiskInput struct {
	Disk bidisk.Disk
}

type UpdateDisksInput

type UpdateDisksInput struct {
	DiskPool bideplmanifest.DiskPool
	Stage    biui.Stage
}

type WaitInput

type WaitInput struct {
	MaxAttempts int
	Delay       time.Duration
}

type WaitUntilReadyInput

type WaitUntilReadyInput struct {
	Timeout time.Duration
	Delay   time.Duration
}

Jump to

Keyboard shortcuts

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