Procházet zdrojové kódy

Modify test to include /dev/shm sharing

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
Mrunal Patel před 10 roky
rodič
revize
457aeaa2e1
1 změnil soubory, kde provedl 6 přidání a 1 odebrání
  1. 6 1
      integration-cli/docker_cli_run_test.go

+ 6 - 1
integration-cli/docker_cli_run_test.go

@@ -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")
@@ -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) {