mirror of
https://github.com/moby/moby.git
synced 2025-08-01 05:47:11 +03:00
Don't check running container at create time
We should let user create container even if the container he wants join is not running, that check should be done at start time. In this case, the running check is done by getIpcContainer() when we start container. Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
This commit is contained in:
@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"reflect"
|
||||
@ -323,3 +324,20 @@ func (s *DockerSuite) TestCreateRM(c *check.C) {
|
||||
c.Fatalf("Failed to rm -f container:%s\n%s", out, err)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestCreateModeIpcContainer(c *check.C) {
|
||||
testRequires(c, SameHostDaemon)
|
||||
|
||||
cmd := exec.Command(dockerBinary, "create", "busybox")
|
||||
out, _, err := runCommandWithOutput(cmd)
|
||||
if err != nil {
|
||||
c.Fatal(err, out)
|
||||
}
|
||||
id := strings.TrimSpace(out)
|
||||
|
||||
cmd = exec.Command(dockerBinary, "create", fmt.Sprintf("--ipc=container:%s", id), "busybox")
|
||||
out, _, err = runCommandWithOutput(cmd)
|
||||
if err != nil {
|
||||
c.Fatalf("Create container with ipc mode container should success with non running container: %s\n%s", out, err)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user