Browse code

Modify test to include /dev/shm sharing

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
(cherry picked from commit 457aeaa2e1bdbb75c5b3bcedacde460920965c2f)

Mrunal Patel authored on 2015/08/14 07:35:18
Showing 1 changed files
... ...
@@ -1986,7 +1986,7 @@ func (s *DockerSuite) TestRunModeIpcHost(c *check.C) {
1986 1986
 func (s *DockerSuite) TestRunModeIpcContainer(c *check.C) {
1987 1987
 	testRequires(c, SameHostDaemon, DaemonIsLinux)
1988 1988
 
1989
-	out, _ := dockerCmd(c, "run", "-d", "busybox", "top")
1989
+	out, _ := dockerCmd(c, "run", "-d", "busybox", "sh", "-c", "echo -n test > /dev/shm/test && top")
1990 1990
 
1991 1991
 	id := strings.TrimSpace(out)
1992 1992
 	state, err := inspectField(id, "State.Running")
... ...
@@ -2007,6 +2007,11 @@ func (s *DockerSuite) TestRunModeIpcContainer(c *check.C) {
2007 2007
 	if parentContainerIpc != out {
2008 2008
 		c.Fatalf("IPC different with --ipc=container:%s %s != %s\n", id, parentContainerIpc, out)
2009 2009
 	}
2010
+
2011
+	catOutput, _ := dockerCmd(c, "run", fmt.Sprintf("--ipc=container:%s", id), "busybox", "cat", "/dev/shm/test")
2012
+	if catOutput != "test" {
2013
+		c.Fatalf("Output of /dev/shm/test expected test but found: %s", catOutput)
2014
+	}
2010 2015
 }
2011 2016
 
2012 2017
 func (s *DockerSuite) TestRunModeIpcContainerNotExists(c *check.C) {