Exemplo n.º 1
0
					lrps, err := receptorClient.ActualLRPsByProcessGuid(processGuid)
					Expect(err).NotTo(HaveOccurred())

					return lrps
				}).Should(HaveLen(1))

				var actualLRP receptor.ActualLRPResponse
				Eventually(
					helpers.LRPStatePoller(receptorClient, processGuid, &actualLRP),
				).Should(Equal(receptor.ActualLRPStateCrashed))
			})
		})

		Describe("updating routes", func() {
			BeforeEach(func() {
				lrp.Ports = []uint16{8080, 9080}
				lrp.Routes = cfroutes.CFRoutes{{Port: 8080, Hostnames: []string{"lrp-route-8080"}}}.RoutingInfo()

				lrp.Action = &models.RunAction{
					User: "******",
					Path: "/tmp/go-server",
					Env:  []models.EnvironmentVariable{{"PORT", "8080 9080"}},
				}
			})

			It("can not access container ports without routes", func() {
				Eventually(helpers.ResponseCodeFromHostPoller(componentMaker.Addresses.Router, "lrp-route-8080")).Should(Equal(http.StatusOK))
				Consistently(helpers.ResponseCodeFromHostPoller(componentMaker.Addresses.Router, "lrp-route-8080")).Should(Equal(http.StatusOK))
				Consistently(helpers.ResponseCodeFromHostPoller(componentMaker.Addresses.Router, "lrp-route-9080")).Should(Equal(http.StatusNotFound))
			})