docker_cli_plugins_test.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package main
  2. import (
  3. "github.com/docker/docker/pkg/integration/checker"
  4. "github.com/go-check/check"
  5. )
  6. func (s *DockerSuite) TestPluginBasicOps(c *check.C) {
  7. testRequires(c, DaemonIsLinux, ExperimentalDaemon)
  8. name := "tiborvass/no-remove"
  9. tag := "latest"
  10. nameWithTag := name + ":" + tag
  11. _, _, err := dockerCmdWithError("plugin", "install", name)
  12. c.Assert(err, checker.IsNil)
  13. out, _, err := dockerCmdWithError("plugin", "ls")
  14. c.Assert(err, checker.IsNil)
  15. c.Assert(out, checker.Contains, name)
  16. c.Assert(out, checker.Contains, tag)
  17. c.Assert(out, checker.Contains, "true")
  18. out, _, err = dockerCmdWithError("plugin", "inspect", nameWithTag)
  19. c.Assert(err, checker.IsNil)
  20. c.Assert(out, checker.Contains, "A test plugin for Docker")
  21. out, _, err = dockerCmdWithError("plugin", "remove", nameWithTag)
  22. c.Assert(out, checker.Contains, "is active")
  23. _, _, err = dockerCmdWithError("plugin", "disable", nameWithTag)
  24. c.Assert(err, checker.IsNil)
  25. out, _, err = dockerCmdWithError("plugin", "remove", nameWithTag)
  26. c.Assert(err, checker.IsNil)
  27. c.Assert(out, checker.Contains, nameWithTag)
  28. }