Browse code

Modify test to include /dev/shm sharing

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>

Mrunal Patel authored on 2015/08/14 07:35:18
Showing 1 changed files
... ...
@@ -1948,7 +1948,7 @@ func (s *DockerSuite) TestRunModeIpcHost(c *check.C) {
1948 1948
 func (s *DockerSuite) TestRunModeIpcContainer(c *check.C) {
1949 1949
 	testRequires(c, SameHostDaemon)
1950 1950
 
1951
-	out, _ := dockerCmd(c, "run", "-d", "busybox", "top")
1951
+	out, _ := dockerCmd(c, "run", "-d", "busybox", "sh", "-c", "echo -n test > /dev/shm/test && top")
1952 1952
 
1953 1953
 	id := strings.TrimSpace(out)
1954 1954
 	state, err := inspectField(id, "State.Running")
... ...
@@ -1969,6 +1969,11 @@ func (s *DockerSuite) TestRunModeIpcContainer(c *check.C) {
1969 1969
 	if parentContainerIpc != out {
1970 1970
 		c.Fatalf("IPC different with --ipc=container:%s %s != %s\n", id, parentContainerIpc, out)
1971 1971
 	}
1972
+
1973
+	catOutput, _ := dockerCmd(c, "run", fmt.Sprintf("--ipc=container:%s", id), "busybox", "cat", "/dev/shm/test")
1974
+	if catOutput != "test" {
1975
+		c.Fatalf("Output of /dev/shm/test expected test but found: %s", catOutput)
1976
+	}
1972 1977
 }
1973 1978
 
1974 1979
 func (s *DockerSuite) TestRunModeIpcContainerNotExists(c *check.C) {