fix daemon tests that were using wrong containerd socket

Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 52b60f705c)
Signed-off-by: Tibor Vass <tibor@docker.com>
This commit is contained in:
Tibor Vass 2018-09-25 17:57:35 +00:00
parent e090646d47
commit 6bf8dfc4d8
2 changed files with 7 additions and 5 deletions

View file

@ -44,7 +44,7 @@ import (
"gotest.tools/icmd" "gotest.tools/icmd"
) )
const containerdSocket = "/run/containerd/containerd.sock" // "/var/run/docker/containerd/docker-containerd.sock" const containerdSocket = "/var/run/docker/containerd/containerd.sock"
// TestLegacyDaemonCommand test starting docker daemon using "deprecated" docker daemon // TestLegacyDaemonCommand test starting docker daemon using "deprecated" docker daemon
// command. Remove this test when we remove this. // command. Remove this test when we remove this.
@ -2411,7 +2411,7 @@ func (s *DockerDaemonSuite) TestRunWithRuntimeFromConfigFile(c *check.C) {
{ {
"runtimes": { "runtimes": {
"oci": { "oci": {
"path": "docker-runc" "path": "runc"
}, },
"vm": { "vm": {
"path": "/usr/local/bin/vm-manager", "path": "/usr/local/bin/vm-manager",
@ -2493,7 +2493,7 @@ func (s *DockerDaemonSuite) TestRunWithRuntimeFromConfigFile(c *check.C) {
"default-runtime": "vm", "default-runtime": "vm",
"runtimes": { "runtimes": {
"oci": { "oci": {
"path": "docker-runc" "path": "runc"
}, },
"vm": { "vm": {
"path": "/usr/local/bin/vm-manager", "path": "/usr/local/bin/vm-manager",
@ -2519,7 +2519,7 @@ func (s *DockerDaemonSuite) TestRunWithRuntimeFromConfigFile(c *check.C) {
} }
func (s *DockerDaemonSuite) TestRunWithRuntimeFromCommandLine(c *check.C) { func (s *DockerDaemonSuite) TestRunWithRuntimeFromCommandLine(c *check.C) {
s.d.StartWithBusybox(c, "--add-runtime", "oci=docker-runc", "--add-runtime", "vm=/usr/local/bin/vm-manager") s.d.StartWithBusybox(c, "--add-runtime", "oci=runc", "--add-runtime", "vm=/usr/local/bin/vm-manager")
// Run with default runtime // Run with default runtime
out, err := s.d.Cmd("run", "--rm", "busybox", "ls") out, err := s.d.Cmd("run", "--rm", "busybox", "ls")
@ -2566,7 +2566,7 @@ func (s *DockerDaemonSuite) TestRunWithRuntimeFromCommandLine(c *check.C) {
// Check that we can select a default runtime // Check that we can select a default runtime
s.d.Stop(c) s.d.Stop(c)
s.d.StartWithBusybox(c, "--default-runtime=vm", "--add-runtime", "oci=docker-runc", "--add-runtime", "vm=/usr/local/bin/vm-manager") s.d.StartWithBusybox(c, "--default-runtime=vm", "--add-runtime", "oci=runc", "--add-runtime", "vm=/usr/local/bin/vm-manager")
out, err = s.d.Cmd("run", "--rm", "busybox", "ls") out, err = s.d.Cmd("run", "--rm", "busybox", "ls")
c.Assert(err, check.NotNil, check.Commentf("%s", out)) c.Assert(err, check.NotNil, check.Commentf("%s", out))

View file

@ -38,6 +38,7 @@ type logT interface {
} }
const defaultDockerdBinary = "dockerd" const defaultDockerdBinary = "dockerd"
const containerdSocket = "/var/run/docker/containerd/containerd.sock"
var errDaemonNotStarted = errors.New("daemon not started") var errDaemonNotStarted = errors.New("daemon not started")
@ -224,6 +225,7 @@ func (d *Daemon) StartWithLogFile(out *os.File, providedArgs ...string) error {
return errors.Wrapf(err, "[%s] could not find docker binary in $PATH", d.id) return errors.Wrapf(err, "[%s] could not find docker binary in $PATH", d.id)
} }
args := append(d.GlobalFlags, args := append(d.GlobalFlags,
"--containerd", containerdSocket,
"--data-root", d.Root, "--data-root", d.Root,
"--exec-root", d.execRoot, "--exec-root", d.execRoot,
"--pidfile", fmt.Sprintf("%s/docker.pid", d.Folder), "--pidfile", fmt.Sprintf("%s/docker.pid", d.Folder),