Merge pull request #24692 from anusha-ragunathan/plugins-ux

Print plugin name on successful install, enable and disable.
Upstream-commit: 340964db1c8f161a2ad156023eb47dcc93bf804b
Component: engine
This commit is contained in:
Sebastiaan van Stijn
2016-07-19 01:09:35 +02:00
committed by GitHub
4 changed files with 44 additions and 24 deletions
@@ -3,54 +3,63 @@ package main
import (
"github.com/docker/docker/pkg/integration/checker"
"github.com/go-check/check"
"strings"
)
var (
pName = "tiborvass/no-remove"
pTag = "latest"
pNameWithTag = pName + ":" + pTag
)
func (s *DockerSuite) TestPluginBasicOps(c *check.C) {
testRequires(c, DaemonIsLinux, ExperimentalDaemon)
name := "tiborvass/no-remove"
tag := "latest"
nameWithTag := name + ":" + tag
_, _, err := dockerCmdWithError("plugin", "install", "--grant-all-permissions", name)
_, _, err := dockerCmdWithError("plugin", "install", "--grant-all-permissions", pNameWithTag)
c.Assert(err, checker.IsNil)
out, _, err := dockerCmdWithError("plugin", "ls")
c.Assert(err, checker.IsNil)
c.Assert(out, checker.Contains, name)
c.Assert(out, checker.Contains, tag)
c.Assert(out, checker.Contains, pName)
c.Assert(out, checker.Contains, pTag)
c.Assert(out, checker.Contains, "true")
out, _, err = dockerCmdWithError("plugin", "inspect", nameWithTag)
out, _, err = dockerCmdWithError("plugin", "inspect", pNameWithTag)
c.Assert(err, checker.IsNil)
c.Assert(out, checker.Contains, "A test plugin for Docker")
out, _, err = dockerCmdWithError("plugin", "remove", nameWithTag)
out, _, err = dockerCmdWithError("plugin", "remove", pNameWithTag)
c.Assert(out, checker.Contains, "is active")
_, _, err = dockerCmdWithError("plugin", "disable", nameWithTag)
_, _, err = dockerCmdWithError("plugin", "disable", pNameWithTag)
c.Assert(err, checker.IsNil)
out, _, err = dockerCmdWithError("plugin", "remove", nameWithTag)
out, _, err = dockerCmdWithError("plugin", "remove", pNameWithTag)
c.Assert(err, checker.IsNil)
c.Assert(out, checker.Contains, nameWithTag)
c.Assert(out, checker.Contains, pNameWithTag)
}
func (s *DockerSuite) TestPluginInstallDisable(c *check.C) {
testRequires(c, DaemonIsLinux, ExperimentalDaemon)
name := "tiborvass/no-remove"
tag := "latest"
nameWithTag := name + ":" + tag
_, _, err := dockerCmdWithError("plugin", "install", "--grant-all-permissions", "--disable", name)
out, _, err := dockerCmdWithError("plugin", "install", "--grant-all-permissions", "--disable", pName)
c.Assert(err, checker.IsNil)
c.Assert(strings.TrimSpace(out), checker.Contains, pName)
out, _, err := dockerCmdWithError("plugin", "ls")
out, _, err = dockerCmdWithError("plugin", "ls")
c.Assert(err, checker.IsNil)
c.Assert(out, checker.Contains, "false")
out, _, err = dockerCmdWithError("plugin", "remove", nameWithTag)
out, _, err = dockerCmdWithError("plugin", "enable", pName)
c.Assert(err, checker.IsNil)
c.Assert(out, checker.Contains, nameWithTag)
c.Assert(strings.TrimSpace(out), checker.Contains, pName)
out, _, err = dockerCmdWithError("plugin", "disable", pName)
c.Assert(err, checker.IsNil)
c.Assert(strings.TrimSpace(out), checker.Contains, pName)
out, _, err = dockerCmdWithError("plugin", "remove", pName)
c.Assert(err, checker.IsNil)
c.Assert(strings.TrimSpace(out), checker.Contains, pName)
}
func (s *DockerSuite) TestPluginInstallImage(c *check.C) {