コード例 #1
0
	"github.com/cloudfoundry-incubator/garden/warden"
	"github.com/cloudfoundry-incubator/warden-linux/linux_backend"
	"github.com/cloudfoundry-incubator/warden-linux/linux_backend/container_pool"
	"github.com/cloudfoundry-incubator/warden-linux/linux_backend/network"
	"github.com/cloudfoundry-incubator/warden-linux/linux_backend/network_pool/fake_network_pool"
	"github.com/cloudfoundry-incubator/warden-linux/linux_backend/port_pool/fake_port_pool"
	"github.com/cloudfoundry-incubator/warden-linux/linux_backend/quota_manager/fake_quota_manager"
	"github.com/cloudfoundry-incubator/warden-linux/linux_backend/uid_pool/fake_uid_pool"
	"github.com/cloudfoundry/gunk/command_runner/fake_command_runner"
	. "github.com/cloudfoundry/gunk/command_runner/fake_command_runner/matchers"
)

var _ = Describe("Container pool", func() {
	var fakeRunner *fake_command_runner.FakeCommandRunner
	var fakeUIDPool *fake_uid_pool.FakeUIDPool
	var fakeNetworkPool *fake_network_pool.FakeNetworkPool
	var fakeQuotaManager *fake_quota_manager.FakeQuotaManager
	var fakePortPool *fake_port_pool.FakePortPool
	var pool *container_pool.LinuxContainerPool

	BeforeEach(func() {
		_, ipNet, err := net.ParseCIDR("1.2.0.0/20")
		Expect(err).ToNot(HaveOccurred())

		fakeUIDPool = fake_uid_pool.New(10000)

		fakeNetworkPool = fake_network_pool.New(ipNet)
		fakeRunner = fake_command_runner.New()
		fakeQuotaManager = fake_quota_manager.New()
		fakePortPool = fake_port_pool.New(1000)
コード例 #2
0
	"github.com/cloudfoundry-incubator/warden-linux/linux_backend/network"
	"github.com/cloudfoundry-incubator/warden-linux/linux_backend/network_pool/fake_network_pool"
	"github.com/cloudfoundry-incubator/warden-linux/linux_backend/port_pool/fake_port_pool"
	"github.com/cloudfoundry-incubator/warden-linux/linux_backend/quota_manager/fake_quota_manager"
	"github.com/cloudfoundry-incubator/warden-linux/linux_backend/uid_pool/fake_uid_pool"
	"github.com/cloudfoundry/gunk/command_runner/fake_command_runner"
	. "github.com/cloudfoundry/gunk/command_runner/fake_command_runner/matchers"

	"github.com/vito/warden-docker/container_pool"
	"github.com/vito/warden-docker/container_pool/fake_graph_driver"
	"github.com/vito/warden-docker/container_pool/repository_fetcher/fake_repository_fetcher"
)

var _ = Describe("Container pool", func() {
	var fakeRunner *fake_command_runner.FakeCommandRunner
	var fakeUIDPool *fake_uid_pool.FakeUIDPool
	var fakeNetworkPool *fake_network_pool.FakeNetworkPool
	var fakeQuotaManager *fake_quota_manager.FakeQuotaManager
	var fakePortPool *fake_port_pool.FakePortPool
	var fakeRepositoryFetcher *fake_repository_fetcher.FakeRepositoryFetcher
	var fakeGraphDriver *fake_graph_driver.FakeGraphDriver
	var pool *container_pool.LinuxContainerPool

	BeforeEach(func() {
		_, ipNet, err := net.ParseCIDR("1.2.0.0/20")
		Expect(err).ToNot(HaveOccurred())

		fakeRepositoryFetcher = fake_repository_fetcher.New()
		fakeGraphDriver = fake_graph_driver.New()
		fakeUIDPool = fake_uid_pool.New(10000)
		fakeNetworkPool = fake_network_pool.New(ipNet)