Documentation ¶
Overview ¶
The dummy provider implements an environment provider for testing purposes, registered with environs under the name "dummy".
The configuration YAML for the testing environment must specify a "state-server" property with a boolean value. If this is true, a state server will be started the first time StateInfo is called on a newly reset environment.
The configuration data also accepts a "broken" property of type boolean. If this is non-empty, any operation after the environment has been opened will return the error "broken environment", and will also log that.
The DNS name of instances is the same as the Id, with ".dns" appended.
To avoid enumerating all possible series and architectures, any series or architecture with the prefix "unknown" is treated as bad when starting a new instance.
Index ¶
- Variables
- func IsSameStorage(s1, s2 storage.Storage) bool
- func Listen(c chan<- Operation)
- func Poison(ss storage.Storage, path string, poisonErr error)
- func Reset()
- func SampleConfig() testing.Attrs
- func SetInstanceAddresses(inst instance.Instance, addrs []network.Address)
- func SetInstanceStatus(inst instance.Instance, status string)
- func SetStatePolicy(policy state.Policy)
- func SetStorageDelay(d time.Duration)
- type OpAllocateAddress
- type OpBootstrap
- type OpClosePorts
- type OpDestroy
- type OpListNetworks
- type OpOpenPorts
- type OpPutFile
- type OpStartInstance
- type OpStopInstances
- type Operation
Constants ¶
This section is empty.
Variables ¶
var DataDir = ""
Override for testing - the data directory with which the state api server is initialised.
var LogDir = ""
Functions ¶
func IsSameStorage ¶
IsSameStorage returns whether the storage instances are the same. Both storages must have been created through the dummy provider.
func Listen ¶
func Listen(c chan<- Operation)
Listen closes the previously registered listener (if any). Subsequent operations on any dummy environment can be received on c (if not nil).
func Reset ¶
func Reset()
Reset resets the entire dummy environment and forgets any registered operation listener. All opened environments after Reset will share the same underlying state.
func SampleConfig ¶
SampleConfig() returns an environment configuration with all required attributes set.
func SetInstanceAddresses ¶
SetInstanceAddresses sets the addresses associated with the given dummy instance.
func SetInstanceStatus ¶
SetInstanceStatus sets the status associated with the given dummy instance.
func SetStatePolicy ¶
SetStatePolicy sets the state.Policy to use when a state server is initialised by dummy.
func SetStorageDelay ¶
SetStorageDelay causes any storage download operation in any current environment to be delayed for the given duration.
Types ¶
type OpAllocateAddress ¶
type OpBootstrap ¶
type OpBootstrap struct { Context environs.BootstrapContext Env string Args environs.BootstrapParams }