示例#1
0
文件: agent_test.go 项目: makyo/juju
func (s *AgentManifoldSuite) SetUpTest(c *gc.C) {
	s.IsolationSuite.SetUpTest(c)
	s.Stub = testing.Stub{}
	s.worker = &dummyWorker{}
	s.manifold = util.AgentManifold(util.AgentManifoldConfig{
		AgentName: "agent-name",
	}, s.newWorker)
}
示例#2
0
文件: manifold.go 项目: makyo/juju
// Manifold returns a dependency.Manifold that governs the construction of
// and access to a machine-wide lock intended to prevent various operations
// from running concurrently and interfering with one another. Examples (are
// not limited to): hook executions, package installation, synchronisation
// of reboots.
// Clients can access the lock by passing a **fslock.Lock into the out param
// of their dependency.Context's Get method.
func Manifold(config ManifoldConfig) dependency.Manifold {
	manifold := util.AgentManifold(util.AgentManifoldConfig(config), newWorker)
	manifold.Output = util.ValueWorkerOutput
	return manifold
}