mirror of
https://github.com/moby/moby.git
synced 2025-08-01 05:47:11 +03:00
Fix flaky test TestDaemonRestartRestoreBridgeNetwork
It checked for "Bind for 0.0.0.0:80 failed: port is already
allocated". But, since commit d662091
("portallocator: always
check for ports allocated for 0.0.0.0/::"), the message is
sometimes about ":::80".
Signed-off-by: Rob Murray <rob.murray@docker.com>
This commit is contained in:
@ -1691,8 +1691,8 @@ func (s *DockerDaemonSuite) TestDaemonRestartRestoreBridgeNetwork(t *testing.T)
|
|||||||
|
|
||||||
// start a new container, trying to publish port 80:80 should fail
|
// start a new container, trying to publish port 80:80 should fail
|
||||||
out, err := s.d.Cmd("run", "-p", "80:80", "-d", "busybox", "top")
|
out, err := s.d.Cmd("run", "-p", "80:80", "-d", "busybox", "top")
|
||||||
if err == nil || !strings.Contains(out, "Bind for 0.0.0.0:80 failed: port is already allocated") {
|
if err == nil || !strings.Contains(out, "port is already allocated") {
|
||||||
t.Fatalf("80 port is allocated to old running container, it should failed on allocating to new container")
|
t.Fatalf("Expected 'port is already allocated', got err:%v out:%s", err, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
// kill old running container and try to allocate again
|
// kill old running container and try to allocate again
|
||||||
|
Reference in New Issue
Block a user