Пример #1
0
			)
		})

		It("creates a task", func() {
			err := taskRunner.CreateTask(createTaskParams)

			Expect(err).NotTo(HaveOccurred())

			Expect(fakeReceptorClient.TasksCallCount()).To(Equal(1))

			Expect(fakeReceptorClient.UpsertDomainCallCount()).To(Equal(1))
			domain, ttl := fakeReceptorClient.UpsertDomainArgsForCall(0)
			Expect(domain).To(Equal("lattice"))
			Expect(ttl).To(BeZero())

			Expect(fakeReceptorClient.CreateTaskCallCount()).To(Equal(1))
			createTaskRequest := fakeReceptorClient.CreateTaskArgsForCall(0)
			Expect(createTaskRequest).ToNot(BeNil())
			Expect(createTaskRequest.Action).To(Equal(action))
			Expect(createTaskRequest.TaskGuid).To(Equal("task-name"))
			Expect(createTaskRequest.LogGuid).To(Equal("task-name"))
			Expect(createTaskRequest.MetricsGuid).To(Equal("task-name"))
			Expect(createTaskRequest.RootFS).To(Equal("preloaded:my-rootfs"))
			Expect(createTaskRequest.Domain).To(Equal("task-domain"))
			Expect(createTaskRequest.LogSource).To(Equal("log-source"))
			Expect(createTaskRequest.EnvironmentVariables).To(ConsistOf(
				receptor.EnvironmentVariable{"MaRTY", "BiSHoP"},
				receptor.EnvironmentVariable{"CoSMo", "CRaMeR"},
			))
			Expect(createTaskRequest.EgressRules).To(Equal(securityGroupRules))
		})