|
@@ -3384,17 +3384,17 @@ func (s *DockerSuite) TestRunContainerNetModeWithDnsMacHosts(c *check.C) {
|
|
}
|
|
}
|
|
|
|
|
|
out, _, err = dockerCmdWithError("run", "--dns", "1.2.3.4", "--net=container:parent", "busybox")
|
|
out, _, err = dockerCmdWithError("run", "--dns", "1.2.3.4", "--net=container:parent", "busybox")
|
|
- if err == nil || !strings.Contains(out, "Conflicting options: --dns and the network mode") {
|
|
|
|
|
|
+ if err == nil || !strings.Contains(out, runconfig.ErrConflictNetworkAndDNS.Error()) {
|
|
c.Fatalf("run --net=container with --dns should error out")
|
|
c.Fatalf("run --net=container with --dns should error out")
|
|
}
|
|
}
|
|
|
|
|
|
out, _, err = dockerCmdWithError("run", "--mac-address", "92:d0:c6:0a:29:33", "--net=container:parent", "busybox")
|
|
out, _, err = dockerCmdWithError("run", "--mac-address", "92:d0:c6:0a:29:33", "--net=container:parent", "busybox")
|
|
- if err == nil || !strings.Contains(out, "--mac-address and the network mode") {
|
|
|
|
|
|
+ if err == nil || !strings.Contains(out, runconfig.ErrConflictContainerNetworkAndMac.Error()) {
|
|
c.Fatalf("run --net=container with --mac-address should error out")
|
|
c.Fatalf("run --net=container with --mac-address should error out")
|
|
}
|
|
}
|
|
|
|
|
|
out, _, err = dockerCmdWithError("run", "--add-host", "test:192.168.2.109", "--net=container:parent", "busybox")
|
|
out, _, err = dockerCmdWithError("run", "--add-host", "test:192.168.2.109", "--net=container:parent", "busybox")
|
|
- if err == nil || !strings.Contains(out, "--add-host and the network mode") {
|
|
|
|
|
|
+ if err == nil || !strings.Contains(out, runconfig.ErrConflictNetworkHosts.Error()) {
|
|
c.Fatalf("run --net=container with --add-host should error out")
|
|
c.Fatalf("run --net=container with --add-host should error out")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -3405,17 +3405,17 @@ func (s *DockerSuite) TestRunContainerNetModeWithExposePort(c *check.C) {
|
|
dockerCmd(c, "run", "-d", "--name", "parent", "busybox", "top")
|
|
dockerCmd(c, "run", "-d", "--name", "parent", "busybox", "top")
|
|
|
|
|
|
out, _, err := dockerCmdWithError("run", "-p", "5000:5000", "--net=container:parent", "busybox")
|
|
out, _, err := dockerCmdWithError("run", "-p", "5000:5000", "--net=container:parent", "busybox")
|
|
- if err == nil || !strings.Contains(out, "Conflicting options: -p, -P, --publish-all, --publish and the network mode (--net)") {
|
|
|
|
|
|
+ if err == nil || !strings.Contains(out, runconfig.ErrConflictNetworkPublishPorts.Error()) {
|
|
c.Fatalf("run --net=container with -p should error out")
|
|
c.Fatalf("run --net=container with -p should error out")
|
|
}
|
|
}
|
|
|
|
|
|
out, _, err = dockerCmdWithError("run", "-P", "--net=container:parent", "busybox")
|
|
out, _, err = dockerCmdWithError("run", "-P", "--net=container:parent", "busybox")
|
|
- if err == nil || !strings.Contains(out, "Conflicting options: -p, -P, --publish-all, --publish and the network mode (--net)") {
|
|
|
|
|
|
+ if err == nil || !strings.Contains(out, runconfig.ErrConflictNetworkPublishPorts.Error()) {
|
|
c.Fatalf("run --net=container with -P should error out")
|
|
c.Fatalf("run --net=container with -P should error out")
|
|
}
|
|
}
|
|
|
|
|
|
out, _, err = dockerCmdWithError("run", "--expose", "5000", "--net=container:parent", "busybox")
|
|
out, _, err = dockerCmdWithError("run", "--expose", "5000", "--net=container:parent", "busybox")
|
|
- if err == nil || !strings.Contains(out, "Conflicting options: --expose and the network mode (--net)") {
|
|
|
|
|
|
+ if err == nil || !strings.Contains(out, runconfig.ErrConflictNetworkExposePorts.Error()) {
|
|
c.Fatalf("run --net=container with --expose should error out")
|
|
c.Fatalf("run --net=container with --expose should error out")
|
|
}
|
|
}
|
|
}
|
|
}
|