Documentation ¶
Index ¶
- func WaitMatch(c *gc.C, match func() bool, maxWait time.Duration)
- type AgentSuite
- func (s *AgentSuite) AssertCanOpenState(c *gc.C, tag names.Tag, dataDir string)
- func (s *AgentSuite) AssertCannotOpenState(c *gc.C, tag names.Tag, dataDir string)
- func (s *AgentSuite) InitAgent(c *gc.C, a cmd.Command, args ...string)
- func (s *AgentSuite) PrimeAgent(c *gc.C, tag names.Tag, password string) (agent.ConfigSetterWriter, *coretools.Tools)
- func (s *AgentSuite) PrimeAgentVersion(c *gc.C, tag names.Tag, password string, vers version.Binary) (agent.ConfigSetterWriter, *coretools.Tools)
- func (s *AgentSuite) PrimeStateAgentVersion(c *gc.C, tag names.Tag, password string, vers version.Binary) (agent.ConfigSetterWriter, *coretools.Tools)
- func (s *AgentSuite) SetUpTest(c *gc.C)
- func (s *AgentSuite) WriteStateAgentConfig(c *gc.C, tag names.Tag, password string, vers version.Binary, ...) agent.ConfigSetterWriter
- type EngineTracker
- type WorkerMatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AgentSuite ¶
type AgentSuite struct { testing.ApiServerSuite Environ environs.Environ DataDir string LogDir string }
AgentSuite is a fixture to be used by agent test suites.
func (*AgentSuite) AssertCanOpenState ¶
func (s *AgentSuite) AssertCanOpenState(c *gc.C, tag names.Tag, dataDir string)
func (*AgentSuite) AssertCannotOpenState ¶
func (s *AgentSuite) AssertCannotOpenState(c *gc.C, tag names.Tag, dataDir string)
func (*AgentSuite) InitAgent ¶
InitAgent initialises the given agent command with additional arguments as provided.
func (*AgentSuite) PrimeAgent ¶
func (s *AgentSuite) PrimeAgent(c *gc.C, tag names.Tag, password string) (agent.ConfigSetterWriter, *coretools.Tools)
PrimeAgent writes the configuration file and tools for an agent with the given entity name. It returns the agent's configuration and the current tools.
func (*AgentSuite) PrimeAgentVersion ¶
func (s *AgentSuite) PrimeAgentVersion(c *gc.C, tag names.Tag, password string, vers version.Binary) (agent.ConfigSetterWriter, *coretools.Tools)
PrimeAgentVersion writes the configuration file and tools with version vers for an agent with the given entity name. It returns the agent's configuration and the current tools.
func (*AgentSuite) PrimeStateAgentVersion ¶
func (s *AgentSuite) PrimeStateAgentVersion(c *gc.C, tag names.Tag, password string, vers version.Binary) ( agent.ConfigSetterWriter, *coretools.Tools, )
PrimeStateAgentVersion writes the configuration file and tools with version vers for a state agent with the given entity name. It returns the agent's configuration and the current tools.
func (*AgentSuite) SetUpTest ¶
func (s *AgentSuite) SetUpTest(c *gc.C)
func (*AgentSuite) WriteStateAgentConfig ¶
func (s *AgentSuite) WriteStateAgentConfig( c *gc.C, tag names.Tag, password string, vers version.Binary, modelTag names.ModelTag, apiPort int, ) agent.ConfigSetterWriter
WriteStateAgentConfig creates and writes a state agent config.
type EngineTracker ¶
type EngineTracker struct {
// contains filtered or unexported fields
}
EngineTracker tracks workers which have started.
func NewEngineTracker ¶
func NewEngineTracker() *EngineTracker
NewEngineTracker creates a type that can Install itself into a Manifolds map, and expose recent snapshots of running Workers.
func (*EngineTracker) Install ¶
func (tracker *EngineTracker) Install(raw dependency.Manifolds, id string) error
Install injects a manifold named TEST-TRACKER into raw, which will depend on all other manifolds in raw and write currently-available worker information to the tracker (differentiating it from other tracked engines via the id param).
func (*EngineTracker) Report ¶
func (tracker *EngineTracker) Report(id string) map[string]interface{}
Report returns the most-recently-reported self-report. It will only work if you hack up the relevant engine-starting code to include:
manifolds["self"] = dependency.SelfManifold(engine)
or otherwise inject a suitable "self" manifold.
type WorkerMatcher ¶
type WorkerMatcher struct {
// contains filtered or unexported fields
}
WorkerMatcher monitors the workers of a single engine manager, using an EngineTracker, for a given set of workers to be running.
func NewWorkerMatcher ¶
func NewWorkerMatcher(c *gc.C, tracker *EngineTracker, id string, workers []string) *WorkerMatcher
NewWorkerMatcher takes an EngineTracker, an engine manager id to monitor and the workers that are expected to be running and sets up a WorkerMatcher.
func (*WorkerMatcher) Check ¶
func (m *WorkerMatcher) Check() bool
Check returns true if the workers which are expected to be running (as specified in the call to NewWorkerMatcher) are running and have been running for a short period (i.e. some indication of stability).