mirror of
https://github.com/docker/cli.git
synced 2026-01-16 20:22:36 +03:00
Modify test to include /dev/shm sharing
Signed-off-by: Mrunal Patel <mrunalp@gmail.com> (cherry picked from commit 457aeaa2e1bdbb75c5b3bcedacde460920965c2f) Upstream-commit: 3f631b0d94d57e6dc677a8cd86ecc9233c30e98f Component: engine
This commit is contained in:
committed by
David Calavera
parent
3ef5fa238d
commit
23e2c1d950
@@ -1986,7 +1986,7 @@ func (s *DockerSuite) TestRunModeIpcHost(c *check.C) {
|
||||
func (s *DockerSuite) TestRunModeIpcContainer(c *check.C) {
|
||||
testRequires(c, SameHostDaemon, DaemonIsLinux)
|
||||
|
||||
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")
|
||||
@@ -2007,6 +2007,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) {
|
||||
|
||||
Reference in New Issue
Block a user