"domain-0",
			),
			models.NewActualLRPInstanceKey(
				"instance-guid-0",
				"cell-id-0",
			),
			models.NewActualLRPNetInfo("1.1.1.1", models.NewPortMapping(80, 5050)),
			1138,
		)

		actualLRP2 = models.NewClaimedActualLRP(
			models.NewActualLRPKey(
				"process-guid-1",
				2,
				"domain-1",
			),
			models.NewActualLRPInstanceKey(
				"instance-guid-1",
				"cell-id-1",
			),
			4444,
		)

		evacuatingLRP2 = models.NewRunningActualLRP(
			models.NewActualLRPKey(
				"process-guid-1",
				2,
				"domain-1",
			),
			models.NewActualLRPInstanceKey(
				"instance-guid-1",
				"cell-id-1",
Example #2
0
		It("removes the evacuating actual_lrp", func() {
			err := client.RemoveEvacuatingActualLRP(&actual.ActualLRPKey, &actual.ActualLRPInstanceKey)
			Expect(err).NotTo(HaveOccurred())

			group, err := client.ActualLRPGroupByProcessGuidAndIndex(actual.ProcessGuid, int(actual.Index))
			Expect(err).ToNot(HaveOccurred())
			Expect(group.Evacuating).To(BeNil())
		})
	})

	Describe("EvacuateClaimedActualLRP", func() {
		var actual *models.ActualLRP

		BeforeEach(func() {
			actual = model_helpers.NewValidActualLRP("some-process-guid", 1)
			actual = models.NewClaimedActualLRP(actual.ActualLRPKey, actual.ActualLRPInstanceKey, actual.Since)
			etcdHelper.SetRawActualLRP(actual)
			etcdHelper.CreateValidDesiredLRP(actual.ProcessGuid)
		})

		It("removes the claimed actual_lrp without evacuating", func() {
			keepContainer, evacuateErr := client.EvacuateClaimedActualLRP(&actual.ActualLRPKey, &actual.ActualLRPInstanceKey)
			Expect(keepContainer).To(BeFalse())
			Expect(evacuateErr).NotTo(HaveOccurred())

			actualLRPGroup, err := client.ActualLRPGroupByProcessGuidAndIndex(actual.ProcessGuid, int(actual.Index))
			Expect(err).NotTo(HaveOccurred())
			Expect(actualLRPGroup.Evacuating).To(BeNil())
			Expect(actualLRPGroup.Instance).NotTo(BeNil())
			Expect(actualLRPGroup.Instance.State).To(Equal(models.ActualLRPStateUnclaimed))
		})