From 276bac21383d6f55cb060d6c49737090162e6078 Mon Sep 17 00:00:00 2001 From: Madhu Venugopal Date: Mon, 31 Oct 2016 15:36:51 -0700 Subject: [PATCH] Basic IT for plugin-v2 network driver Since the plugin APIs have not changed for local-scoped network drivers between plugin-v1 and v2, a simple test to validate the bootstrapping and network creation APIs would suffice. Any network driver specific API validations are handled independent of plugin v1 or v2 format. Using a sample v2 network plugin : https://github.com/mavenugo/test-docker-netplugin/ Signed-off-by: Madhu Venugopal Upstream-commit: 259441c027226683d38080caac7a39d6192c9dfa Component: engine --- .../docker_cli_network_unix_test.go | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/components/engine/integration-cli/docker_cli_network_unix_test.go b/components/engine/integration-cli/docker_cli_network_unix_test.go index 00864d8a02..b50db133fc 100644 --- a/components/engine/integration-cli/docker_cli_network_unix_test.go +++ b/components/engine/integration-cli/docker_cli_network_unix_test.go @@ -768,6 +768,30 @@ func (s *DockerNetworkSuite) TestDockerNetworkDriverOptions(c *check.C) { } +func (s *DockerNetworkSuite) TestDockerPluginV2NetworkDriver(c *check.C) { + testRequires(c, DaemonIsLinux, ExperimentalDaemon, Network) + + var ( + npName = "mavenugo/test-docker-netplugin" + npTag = "latest" + npNameWithTag = npName + ":" + npTag + ) + _, _, err := dockerCmdWithError("plugin", "install", "--grant-all-permissions", npNameWithTag) + c.Assert(err, checker.IsNil) + + out, _, err := dockerCmdWithError("plugin", "ls") + c.Assert(err, checker.IsNil) + c.Assert(out, checker.Contains, npName) + c.Assert(out, checker.Contains, npTag) + c.Assert(out, checker.Contains, "true") + + dockerCmd(c, "network", "create", "-d", npNameWithTag, "v2net") + assertNwIsAvailable(c, "v2net") + dockerCmd(c, "network", "rm", "v2net") + assertNwNotAvailable(c, "v2net") + +} + func (s *DockerDaemonSuite) TestDockerNetworkNoDiscoveryDefaultBridgeNetwork(c *check.C) { testRequires(c, ExecSupport) // On default bridge network built-in service discovery should not happen