Updating `integration-cli/daemon.go` to use `dockerd` instead of `docker
daemon` to start up the daemon.
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
| ... | ... |
@@ -23,9 +23,6 @@ import ( |
| 23 | 23 |
|
| 24 | 24 |
// Daemon represents a Docker daemon for the testing framework. |
| 25 | 25 |
type Daemon struct {
|
| 26 |
- // Defaults to "daemon" |
|
| 27 |
- // Useful to set to --daemon or -d for checking backwards compatibility |
|
| 28 |
- Command string |
|
| 29 | 26 |
GlobalFlags []string |
| 30 | 27 |
|
| 31 | 28 |
id string |
| ... | ... |
@@ -72,7 +69,6 @@ func NewDaemon(c *check.C) *Daemon {
|
| 72 | 72 |
} |
| 73 | 73 |
|
| 74 | 74 |
return &Daemon{
|
| 75 |
- Command: "daemon", |
|
| 76 | 75 |
id: id, |
| 77 | 76 |
c: c, |
| 78 | 77 |
folder: daemonFolder, |
| ... | ... |
@@ -137,11 +133,10 @@ func (d *Daemon) Start(args ...string) error {
|
| 137 | 137 |
|
| 138 | 138 |
// StartWithLogFile will start the daemon and attach its streams to a given file. |
| 139 | 139 |
func (d *Daemon) StartWithLogFile(out *os.File, providedArgs ...string) error {
|
| 140 |
- dockerBinary, err := exec.LookPath(dockerBinary) |
|
| 140 |
+ dockerdBinary, err := exec.LookPath(dockerdBinary) |
|
| 141 | 141 |
d.c.Assert(err, check.IsNil, check.Commentf("[%s] could not find docker binary in $PATH", d.id))
|
| 142 | 142 |
|
| 143 | 143 |
args := append(d.GlobalFlags, |
| 144 |
- d.Command, |
|
| 145 | 144 |
"--containerd", "/var/run/docker/libcontainerd/docker-containerd.sock", |
| 146 | 145 |
"--graph", d.root, |
| 147 | 146 |
"--exec-root", filepath.Join(d.folder, "exec-root"), |
| ... | ... |
@@ -175,7 +170,7 @@ func (d *Daemon) StartWithLogFile(out *os.File, providedArgs ...string) error {
|
| 175 | 175 |
} |
| 176 | 176 |
|
| 177 | 177 |
args = append(args, providedArgs...) |
| 178 |
- d.cmd = exec.Command(dockerBinary, args...) |
|
| 178 |
+ d.cmd = exec.Command(dockerdBinary, args...) |
|
| 179 | 179 |
|
| 180 | 180 |
d.cmd.Stdout = out |
| 181 | 181 |
d.cmd.Stderr = out |
| ... | ... |
@@ -327,7 +327,7 @@ func (s *DockerAuthzSuite) TestAuthZPluginAllowEventStream(c *check.C) {
|
| 327 | 327 |
|
| 328 | 328 |
startTime := strconv.FormatInt(daemonTime(c).Unix(), 10) |
| 329 | 329 |
// Add another command to to enable event pipelining |
| 330 |
- eventsCmd := exec.Command(s.d.cmd.Path, "--host", s.d.sock(), "events", "--since", startTime) |
|
| 330 |
+ eventsCmd := exec.Command(dockerBinary, "--host", s.d.sock(), "events", "--since", startTime) |
|
| 331 | 331 |
stdout, err := eventsCmd.StdoutPipe() |
| 332 | 332 |
if err != nil {
|
| 333 | 333 |
c.Assert(err, check.IsNil) |
| ... | ... |
@@ -29,6 +29,16 @@ import ( |
| 29 | 29 |
"github.com/kr/pty" |
| 30 | 30 |
) |
| 31 | 31 |
|
| 32 |
+// TestLegacyDaemonCommand test starting docker daemon using "deprecated" docker daemon |
|
| 33 |
+// command. Remove this test when we remove this. |
|
| 34 |
+func (s *DockerDaemonSuite) TestLegacyDaemonCommand(c *check.C) {
|
|
| 35 |
+ cmd := exec.Command(dockerBinary, "daemon", "--storage-driver=vfs", "--debug") |
|
| 36 |
+ err := cmd.Start() |
|
| 37 |
+ c.Assert(err, checker.IsNil, check.Commentf("could not start daemon using 'docker daemon'"))
|
|
| 38 |
+ |
|
| 39 |
+ c.Assert(cmd.Process.Kill(), checker.IsNil) |
|
| 40 |
+} |
|
| 41 |
+ |
|
| 32 | 42 |
func (s *DockerDaemonSuite) TestDaemonRestartWithRunningContainersPorts(c *check.C) {
|
| 33 | 43 |
if err := s.d.StartWithBusybox(); err != nil {
|
| 34 | 44 |
c.Fatalf("Could not start daemon with busybox: %v", err)
|
| ... | ... |
@@ -1454,7 +1464,7 @@ func (s *DockerDaemonSuite) TestHttpsRun(c *check.C) {
|
| 1454 | 1454 |
|
| 1455 | 1455 |
// TestTlsVerify verifies that --tlsverify=false turns on tls |
| 1456 | 1456 |
func (s *DockerDaemonSuite) TestTlsVerify(c *check.C) {
|
| 1457 |
- out, err := exec.Command(dockerBinary, "daemon", "--tlsverify=false").CombinedOutput() |
|
| 1457 |
+ out, err := exec.Command(dockerdBinary, "--tlsverify=false").CombinedOutput() |
|
| 1458 | 1458 |
if err == nil || !strings.Contains(string(out), "Could not load X509 key pair") {
|
| 1459 | 1459 |
c.Fatalf("Daemon should not have started due to missing certs: %v\n%s", err, string(out))
|
| 1460 | 1460 |
} |
| ... | ... |
@@ -10,8 +10,10 @@ import ( |
| 10 | 10 |
) |
| 11 | 11 |
|
| 12 | 12 |
var ( |
| 13 |
- // the docker binary to use |
|
| 13 |
+ // the docker client binary to use |
|
| 14 | 14 |
dockerBinary = "docker" |
| 15 |
+ // the docker daemon binary to use |
|
| 16 |
+ dockerdBinary = "dockerd" |
|
| 15 | 17 |
|
| 16 | 18 |
// path to containerd's ctr binary |
| 17 | 19 |
ctrBinary = "docker-containerd-ctr" |