Fix missing hostname and links in exec env

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: e98145960988a2259074ae911b6478b7a940748b
Component: engine
This commit is contained in:
Tonis Tiigi
2016-09-28 15:21:33 -07:00
parent 200598ef34
commit 3616bb2973
7 changed files with 19 additions and 17 deletions

View File

@ -520,3 +520,12 @@ func (s *DockerSuite) TestExecWindowsPathNotWiped(c *check.C) {
out = strings.ToLower(strings.Trim(out, "\r\n"))
c.Assert(out, checker.Contains, `windowspowershell\v1.0`)
}
func (s *DockerSuite) TestExecEnvLinksHost(c *check.C) {
testRequires(c, DaemonIsLinux)
runSleepingContainer(c, "-d", "--name", "foo")
runSleepingContainer(c, "-d", "--link", "foo:db", "--hostname", "myhost", "--name", "bar")
out, _ := dockerCmd(c, "exec", "bar", "env")
c.Assert(out, checker.Contains, "HOSTNAME=myhost")
c.Assert(out, checker.Contains, "DB_NAME=/bar/db")
}