diff --git a/src/router/router_test.go b/src/router/router_test.go index ae9127636..b6c9b9171 100644 --- a/src/router/router_test.go +++ b/src/router/router_test.go @@ -44,6 +44,9 @@ func (s *RouterSuite) SetUpSuite(c *C) { s.Config.Port = s.proxyPort s.Config.Index = 2 + // Hardcode the IP to localhost to avoid leaving the machine while running tests + s.Config.Ip = "127.0.0.1" + s.Config.Status = config.StatusConfig{ Port: statusPort, User: "user", diff --git a/src/router/test/app.go b/src/router/test/app.go index b3dafcef9..363deb8d6 100644 --- a/src/router/test/app.go +++ b/src/router/test/app.go @@ -102,8 +102,6 @@ func (a *TestApp) VerifyTraceHeader(c *C) { var resp *http.Response var err error - routerIP, _ := common.LocalIP() - for _, url := range a.urls { uri := fmt.Sprintf("http://%s:%d", url, a.rPort) @@ -114,7 +112,7 @@ func (a *TestApp) VerifyTraceHeader(c *C) { c.Assert(err, IsNil) c.Check(resp.StatusCode, Equals, 200) c.Check(resp.Header.Get(VcapBackendHeader), Equals, fmt.Sprintf("localhost:%d", a.port)) - c.Check(resp.Header.Get(VcapRouterHeader), Equals, routerIP) + c.Check(resp.Header.Get(VcapRouterHeader), Equals, "127.0.0.1") } }