コード例 #1
0
					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{},
			}))

			Expect(state.AvailableResources).To(Equal(rep.Resources{
				MemoryMB:   int32(availableResources.MemoryMB),
				DiskMB:     int32(availableResources.DiskMB),
				Containers: availableResources.Containers,
			}))

			Expect(state.TotalResources).To(Equal(rep.Resources{
				MemoryMB:   int32(totalResources.MemoryMB),