Browse code

Kill containers after restart tests

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Michael Crosby authored on 2016/06/15 03:06:11
Showing 1 changed files
... ...
@@ -101,49 +101,6 @@ func (s *DockerDaemonSuite) TestCleanupMountsAfterDaemonCrash(c *check.C) {
101 101
 	c.Assert(strings.Contains(string(mountOut), id), check.Equals, false, comment)
102 102
 }
103 103
 
104
-// TestDaemonRestartWithPausedRunningContainer requires live restore of running containers
105
-func (s *DockerDaemonSuite) TestDaemonRestartWithPausedRunningContainer(t *check.C) {
106
-	if err := s.d.StartWithBusybox("--live-restore"); err != nil {
107
-		t.Fatal(err)
108
-	}
109
-
110
-	cid, err := s.d.Cmd("run", "-d", "--name", "test", "busybox", "top")
111
-	defer s.d.Stop()
112
-	if err != nil {
113
-		t.Fatal(cid, err)
114
-	}
115
-	cid = strings.TrimSpace(cid)
116
-
117
-	// Kill the daemon
118
-	if err := s.d.Kill(); err != nil {
119
-		t.Fatal(err)
120
-	}
121
-
122
-	// kill the container
123
-	runCmd := exec.Command(ctrBinary, "--address", "unix:///var/run/docker/libcontainerd/docker-containerd.sock", "containers", "pause", cid)
124
-	if out, ec, err := runCommandWithOutput(runCmd); err != nil {
125
-		t.Fatalf("Failed to run ctr, ExitCode: %d, err: '%v' output: '%s' cid: '%s'\n", ec, err, out, cid)
126
-	}
127
-
128
-	// Give time to containerd to process the command if we don't
129
-	// the pause event might be received after we do the inspect
130
-	time.Sleep(3 * time.Second)
131
-
132
-	// restart the daemon
133
-	if err := s.d.Start("--live-restore"); err != nil {
134
-		t.Fatal(err)
135
-	}
136
-
137
-	// Check that we've got the correct status
138
-	out, err := s.d.Cmd("inspect", "-f", "{{.State.Status}}", cid)
139
-	t.Assert(err, check.IsNil)
140
-
141
-	out = strings.TrimSpace(out)
142
-	if out != "paused" {
143
-		t.Fatalf("Expected exit code '%s' got '%s' for container '%s'\n", "paused", out, cid)
144
-	}
145
-}
146
-
147 104
 // TestDaemonRestartWithUnpausedRunningContainer requires live restore of running containers.
148 105
 func (s *DockerDaemonSuite) TestDaemonRestartWithUnpausedRunningContainer(t *check.C) {
149 106
 	// TODO(mlaventure): Not sure what would the exit code be on windows
... ...
@@ -192,4 +149,7 @@ func (s *DockerDaemonSuite) TestDaemonRestartWithUnpausedRunningContainer(t *che
192 192
 	if out != "running" {
193 193
 		t.Fatalf("Expected exit code '%s' got '%s' for container '%s'\n", "running", out, cid)
194 194
 	}
195
+	if _, err := s.d.Cmd("kill", cid); err != nil {
196
+		t.Fatal(err)
197
+	}
195 198
 }