1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Vendoring in libnetwork to fix #13873.

Libnetwork sha# e578e95aa101441481411ff1d620f343895f24fe

Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit f3d1826350)
This commit is contained in:
Madhu Venugopal 2015-06-11 18:04:03 -07:00 committed by Jessica Frazelle
parent 469534c855
commit 7ffbd7eaee
4 changed files with 39 additions and 9 deletions

View file

@ -98,3 +98,20 @@ func (s *DockerSuite) TestNetworkLocalhostTCPNat(c *check.C) {
c.Fatalf("Expected message %q but received %q", msg, final)
}
}
func (s *DockerSuite) TestNetworkLoopbackNat(c *check.C) {
testRequires(c, SameHostDaemon, NativeExecDriver)
msg := "it works"
startServerContainer(c, msg, 8080)
endpoint := getExternalAddress(c)
runCmd := exec.Command(dockerBinary, "run", "-t", "--net=container:server", "busybox",
"sh", "-c", fmt.Sprintf("stty raw && nc -w 5 %s 8080", endpoint.String()))
out, _, err := runCommandWithOutput(runCmd)
if err != nil {
c.Fatal(out, err)
}
final := strings.TrimRight(string(out), "\n")
if final != msg {
c.Fatalf("Expected message %q but received %q", msg, final)
}
}