mirror of
https://github.com/moby/moby.git
synced 2025-07-29 07:21:35 +03:00
Remove most of the runCommandWithOutput from integration tests
There is 5 calls left, that use StdinPipe that is not yet supported by icmd. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
@ -146,11 +146,8 @@ func (s *DockerSuite) TestLinksHostsFilesInject(c *check.C) {
|
||||
|
||||
c.Assert(waitRun(idTwo), checker.IsNil)
|
||||
|
||||
contentOne, err := readContainerFileWithExec(idOne, "/etc/hosts")
|
||||
c.Assert(err, checker.IsNil, check.Commentf("contentOne: %s", string(contentOne)))
|
||||
|
||||
contentTwo, err := readContainerFileWithExec(idTwo, "/etc/hosts")
|
||||
c.Assert(err, checker.IsNil, check.Commentf("contentTwo: %s", string(contentTwo)))
|
||||
readContainerFileWithExec(c, idOne, "/etc/hosts")
|
||||
contentTwo := readContainerFileWithExec(c, idTwo, "/etc/hosts")
|
||||
// Host is not present in updated hosts file
|
||||
c.Assert(string(contentTwo), checker.Contains, "onetwo")
|
||||
}
|
||||
@ -163,8 +160,7 @@ func (s *DockerSuite) TestLinksUpdateOnRestart(c *check.C) {
|
||||
id := strings.TrimSpace(string(out))
|
||||
|
||||
realIP := inspectField(c, "one", "NetworkSettings.Networks.bridge.IPAddress")
|
||||
content, err := readContainerFileWithExec(id, "/etc/hosts")
|
||||
c.Assert(err, checker.IsNil)
|
||||
content := readContainerFileWithExec(c, id, "/etc/hosts")
|
||||
|
||||
getIP := func(hosts []byte, hostname string) string {
|
||||
re := regexp.MustCompile(fmt.Sprintf(`(\S*)\t%s`, regexp.QuoteMeta(hostname)))
|
||||
@ -181,8 +177,7 @@ func (s *DockerSuite) TestLinksUpdateOnRestart(c *check.C) {
|
||||
dockerCmd(c, "restart", "one")
|
||||
realIP = inspectField(c, "one", "NetworkSettings.Networks.bridge.IPAddress")
|
||||
|
||||
content, err = readContainerFileWithExec(id, "/etc/hosts")
|
||||
c.Assert(err, checker.IsNil, check.Commentf("content: %s", string(content)))
|
||||
content = readContainerFileWithExec(c, id, "/etc/hosts")
|
||||
ip = getIP(content, "one")
|
||||
c.Assert(ip, checker.Equals, realIP)
|
||||
|
||||
|
Reference in New Issue
Block a user