From b748debb76110e577cfde7c5d5c362e69ddf86ce Mon Sep 17 00:00:00 2001 From: Anusha Ragunathan Date: Wed, 22 Mar 2017 14:37:16 -0700 Subject: [PATCH] Add missing test for daemon kill with plugins running. Signed-off-by: Anusha Ragunathan --- .../docker_cli_daemon_plugins_test.go | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/integration-cli/docker_cli_daemon_plugins_test.go b/integration-cli/docker_cli_daemon_plugins_test.go index 90246ef2b0..1be69a267a 100644 --- a/integration-cli/docker_cli_daemon_plugins_test.go +++ b/integration-cli/docker_cli_daemon_plugins_test.go @@ -155,7 +155,34 @@ func (s *DockerDaemonSuite) TestDaemonShutdownWithPlugins(c *check.C) { Error: "exit status 1", }) - s.d.Start(c, "--live-restore") + s.d.Start(c) + icmd.RunCommand("pgrep", "-f", pluginProcessName).Assert(c, icmd.Success) +} + +// TestDaemonKillWithPlugins leaves plugins running. +func (s *DockerDaemonSuite) TestDaemonKillWithPlugins(c *check.C) { + testRequires(c, IsAmd64, Network, SameHostDaemon) + + s.d.Start(c) + if out, err := s.d.Cmd("plugin", "install", "--grant-all-permissions", pName); err != nil { + c.Fatalf("Could not install plugin: %v %s", err, out) + } + + defer func() { + s.d.Restart(c) + if out, err := s.d.Cmd("plugin", "disable", pName); err != nil { + c.Fatalf("Could not disable plugin: %v %s", err, out) + } + if out, err := s.d.Cmd("plugin", "remove", pName); err != nil { + c.Fatalf("Could not remove plugin: %v %s", err, out) + } + }() + + if err := s.d.Kill(); err != nil { + c.Fatalf("Could not kill daemon: %v", err) + } + + // assert that plugins are running. icmd.RunCommand("pgrep", "-f", pluginProcessName).Assert(c, icmd.Success) }