From ea6ef2786deda793edbfbd6bf2da8ad11d5eb023 Mon Sep 17 00:00:00 2001 From: Alessandro Boch Date: Fri, 3 Mar 2017 13:04:04 -0800 Subject: [PATCH] Add test for anonymous container w/ net-alias on swarm network Signed-off-by: Alessandro Boch Upstream-commit: ef794c3649c3a2085289aacbcb7f37fb02cb6523 Component: engine --- components/engine/integration-cli/docker_cli_swarm_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/engine/integration-cli/docker_cli_swarm_test.go b/components/engine/integration-cli/docker_cli_swarm_test.go index 909698594d..026891e3ef 100644 --- a/components/engine/integration-cli/docker_cli_swarm_test.go +++ b/components/engine/integration-cli/docker_cli_swarm_test.go @@ -303,11 +303,16 @@ func (s *DockerSwarmSuite) TestSwarmContainerEndpointOptions(c *check.C) { _, err = d.Cmd("run", "-d", "--net=foo", "--name=second", "busybox", "top") c.Assert(err, checker.IsNil, check.Commentf(out)) - // ping first container and its alias + _, err = d.Cmd("run", "-d", "--net=foo", "--net-alias=third-alias", "busybox", "top") + c.Assert(err, checker.IsNil, check.Commentf(out)) + + // ping first container and its alias, also ping third and anonymous container by its alias _, err = d.Cmd("exec", "second", "ping", "-c", "1", "first") c.Assert(err, check.IsNil, check.Commentf(out)) _, err = d.Cmd("exec", "second", "ping", "-c", "1", "first-alias") c.Assert(err, check.IsNil, check.Commentf(out)) + _, err = d.Cmd("exec", "second", "ping", "-c", "1", "third-alias") + c.Assert(err, check.IsNil, check.Commentf(out)) } func (s *DockerSwarmSuite) TestSwarmContainerAttachByNetworkId(c *check.C) {