mock

package
v0.0.0-...-1d50e38 Latest Latest
Warning

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

Go to latest
Published: May 30, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ProviderName = "mock"

Variables

View Source
var MockInstances map[string]MockInstance = map[string]MockInstance{}

Functions

func Clear

func Clear()

Types

type MockCloudManager

type MockCloudManager struct {
	Instances map[string]MockInstance
	// contains filtered or unexported fields
}

MockCloudManager implements the CloudManager interface for testing purposes. It contains a map of MockInstances that it knows about which its various functions return information about. Once set before testing, this map should only be touched either through the associated cloud manager functions, or in association with the mutex.

func FetchMockProvider

func FetchMockProvider() *MockCloudManager

func (*MockCloudManager) CanSpawn

func (mockMgr *MockCloudManager) CanSpawn() (bool, error)

func (*MockCloudManager) Configure

func (mockMgr *MockCloudManager) Configure(settings *evergreen.Settings) error

func (*MockCloudManager) GetDNSName

func (mockMgr *MockCloudManager) GetDNSName(host *host.Host) (string, error)

get instance DNS

func (*MockCloudManager) GetInstanceStatus

func (mockMgr *MockCloudManager) GetInstanceStatus(host *host.Host) (cloud.CloudStatus, error)

get the status of an instance

func (*MockCloudManager) GetSSHOptions

func (mockMgr *MockCloudManager) GetSSHOptions(host *host.Host, keyPath string) ([]string, error)

func (*MockCloudManager) GetSettings

func (_ *MockCloudManager) GetSettings() cloud.ProviderSettings

func (*MockCloudManager) IsSSHReachable

func (mockMgr *MockCloudManager) IsSSHReachable(host *host.Host, keyPath string) (bool, error)

func (*MockCloudManager) IsUp

func (mockMgr *MockCloudManager) IsUp(host *host.Host) (bool, error)

func (*MockCloudManager) OnUp

func (mockMgr *MockCloudManager) OnUp(host *host.Host) error

func (*MockCloudManager) SpawnInstance

func (mockMgr *MockCloudManager) SpawnInstance(distro *distro.Distro, hostOpts cloud.HostOptions) (*host.Host, error)

func (*MockCloudManager) TerminateInstance

func (mockMgr *MockCloudManager) TerminateInstance(host *host.Host) error

terminate an instance

func (*MockCloudManager) TimeTilNextPayment

func (mockMgr *MockCloudManager) TimeTilNextPayment(host *host.Host) time.Duration

func (*MockCloudManager) Validate

func (_ *MockCloudManager) Validate() error

type MockInstance

type MockInstance struct {
	IsUp               bool
	IsSSHReachable     bool
	Status             cloud.CloudStatus
	SSHOptions         []string
	TimeTilNextPayment time.Duration
	DNSName            string
	OnUpRan            bool
}

MockInstance mocks a running server that Evergreen knows about. It contains fields that can be set to change the response the cloud manager returns when this mock instance is queried for.

Jump to

Keyboard shortcuts

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