Merge pull request #37455 from fcrisciani/fix-internal

Fix flakyness in TestDockerNetworkInternalMode
This commit is contained in:
Yong Tang 2018-07-13 15:26:05 -07:00 committed by GitHub
commit 126d038831
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1644,9 +1644,9 @@ func (s *DockerSuite) TestDockerNetworkInternalMode(c *check.C) {
c.Assert(waitRun("first"), check.IsNil)
dockerCmd(c, "run", "-d", "--net=internal", "--name=second", "busybox:glibc", "top")
c.Assert(waitRun("second"), check.IsNil)
out, _, err := dockerCmdWithError("exec", "first", "ping", "-W", "4", "-c", "1", "www.google.com")
out, _, err := dockerCmdWithError("exec", "first", "ping", "-W", "4", "-c", "1", "8.8.8.8")
c.Assert(err, check.NotNil)
c.Assert(out, checker.Contains, "ping: bad address")
c.Assert(out, checker.Contains, "100% packet loss")
_, _, err = dockerCmdWithError("exec", "second", "ping", "-c", "1", "first")
c.Assert(err, check.IsNil)
}