Browse code

Add missing test for daemon kill with plugins running.

Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>

Anusha Ragunathan authored on 2017/03/23 06:37:16
Showing 1 changed files
... ...
@@ -155,7 +155,34 @@ func (s *DockerDaemonSuite) TestDaemonShutdownWithPlugins(c *check.C) {
155 155
 		Error:    "exit status 1",
156 156
 	})
157 157
 
158
-	s.d.Start(c, "--live-restore")
158
+	s.d.Start(c)
159
+	icmd.RunCommand("pgrep", "-f", pluginProcessName).Assert(c, icmd.Success)
160
+}
161
+
162
+// TestDaemonKillWithPlugins leaves plugins running.
163
+func (s *DockerDaemonSuite) TestDaemonKillWithPlugins(c *check.C) {
164
+	testRequires(c, IsAmd64, Network, SameHostDaemon)
165
+
166
+	s.d.Start(c)
167
+	if out, err := s.d.Cmd("plugin", "install", "--grant-all-permissions", pName); err != nil {
168
+		c.Fatalf("Could not install plugin: %v %s", err, out)
169
+	}
170
+
171
+	defer func() {
172
+		s.d.Restart(c)
173
+		if out, err := s.d.Cmd("plugin", "disable", pName); err != nil {
174
+			c.Fatalf("Could not disable plugin: %v %s", err, out)
175
+		}
176
+		if out, err := s.d.Cmd("plugin", "remove", pName); err != nil {
177
+			c.Fatalf("Could not remove plugin: %v %s", err, out)
178
+		}
179
+	}()
180
+
181
+	if err := s.d.Kill(); err != nil {
182
+		c.Fatalf("Could not kill daemon: %v", err)
183
+	}
184
+
185
+	// assert that plugins are running.
159 186
 	icmd.RunCommand("pgrep", "-f", pluginProcessName).Assert(c, icmd.Success)
160 187
 }
161 188