func (s *kvmSuite) SetUpTest(c *gc.C) { s.TestSuite.SetUpTest(c) s.events = make(chan mock.Event) go func() { for event := range s.events { c.Output(3, fmt.Sprintf("kvm event: <%s, %s>", event.Action, event.InstanceId)) } }() s.TestSuite.ContainerFactory.AddListener(s.events) }
func (s *lxcSuite) SetUpTest(c *gc.C) { s.TestSuite.SetUpTest(c) s.events = make(chan mock.Event) s.eventsDone = make(chan struct{}) go func() { defer close(s.eventsDone) for event := range s.events { c.Output(3, fmt.Sprintf("lxc event: <%s, %s>", event.Action, event.InstanceId)) } }() s.TestSuite.ContainerFactory.AddListener(s.events) }