Skip to content

Commit

Permalink
Modify test to include /dev/shm sharing
Browse files Browse the repository at this point in the history
Signed-off-by: Mrunal Patel <[email protected]>
  • Loading branch information
mrunalp committed Aug 19, 2015
1 parent d88fe44 commit 457aeaa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion integration-cli/docker_cli_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1948,7 +1948,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")
Expand All @@ -1969,6 +1969,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) {
Expand Down

0 comments on commit 457aeaa

Please sign in to comment.