Example #1
0
				})
			})

			Context("when the ActualLrpKey is invalid", func() {
				BeforeEach(func() {
					request.ActualLrpKey.ProcessGuid = ""
				})

				It("returns a validation error", func() {
					Expect(request.Validate()).To(ConsistOf(models.ErrInvalidField{"process_guid"}))
				})
			})

			Context("when the ActualLrpInstanceKey is blank", func() {
				BeforeEach(func() {
					request.ActualLrpInstanceKey = nil
				})

				It("returns a validation error", func() {
					Expect(request.Validate()).To(ConsistOf(models.ErrInvalidField{"actual_lrp_instance_key"}))
				})
			})

			Context("when the ActualLrpInstanceKey is invalid", func() {
				BeforeEach(func() {
					request.ActualLrpInstanceKey.InstanceGuid = ""
				})

				It("returns a validation error", func() {
					Expect(request.Validate()).To(ConsistOf(models.ErrInvalidField{"instance_guid"}))
				})
Example #2
0
	})

	Describe("StartActualLRP", func() {
		var (
			startErr         *models.Error
			request          models.StartActualLRPRequest
			startedActualLRP *models.ActualLRP

			lrpKey      models.ActualLRPKey
			instanceKey models.ActualLRPInstanceKey
			netInfo     models.ActualLRPNetInfo
		)

		JustBeforeEach(func() {
			request.ActualLrpKey = &lrpKey
			request.ActualLrpInstanceKey = &instanceKey
			request.ActualLrpNetInfo = &netInfo
			startedActualLRP, startErr = etcdDB.StartActualLRP(logger, &request)
		})

		Context("when the actual LRP exists", func() {
			var (
				processGuid string
				index       int32
				actualLRP   *models.ActualLRP
			)

			BeforeEach(func() {
				index = 1
				processGuid = "some-process-guid"
				key := models.NewActualLRPKey(processGuid, index, "domain")