} 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("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") }) }) Context("when security group is not present", func() { It("does not error", func() { desiredLRP.EgressRules = []*models.SecurityGroupRule{}