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

Signed-off-by: Alessandro Boch <aboch@docker.com>
This commit is contained in:
Alessandro Boch 2017-03-03 13:04:04 -08:00
parent b005c7d6eb
commit ef794c3649
1 changed files with 6 additions and 1 deletions

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