Example #1
0
import (
	"github.com/cloudfoundry-incubator/garden"
	"github.com/cloudfoundry-incubator/guardian/gardener"
	"github.com/cloudfoundry-incubator/guardian/gardener/fakes"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	"github.com/onsi/gomega/gbytes"
)

var _ = Describe("Gardener", func() {
	Context("with dummy implementations of the major components", func() {
		var (
			containerizer *fakes.FakeContainerizer
			volumizer     *fakes.FakeVolumizer
			networker     *fakes.FakeNetworker

			gdnr *gardener.Gardener
		)

		BeforeEach(func() {
			containerizer = new(fakes.FakeContainerizer)
			volumizer = new(fakes.FakeVolumizer)
			networker = new(fakes.FakeNetworker)

			volumizer.VolumizeReturns("the-volumized-rootfs-path", nil)

			containerizer.CreateStub = func(spec gardener.DesiredContainerSpec) error {
				return nil
			}
Example #2
0
	"github.com/cloudfoundry-incubator/guardian/gardener"
	"github.com/cloudfoundry-incubator/guardian/gardener/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("Gardener", func() {
	var (
		networker       *fakes.FakeNetworker
		volumeCreator   *fakes.FakeVolumeCreator
		containerizer   *fakes.FakeContainerizer
		uidGenerator    *fakes.FakeUidGenerator
		sysinfoProvider *fakes.FakeSysInfoProvider
		propertyManager *fakes.FakePropertyManager

		logger lager.Logger

		gdnr *gardener.Gardener
	)

	BeforeEach(func() {
		logger = lagertest.NewTestLogger("test")
		containerizer = new(fakes.FakeContainerizer)
		uidGenerator = new(fakes.FakeUidGenerator)
		networker = new(fakes.FakeNetworker)
		volumeCreator = new(fakes.FakeVolumeCreator)
		sysinfoProvider = new(fakes.FakeSysInfoProvider)
		propertyManager = new(fakes.FakePropertyManager)
		gdnr = &gardener.Gardener{
Example #3
0
import (
	"errors"

	"github.com/cloudfoundry-incubator/garden"
	"github.com/cloudfoundry-incubator/guardian/gardener"
	"github.com/cloudfoundry-incubator/guardian/gardener/fakes"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	"github.com/onsi/gomega/gbytes"
)

var _ = Describe("Gardener", func() {
	var (
		networker     *fakes.FakeNetworker
		containerizer *fakes.FakeContainerizer
		uidGenerator  *fakes.FakeUidGenerator

		gdnr *gardener.Gardener
	)

	BeforeEach(func() {
		containerizer = new(fakes.FakeContainerizer)
		uidGenerator = new(fakes.FakeUidGenerator)
		networker = new(fakes.FakeNetworker)
		gdnr = &gardener.Gardener{
			Containerizer: containerizer,
			UidGenerator:  uidGenerator,
			Networker:     networker,
		}
	})