예제 #1
0
	"github.com/cloudfoundry-incubator/garden"
	"github.com/cloudfoundry-incubator/garden-linux/container_repository"
	"github.com/cloudfoundry-incubator/garden-linux/linux_backend"
	"github.com/cloudfoundry-incubator/garden-linux/linux_backend/fakes"
	"github.com/cloudfoundry-incubator/garden-linux/sysinfo/fake_system_info"
)

var _ = Describe("LinuxBackend", func() {
	var logger *lagertest.TestLogger

	var fakeResourcePool *fakes.FakeResourcePool
	var fakeSystemInfo *fake_system_info.FakeProvider
	var fakeContainerProvider *fakes.FakeContainerProvider
	var containerRepo linux_backend.ContainerRepository
	var linuxBackend *linux_backend.LinuxBackend
	var snapshotsPath string
	var maxContainers int
	var fakeContainers map[string]*fakes.FakeContainer

	newTestContainer := func(spec linux_backend.LinuxContainerSpec) *fakes.FakeContainer {
		container := new(fakes.FakeContainer)
		container.HandleReturns(spec.Handle)
		container.GraceTimeReturns(spec.GraceTime)

		if spec.ID == "" {
			spec.ID = spec.Handle
		}

		container.IDReturns(spec.ID)