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) assertDesiredLRPValidationFailsWithMessage(desiredLRP, "annotation") }) Context("when security group is present", func() { It("must be valid", func() { desiredLRP.EgressRules = []*models.SecurityGroupRule{{ Protocol: "foo", }} assertDesiredLRPValidationFailsWithMessage(desiredLRP, "egress_rules") })