Merge pull request #12159 from mrunalp/feature/ipc_share_dev

ipc: Share /dev/shm and /dev/mqueue when --ipc container:<id/name> is used
This commit is contained in:
Jessie Frazelle
2015-08-24 17:55:03 -07:00
8 changed files with 185 additions and 14 deletions
+6 -1
View File
@@ -1889,7 +1889,7 @@ func (s *DockerSuite) TestRunModeIpcHost(c *check.C) {
func (s *DockerSuite) TestRunModeIpcContainer(c *check.C) {
testRequires(c, SameHostDaemon)
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")
@@ -1910,6 +1910,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) {