Expect(runAction.Env).To(ContainElement(&models.EnvironmentVariable{
					Name:  "PORT",
					Value: "8080",
				}))

				Expect(desiredLRP.EgressRules).To(ConsistOf(egressRules))
			})

			Context("when route service url is specified in RoutingInfo", func() {
				BeforeEach(func() {
					routingInfo, err := cc_messages.CCHTTPRoutes{
						{Hostname: "route1"},
						{Hostname: "route2", RouteServiceUrl: "https://rs.example.com"},
					}.CCRouteInfo()
					Expect(err).NotTo(HaveOccurred())
					desiredAppReq.RoutingInfo = routingInfo
				})

				It("sets up routes with the route service url", func() {
					routes := *desiredLRP.Routes
					cfRoutesJson := routes[cfroutes.CF_ROUTER]
					cfRoutes := cfroutes.CFRoutes{}

					err := json.Unmarshal(*cfRoutesJson, &cfRoutes)
					Expect(err).ToNot(HaveOccurred())

					Expect(cfRoutes).To(ConsistOf([]cfroutes.CFRoute{
						{Hostnames: []string{"route1"}, Port: 8080},
						{Hostnames: []string{"route2"}, Port: 8080, RouteServiceUrl: "https://rs.example.com"},
					}))
				})
Пример #2
0
			Expect(buildpackBuilder.ExtractExposedPortsCallCount()).To(Equal(1))

			Expect(buildpackBuilder.ExtractExposedPortsArgsForCall(0)).To(Equal(&desireAppRequest))
		})

		Context("when multiple routes with same route service are sent", func() {
			var routesToEmit cfroutes.CFRoutes
			BeforeEach(func() {
				routingInfo, err := cc_messages.CCHTTPRoutes{
					{Hostname: "route1", RouteServiceUrl: "https://rs.example.com"},
					{Hostname: "route2", RouteServiceUrl: "https://rs.example.com"},
					{Hostname: "route3"},
				}.CCRouteInfo()
				Expect(err).NotTo(HaveOccurred())

				desireAppRequest.RoutingInfo = routingInfo
			})

			It("aggregates the http routes with the same route service url", func() {
				routesToEmit = cfroutes.CFRoutes{
					{Hostnames: []string{"route1", "route2"}, Port: 8080, RouteServiceUrl: "https://rs.example.com"},
					{Hostnames: []string{"route3"}, Port: 8080},
				}
				opaqueRoutingDataCheck(routesToEmit)
			})
		})

		Context("when multiple routes with different route service are sent", func() {
			var routesToEmit cfroutes.CFRoutes
			BeforeEach(func() {
				routingInfo, err := cc_messages.CCHTTPRoutes{