Beispiel #1
0
					Expect(err).To(MatchError(rep.ErrorIncompatibleRootfs))
				})
			})
		})
	})

	Describe("ReserveLRP", func() {
		Context("when there is room for the LRP", func() {
			It("should register its resources usage and keep it in mind when handling future requests", func() {
				instance := BuildLRP("pg-test", "domain", 0, linuxRootFSURL, 10, 10)
				instanceToAdd := BuildLRP("pg-new", "domain", 0, linuxRootFSURL, 10, 10)

				initialScore, err := cell.ScoreForLRP(instance, 0.0)
				Expect(err).NotTo(HaveOccurred())

				Expect(cell.ReserveLRP(instanceToAdd)).To(Succeed())

				subsequentScore, err := cell.ScoreForLRP(instance, 0.0)
				Expect(err).NotTo(HaveOccurred())
				Expect(initialScore).To(BeNumerically("<", subsequentScore), "the score should have gotten worse")
			})

			It("should register the LRP and keep it in mind when handling future requests", func() {
				instance := BuildLRP("pg-test", "domain", 0, linuxRootFSURL, 10, 10)
				instanceWithMatchingProcessGuid := BuildLRP("pg-new", "domain", 1, linuxRootFSURL, 10, 10)
				instanceToAdd := BuildLRP("pg-new", "domain", 0, linuxRootFSURL, 10, 10)

				initialScore, err := cell.ScoreForLRP(instance, 0.0)
				Expect(err).NotTo(HaveOccurred())

				initialScoreForInstanceWithMatchingProcessGuid, err := cell.ScoreForLRP(instanceWithMatchingProcessGuid, 0.0)