Ejemplo n.º 1
0
			"/rootfs/path",
			fakeUIDPool,
			fakeNetworkPool,
			fakePortPool,
			[]string{"1.1.0.0/16", "2.2.0.0/16"},
			[]string{"1.1.1.1/32", "2.2.2.2/32"},
			fakeRunner,
			fakeQuotaManager,
		)
	})

	Describe("MaxContainer", func() {
		Context("when constrained by network pool size", func() {
			BeforeEach(func() {
				fakeNetworkPool.InitialPoolSize = 5
				fakeUIDPool.InitialPoolSize = 3000
			})

			It("returns the network pool size", func() {
				Ω(pool.MaxContainers()).Should(Equal(5))
			})
		})
		Context("when constrained by uid pool size", func() {
			BeforeEach(func() {
				fakeNetworkPool.InitialPoolSize = 666
				fakeUIDPool.InitialPoolSize = 42
			})

			It("returns the uid pool size", func() {
				Ω(pool.MaxContainers()).Should(Equal(42))
			})