Add test for anonymous container w/ net-alias on swarm network

Signed-off-by: Alessandro Boch <aboch@docker.com>
Upstream-commit: ef794c3649c3a2085289aacbcb7f37fb02cb6523
Component: engine
This commit is contained in:
Alessandro Boch
2017-03-03 13:04:04 -08:00
parent df253ac5fd
commit ea6ef2786d

View File

@ -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) {