From 23e2c1d950e591c997cf8d7ff08fa7e5c5500c9b Mon Sep 17 00:00:00 2001 From: Mrunal Patel Date: Thu, 13 Aug 2015 18:35:18 -0400 Subject: [PATCH] Modify test to include /dev/shm sharing Signed-off-by: Mrunal Patel (cherry picked from commit 457aeaa2e1bdbb75c5b3bcedacde460920965c2f) Upstream-commit: 3f631b0d94d57e6dc677a8cd86ecc9233c30e98f Component: engine --- components/engine/integration-cli/docker_cli_run_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/engine/integration-cli/docker_cli_run_test.go b/components/engine/integration-cli/docker_cli_run_test.go index cbc08b6834..45074ef8e5 100644 --- a/components/engine/integration-cli/docker_cli_run_test.go +++ b/components/engine/integration-cli/docker_cli_run_test.go @@ -1986,7 +1986,7 @@ func (s *DockerSuite) TestRunModeIpcHost(c *check.C) { func (s *DockerSuite) TestRunModeIpcContainer(c *check.C) { testRequires(c, SameHostDaemon, DaemonIsLinux) - out, _ := dockerCmd(c, "run", "-d", "busybox", "top") + out, _ := dockerCmd(c, "run", "-d", "busybox", "sh", "-c", "echo -n test > /dev/shm/test && top") id := strings.TrimSpace(out) state, err := inspectField(id, "State.Running") @@ -2007,6 +2007,11 @@ func (s *DockerSuite) TestRunModeIpcContainer(c *check.C) { if parentContainerIpc != out { c.Fatalf("IPC different with --ipc=container:%s %s != %s\n", id, parentContainerIpc, out) } + + catOutput, _ := dockerCmd(c, "run", fmt.Sprintf("--ipc=container:%s", id), "busybox", "cat", "/dev/shm/test") + if catOutput != "test" { + c.Fatalf("Output of /dev/shm/test expected test but found: %s", catOutput) + } } func (s *DockerSuite) TestRunModeIpcContainerNotExists(c *check.C) {