Documentation ¶
Index ¶
- Constants
- Variables
- func Clear()
- type MockCloudManager
- func (mockMgr *MockCloudManager) CanSpawn() (bool, error)
- func (mockMgr *MockCloudManager) Configure(settings *evergreen.Settings) error
- func (mockMgr *MockCloudManager) GetDNSName(host *host.Host) (string, error)
- func (mockMgr *MockCloudManager) GetInstanceStatus(host *host.Host) (cloud.CloudStatus, error)
- func (mockMgr *MockCloudManager) GetSSHOptions(host *host.Host, keyPath string) ([]string, error)
- func (_ *MockCloudManager) GetSettings() cloud.ProviderSettings
- func (mockMgr *MockCloudManager) IsSSHReachable(host *host.Host, keyPath string) (bool, error)
- func (mockMgr *MockCloudManager) IsUp(host *host.Host) (bool, error)
- func (mockMgr *MockCloudManager) OnUp(host *host.Host) error
- func (mockMgr *MockCloudManager) SpawnInstance(distro *distro.Distro, hostOpts cloud.HostOptions) (*host.Host, error)
- func (mockMgr *MockCloudManager) TerminateInstance(host *host.Host) error
- func (mockMgr *MockCloudManager) TimeTilNextPayment(host *host.Host) time.Duration
- func (_ *MockCloudManager) Validate() error
- type MockInstance
Constants ¶
View Source
const ProviderName = "mock"
Variables ¶
View Source
var MockInstances map[string]MockInstance = map[string]MockInstance{}
Functions ¶
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 (*MockCloudManager) GetSettings ¶
func (_ *MockCloudManager) GetSettings() cloud.ProviderSettings
func (*MockCloudManager) IsSSHReachable ¶
func (*MockCloudManager) IsUp ¶
func (mockMgr *MockCloudManager) IsUp(host *host.Host) (bool, 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.
Click to show internal directories.
Click to hide internal directories.