testing

package
v0.0.0-...-9d6b0cf Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2013 License: AGPL-3.0, AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLocalTestStorage

func CreateLocalTestStorage(c *gc.C) (closer io.Closer, storage environs.Storage, dataDir string)

CreateLocalTestStorage returns the listener, which needs to be closed, and the storage that is backed by a directory created in the running tests temp directory.

func MustUploadFakeTools

func MustUploadFakeTools(storage environs.Storage)

MustUploadFakeTools acts as UploadFakeTools, but panics on failure.

func MustUploadFakeToolsVersion

func MustUploadFakeToolsVersion(storage environs.Storage, vers version.Binary) *tools.Tools

MustUploadFakeToolsVersion acts as UploadFakeToolsVersion, but panics on failure.

func PatchAttemptStrategies

func PatchAttemptStrategies(strategies ...*utils.AttemptStrategy) func()

PatchAttemptStrategies patches environs' global polling strategy, plus any otther AttemptStrategy objects whose addresses you pass, to very short polling and timeout times so that tests can run fast. It returns a cleanup function that restores the original settings. You must call this afterwards.

func PatchDataDir

func PatchDataDir(path string) func()

PatchDataDir temporarily overrides environs.DataDir for testing purposes. It returns a cleanup function that you must call later to restore the original value.

func RemoveAllTools

func RemoveAllTools(c *C, env environs.Environ)

RemoveAllTools deletes all tools from the supplied environment.

func RemoveFakeTools

func RemoveFakeTools(c *C, storage environs.Storage)

RemoveFakeTools deletes the fake tools from the supplied storage.

func RemoveTools

func RemoveTools(c *C, storage environs.Storage)

RemoveTools deletes all tools from the supplied storage.

func UploadFakeTools

func UploadFakeTools(c *C, storage environs.Storage)

UploadFakeTools puts fake tools into the supplied storage with a binary version matching version.Current; if version.Current's series is different to config.DefaultSeries, matching fake tools will be uploaded for that series. This is useful for tests that are kinda casual about specifying their environment.

func UploadFakeToolsVersion

func UploadFakeToolsVersion(c *C, storage environs.Storage, vers version.Binary) *tools.Tools

UploadFakeToolsVersion puts fake tools in the supplied storage for the supplied version.

Types

type EC2HTTPTestStorage

type EC2HTTPTestStorage struct {
	// contains filtered or unexported fields
}

EC2HTTPTestStorage acts like an EC2 storage which can be accessed by HTTP.

func NewEC2HTTPTestStorage

func NewEC2HTTPTestStorage(ip string) (*EC2HTTPTestStorage, error)

NewEC2HTTPTestStorage creates a storage server for tests with the HTTPStorageReader.

func (*EC2HTTPTestStorage) Location

func (s *EC2HTTPTestStorage) Location() string

Location returns the location that has to be used in the tests.

func (*EC2HTTPTestStorage) PutBinary

func (s *EC2HTTPTestStorage) PutBinary(v version.Binary)

PutBinary stores a faked binary in the HTTP test storage.

func (*EC2HTTPTestStorage) Stop

func (s *EC2HTTPTestStorage) Stop() error

Stop stops the HTTP test storage.

Jump to

Keyboard shortcuts

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