mirror of
https://github.com/moby/moby.git
synced 2025-10-25 20:38:05 +03:00
Merge pull request #19527 from aboch/epc
Move Unsupp Network & IP check to the new updateNetworkConfig() func
This commit is contained in:
@@ -1147,7 +1147,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkConnectPreferredIP(c *check.C) {
|
||||
|
||||
func (s *DockerNetworkSuite) TestDockerNetworkUnsupportedPreferredIP(c *check.C) {
|
||||
// preferred IP is not supported on predefined networks
|
||||
for _, mode := range []string{"none", "host", "bridge"} {
|
||||
for _, mode := range []string{"none", "host", "bridge", "default"} {
|
||||
checkUnsupportedNetworkAndIP(c, mode)
|
||||
}
|
||||
|
||||
@@ -1300,6 +1300,16 @@ func (s *DockerSuite) TestUserDefinedNetworkConnectDisconnectAlias(c *check.C) {
|
||||
// ping to net2 scoped alias "bar" must still succeed
|
||||
_, _, err = dockerCmdWithError("exec", "second", "ping", "-c", "1", "bar")
|
||||
c.Assert(err, check.IsNil)
|
||||
|
||||
// verify the alias option is rejected when running on predefined network
|
||||
out, _, err := dockerCmdWithError("run", "--rm", "--name=any", "--net-alias=any", "busybox", "top")
|
||||
c.Assert(err, checker.NotNil, check.Commentf("out: %s", out))
|
||||
c.Assert(out, checker.Contains, runconfig.ErrUnsupportedNetworkAndAlias.Error())
|
||||
|
||||
// verify the alias option is rejected when connecting to predefined network
|
||||
out, _, err = dockerCmdWithError("network", "connect", "--alias=any", "bridge", "first")
|
||||
c.Assert(err, checker.NotNil, check.Commentf("out: %s", out))
|
||||
c.Assert(out, checker.Contains, runconfig.ErrUnsupportedNetworkAndAlias.Error())
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestUserDefinedNetworkConnectivity(c *check.C) {
|
||||
|
||||
Reference in New Issue
Block a user