Exemplo n.º 1
0
	"github.com/cloudfoundry-incubator/guardian/rundmc"
	"github.com/cloudfoundry-incubator/guardian/rundmc/fakes"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	"github.com/onsi/gomega/gbytes"
	"github.com/pivotal-golang/lager"
	"github.com/pivotal-golang/lager/lagertest"
)

var _ = Describe("Rundmc", func() {
	var (
		fakeDepot           *fakes.FakeDepot
		fakeBundler         *fakes.FakeBundler
		fakeContainerRunner *fakes.FakeBundleRunner
		fakeStartChecker    *fakes.FakeChecker
		fakeNstarRunner     *fakes.FakeNstarRunner
		fakeStater          *fakes.FakeContainerStater
		logger              lager.Logger

		containerizer *rundmc.Containerizer
	)

	BeforeEach(func() {
		fakeDepot = new(fakes.FakeDepot)
		fakeContainerRunner = new(fakes.FakeBundleRunner)
		fakeStartChecker = new(fakes.FakeChecker)
		fakeBundler = new(fakes.FakeBundler)
		fakeNstarRunner = new(fakes.FakeNstarRunner)
		fakeStater = new(fakes.FakeContainerStater)
		logger = lagertest.NewTestLogger("test")
Exemplo n.º 2
0
import (
	"github.com/cloudfoundry-incubator/garden"
	"github.com/cloudfoundry-incubator/guardian/gardener"
	"github.com/cloudfoundry-incubator/guardian/rundmc"
	"github.com/cloudfoundry-incubator/guardian/rundmc/fakes"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	"github.com/onsi/gomega/gbytes"
)

var _ = Describe("Creating a container", func() {
	var (
		fakeRepo *fakes.FakeRepo

		czr *rundmc.Containerizer
	)

	BeforeEach(func() {
		fakeRepo = new(fakes.FakeRepo)
		czr = &rundmc.Containerizer{
			Repo: fakeRepo,
		}
	})

	It("delegates creation to the repo", func() {
		spec := gardener.DesiredContainerSpec{Handle: "foo"}
		Expect(czr.Create(spec)).To(Succeed())

		Expect(fakeRepo.CreateCallCount()).To(Equal(1))
Exemplo n.º 3
0
package rundmc_test

import (
	"github.com/cloudfoundry-incubator/guardian/gardener"
	"github.com/cloudfoundry-incubator/guardian/rundmc"
	. "github.com/onsi/ginkgo"
)

var _ = Describe("RunDMC Integration", func() {
	XIt("runs a process in a container", func() {
		containerizer := rundmc.Containerizer{}

		containerizer.Create(gardener.DesiredContainerSpec{
			Handle: "the-handle",
		})
	})
})