Example #1
0
		It("requires a valid monitor action if specified", func() {
			desiredLRP.Monitor = &models.Action{
				UploadAction: &models.UploadAction{
					From: "web_location",
				},
			}
			assertDesiredLRPValidationFailsWithMessage(desiredLRP, "to")
		})

		It("requires a monitor action with an inner action", func() {
			desiredLRP.Monitor = &models.Action{}
			assertDesiredLRPValidationFailsWithMessage(desiredLRP, "monitor")
		})

		It("requires a valid CPU weight", func() {
			desiredLRP.CpuWeight = 101
			assertDesiredLRPValidationFailsWithMessage(desiredLRP, "cpu_weight")
		})

		It("requires a valid MemoryMb", func() {
			desiredLRP.MemoryMb = -1
			assertDesiredLRPValidationFailsWithMessage(desiredLRP, "memory_mb")
		})

		It("requires a valid DiskMb", func() {
			desiredLRP.DiskMb = -1
			assertDesiredLRPValidationFailsWithMessage(desiredLRP, "disk_mb")
		})

		It("limits the annotation length", func() {
			desiredLRP.Annotation = randStringBytes(50000)