Esempio n. 1
0
			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("requires a valid MaxPids", func() {
			desiredLRP.MaxPids = -1
			assertDesiredLRPValidationFailsWithMessage(desiredLRP, "max_pids")
		})

		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")
			})