mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Update integration tests with --net flag
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
parent
973fae9d75
commit
581e8e8918
1 changed files with 5 additions and 5 deletions
|
@ -251,13 +251,13 @@ func TestDockerRunWorkingDirectory(t *testing.T) {
|
|||
|
||||
// pinging Google's DNS resolver should fail when we disable the networking
|
||||
func TestDockerRunWithoutNetworking(t *testing.T) {
|
||||
runCmd := exec.Command(dockerBinary, "run", "--networking=false", "busybox", "ping", "-c", "1", "8.8.8.8")
|
||||
runCmd := exec.Command(dockerBinary, "run", "--net=none", "busybox", "ping", "-c", "1", "8.8.8.8")
|
||||
out, _, exitCode, err := runCommandWithStdoutStderr(runCmd)
|
||||
if err != nil && exitCode != 1 {
|
||||
t.Fatal(out, err)
|
||||
}
|
||||
if exitCode != 1 {
|
||||
t.Errorf("--networking=false should've disabled the network; the container shouldn't have been able to ping 8.8.8.8")
|
||||
t.Errorf("--net=none should've disabled the network; the container shouldn't have been able to ping 8.8.8.8")
|
||||
}
|
||||
|
||||
runCmd = exec.Command(dockerBinary, "run", "-n=false", "busybox", "ping", "-c", "1", "8.8.8.8")
|
||||
|
@ -271,7 +271,7 @@ func TestDockerRunWithoutNetworking(t *testing.T) {
|
|||
|
||||
deleteAllContainers()
|
||||
|
||||
logDone("run - disable networking with --networking=false")
|
||||
logDone("run - disable networking with --net=none")
|
||||
logDone("run - disable networking with -n=false")
|
||||
}
|
||||
|
||||
|
@ -678,7 +678,7 @@ func TestContainerNetwork(t *testing.T) {
|
|||
|
||||
// Issue #4681
|
||||
func TestLoopbackWhenNetworkDisabled(t *testing.T) {
|
||||
cmd := exec.Command(dockerBinary, "run", "--networking=false", "busybox", "ping", "-c", "1", "127.0.0.1")
|
||||
cmd := exec.Command(dockerBinary, "run", "--net=none", "busybox", "ping", "-c", "1", "127.0.0.1")
|
||||
if _, err := runCommand(cmd); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
@ -689,7 +689,7 @@ func TestLoopbackWhenNetworkDisabled(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestLoopbackOnlyExistsWhenNetworkingDisabled(t *testing.T) {
|
||||
cmd := exec.Command(dockerBinary, "run", "--networking=false", "busybox", "ip", "a", "show", "up")
|
||||
cmd := exec.Command(dockerBinary, "run", "--net=none", "busybox", "ip", "a", "show", "up")
|
||||
out, _, err := runCommandWithOutput(cmd)
|
||||
if err != nil {
|
||||
t.Fatal(err, out)
|
||||
|
|
Loading…
Add table
Reference in a new issue