diff --git a/integration-cli/docker_cli_daemon_test.go b/integration-cli/docker_cli_daemon_test.go index b3083b4461..1c4d97152e 100644 --- a/integration-cli/docker_cli_daemon_test.go +++ b/integration-cli/docker_cli_daemon_test.go @@ -3,6 +3,7 @@ package main import ( + "bytes" "encoding/json" "fmt" "io/ioutil" @@ -1492,11 +1493,16 @@ func (s *DockerDaemonSuite) TestRunContainerWithBridgeNone(c *check.C) { c.Assert(err, check.IsNil, check.Commentf("Output: %s", out)) c.Assert(strings.Contains(out, "eth0"), check.Equals, false, check.Commentf("There shouldn't be eth0 in container in bridge mode when bridge network is disabled: %s", out)) - + cmd := exec.Command("ip", "l") + stdout := bytes.NewBuffer(nil) + cmd.Stdout = stdout + if err := cmd.Run(); err != nil { + c.Fatal("Failed to get host network interface") + } out, err = s.d.Cmd("run", "--rm", "--net=host", "busybox", "ip", "l") c.Assert(err, check.IsNil, check.Commentf("Output: %s", out)) - c.Assert(strings.Contains(out, "eth0"), check.Equals, true, - check.Commentf("There should be eth0 in container when --net=host when bridge network is disabled: %s", out)) + c.Assert(out, check.Equals, fmt.Sprintf("%s", stdout), + check.Commentf("The network interfaces in container should be the same with host when --net=host when bridge network is disabled: %s", out)) } func (s *DockerDaemonSuite) TestDaemonRestartWithContainerRunning(t *check.C) { @@ -1618,7 +1624,9 @@ func (s *DockerDaemonSuite) TestDaemonCorruptedSyslogAddress(c *check.C) { } func (s *DockerDaemonSuite) TestDaemonWideLogConfig(c *check.C) { - c.Assert(s.d.Start("--log-driver=json-file", "--log-opt=max-size=1k"), check.IsNil) + if err := s.d.StartWithBusybox("--log-driver=json-file", "--log-opt=max-size=1k"); err != nil { + c.Fatal(err) + } out, err := s.d.Cmd("run", "-d", "--name=logtest", "busybox", "top") c.Assert(err, check.IsNil, check.Commentf("Output: %s, err: %v", out, err)) out, err = s.d.Cmd("inspect", "-f", "{{ .HostConfig.LogConfig.Config }}", "logtest")