|
@@ -16,8 +16,10 @@ import (
|
|
var (
|
|
var (
|
|
pluginProcessName = "sample-volume-plugin"
|
|
pluginProcessName = "sample-volume-plugin"
|
|
pName = "tonistiigi/sample-volume-plugin"
|
|
pName = "tonistiigi/sample-volume-plugin"
|
|
|
|
+ npName = "tonistiigi/test-docker-netplugin"
|
|
pTag = "latest"
|
|
pTag = "latest"
|
|
pNameWithTag = pName + ":" + pTag
|
|
pNameWithTag = pName + ":" + pTag
|
|
|
|
+ npNameWithTag = npName + ":" + pTag
|
|
)
|
|
)
|
|
|
|
|
|
func (s *DockerSuite) TestPluginBasicOps(c *check.C) {
|
|
func (s *DockerSuite) TestPluginBasicOps(c *check.C) {
|
|
@@ -87,6 +89,33 @@ func (s *DockerSuite) TestPluginActive(c *check.C) {
|
|
c.Assert(out, checker.Contains, pNameWithTag)
|
|
c.Assert(out, checker.Contains, pNameWithTag)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+func (s *DockerSuite) TestPluginActiveNetwork(c *check.C) {
|
|
|
|
+ testRequires(c, DaemonIsLinux, IsAmd64, Network)
|
|
|
|
+ out, _, err := dockerCmdWithError("plugin", "install", "--grant-all-permissions", npNameWithTag)
|
|
|
|
+ c.Assert(err, checker.IsNil)
|
|
|
|
+
|
|
|
|
+ out, _, err = dockerCmdWithError("network", "create", "-d", npNameWithTag, "test")
|
|
|
|
+ c.Assert(err, checker.IsNil)
|
|
|
|
+
|
|
|
|
+ nID := strings.TrimSpace(out)
|
|
|
|
+
|
|
|
|
+ out, _, err = dockerCmdWithError("plugin", "remove", npNameWithTag)
|
|
|
|
+ c.Assert(out, checker.Contains, "is in use")
|
|
|
|
+
|
|
|
|
+ _, _, err = dockerCmdWithError("network", "rm", nID)
|
|
|
|
+ c.Assert(err, checker.IsNil)
|
|
|
|
+
|
|
|
|
+ out, _, err = dockerCmdWithError("plugin", "remove", npNameWithTag)
|
|
|
|
+ c.Assert(out, checker.Contains, "is enabled")
|
|
|
|
+
|
|
|
|
+ _, _, err = dockerCmdWithError("plugin", "disable", npNameWithTag)
|
|
|
|
+ c.Assert(err, checker.IsNil)
|
|
|
|
+
|
|
|
|
+ out, _, err = dockerCmdWithError("plugin", "remove", npNameWithTag)
|
|
|
|
+ c.Assert(err, checker.IsNil)
|
|
|
|
+ c.Assert(out, checker.Contains, npNameWithTag)
|
|
|
|
+}
|
|
|
|
+
|
|
func (s *DockerSuite) TestPluginInstallDisable(c *check.C) {
|
|
func (s *DockerSuite) TestPluginInstallDisable(c *check.C) {
|
|
testRequires(c, DaemonIsLinux, IsAmd64, Network)
|
|
testRequires(c, DaemonIsLinux, IsAmd64, Network)
|
|
out, _, err := dockerCmdWithError("plugin", "install", "--grant-all-permissions", "--disable", pName)
|
|
out, _, err := dockerCmdWithError("plugin", "install", "--grant-all-permissions", "--disable", pName)
|