c1b52448 |
// +build !windows
package main
import (
"io/ioutil"
"os"
|
97b9223a |
"github.com/docker/docker/pkg/integration/checker" |
c1b52448 |
"github.com/go-check/check"
)
func (s *DockerSuite) TestLinksEtcHostsContentMatch(c *check.C) { |
4fccf8ad |
// In a _unix file as using Unix specific files, and must be on the
// same host as the daemon. |
ea3afdad |
testRequires(c, SameHostDaemon, NotUserNamespace) |
c1b52448 |
|
eef6eda7 |
out, _ := dockerCmd(c, "run", "--net=host", "busybox", "cat", "/etc/hosts") |
c1b52448 |
hosts, err := ioutil.ReadFile("/etc/hosts")
if os.IsNotExist(err) {
c.Skip("/etc/hosts does not exist, skip this test")
}
|
97b9223a |
c.Assert(out, checker.Equals, string(hosts), check.Commentf("container: %s\n\nhost:%s", out, hosts)) |
c1b52448 |
} |