From 3481996e9dca04c42a428b754aac4c2c4a5e4674 Mon Sep 17 00:00:00 2001 From: Kenfe-Mickael Laventure Date: Mon, 28 Mar 2016 11:27:12 -0700 Subject: [PATCH] Add a way to retrieve a test container event channel Signed-off-by: Kenfe-Mickael Laventure --- integration-test/container_utils_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/integration-test/container_utils_test.go b/integration-test/container_utils_test.go index b3429e3..4dff21b 100644 --- a/integration-test/container_utils_test.go +++ b/integration-test/container_utils_test.go @@ -110,12 +110,21 @@ func (c *containerProcess) openIo() (err error) { return nil } +func (c *containerProcess) GetEventsChannel() chan *types.Event { + return c.eventsCh +} + func (c *containerProcess) GetNextEvent() *types.Event { + if c.hasExited { + return nil + } + e := <-c.eventsCh if e.Type == "exit" && e.Pid == c.pid { c.Cleanup() c.hasExited = true + close(c.eventsCh) } return e