コード例 #1
0
					Guid:     "da-task",
					Resource: executor.NewResource(40, 30, "rootfs"),
					Tags: executor.Tags{
						rep.LifecycleTag: rep.TaskLifecycle,
						rep.DomainTag:    "domain",
					},
				},
				{
					Guid:     "other-task",
					Resource: executor.NewResource(40, 30, "rootfs"),
					Tags:     nil,
				},
			}

			client.TotalResourcesReturns(totalResources, nil)
			client.RemainingResourcesFromReturns(availableResources, nil)
			client.ListContainersReturns(containers, nil)
		})

		It("queries the client and returns state", func() {
			state, err := cellRep.State()
			Expect(err).NotTo(HaveOccurred())

			Expect(client.ListContainersArgsForCall(0)).To(Equal(executor.Tags{}))
			Expect(client.RemainingResourcesFromArgsForCall(0)).To(Equal(containers))

			Expect(state.Evacuating).To(BeTrue())
			Expect(state.RootFSProviders).To(Equal(rep.RootFSProviders{
				models.PreloadedRootFSScheme: rep.NewFixedSetRootFSProvider("linux"),
				"docker":                     rep.ArbitraryRootFSProvider{},
			}))