예제 #1
0
	bidisk "github.com/cloudfoundry/bosh-init/deployment/disk"
	bideplmanifest "github.com/cloudfoundry/bosh-init/deployment/manifest"
	fakebiui "github.com/cloudfoundry/bosh-init/ui/fakes"
	boshlog "github.com/cloudfoundry/bosh-utils/logger"
	biproperty "github.com/cloudfoundry/bosh-utils/property"
	fakesys "github.com/cloudfoundry/bosh-utils/system/fakes"
	fakeuuid "github.com/cloudfoundry/bosh-utils/uuid/fakes"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("Manager", func() {
	var (
		manager           Manager
		fakeCloud         *fakebicloud.FakeCloud
		fakeFs            *fakesys.FakeFileSystem
		fakeUUIDGenerator *fakeuuid.FakeGenerator
		diskRepo          biconfig.DiskRepo
	)

	BeforeEach(func() {
		logger := boshlog.NewLogger(boshlog.LevelNone)
		fakeFs = fakesys.NewFakeFileSystem()
		fakeUUIDGenerator = &fakeuuid.FakeGenerator{}
		deploymentStateService := biconfig.NewFileSystemDeploymentStateService(fakeFs, fakeUUIDGenerator, logger, "/fake/path")
		diskRepo = biconfig.NewDiskRepo(deploymentStateService, fakeUUIDGenerator)
		managerFactory := NewManagerFactory(diskRepo, logger)
		fakeCloud = fakebicloud.NewFakeCloud()
		manager = managerFactory.NewManager(fakeCloud)
		fakeUUIDGenerator.GeneratedUUID = "fake-uuid"
	})
예제 #2
0
	fakesys "github.com/cloudfoundry/bosh-init/internal/github.com/cloudfoundry/bosh-utils/system/fakes"
	fakeuuid "github.com/cloudfoundry/bosh-init/internal/github.com/cloudfoundry/bosh-utils/uuid/fakes"
	. "github.com/cloudfoundry/bosh-init/internal/github.com/onsi/ginkgo"
	. "github.com/cloudfoundry/bosh-init/internal/github.com/onsi/gomega"
	bistemcell "github.com/cloudfoundry/bosh-init/stemcell"
)

var _ = Describe("Manager", func() {
	var (
		fakeCloud                 *fakebicloud.FakeCloud
		manager                   Manager
		logger                    boshlog.Logger
		expectedNetworkInterfaces map[string]biproperty.Map
		expectedCloudProperties   biproperty.Map
		expectedEnv               biproperty.Map
		deploymentManifest        bideplmanifest.Manifest
		fakeVMRepo                *fakebiconfig.FakeVMRepo
		stemcellRepo              biconfig.StemcellRepo
		fakeDiskDeployer          *fakebivm.FakeDiskDeployer
		fakeAgentClient           *fakebiagentclient.FakeAgentClient
		stemcell                  bistemcell.CloudStemcell
		fs                        *fakesys.FakeFileSystem
	)

	BeforeEach(func() {
		logger = boshlog.NewLogger(boshlog.LevelNone)
		fs = fakesys.NewFakeFileSystem()
		fakeCloud = fakebicloud.NewFakeCloud()
		fakeAgentClient = fakebiagentclient.NewFakeAgentClient()
		fakeVMRepo = fakebiconfig.NewFakeVMRepo()
예제 #3
0
파일: vm_test.go 프로젝트: vestel/bosh-init
	fakebicloud "github.com/cloudfoundry/bosh-init/cloud/fakes"
	fakebiconfig "github.com/cloudfoundry/bosh-init/config/fakes"
	fakebidisk "github.com/cloudfoundry/bosh-init/deployment/disk/fakes"
	fakebivm "github.com/cloudfoundry/bosh-init/deployment/vm/fakes"
	fakebiagentclient "github.com/cloudfoundry/bosh-init/internal/github.com/cloudfoundry/bosh-agent/agentclient/fakes"
	fakebiui "github.com/cloudfoundry/bosh-init/ui/fakes"
)

var _ = Describe("VM", func() {
	var (
		vm               VM
		fakeVMRepo       *fakebiconfig.FakeVMRepo
		fakeStemcellRepo *fakebiconfig.FakeStemcellRepo
		fakeDiskDeployer *fakebivm.FakeDiskDeployer
		fakeAgentClient  *fakebiagentclient.FakeAgentClient
		fakeCloud        *fakebicloud.FakeCloud
		applySpec        bias.ApplySpec
		diskPool         bideplmanifest.DiskPool
		fs               *fakesys.FakeFileSystem
		logger           boshlog.Logger
	)

	BeforeEach(func() {
		fakeAgentClient = fakebiagentclient.NewFakeAgentClient()

		// apply spec is only being passed to the agent client, so it doesn't need much content for testing
		applySpec = bias.ApplySpec{
			Deployment: "fake-deployment-name",
		}

		diskPool = bideplmanifest.DiskPool{
예제 #4
0
	. "github.com/onsi/gomega"

	"errors"

	bicloud "github.com/cloudfoundry/bosh-init/cloud"
	fakebicloud "github.com/cloudfoundry/bosh-init/cloud/fakes"
	biconfig "github.com/cloudfoundry/bosh-init/config"
	boshlog "github.com/cloudfoundry/bosh-utils/logger"
	fakesys "github.com/cloudfoundry/bosh-utils/system/fakes"
	fakeuuid "github.com/cloudfoundry/bosh-utils/uuid/fakes"
)

var _ = Describe("CloudStemcell", func() {
	var (
		stemcellRepo      biconfig.StemcellRepo
		fakeUUIDGenerator *fakeuuid.FakeGenerator
		fakeCloud         *fakebicloud.FakeCloud
		cloudStemcell     CloudStemcell
	)

	BeforeEach(func() {
		stemcellRecord := biconfig.StemcellRecord{
			CID:     "fake-stemcell-cid",
			Name:    "fake-stemcell-name",
			Version: "fake-stemcell-version",
		}
		fs := fakesys.NewFakeFileSystem()
		logger := boshlog.NewLogger(boshlog.LevelNone)
		fakeUUIDGenerator = &fakeuuid.FakeGenerator{}
		deploymentStateService := biconfig.NewFileSystemDeploymentStateService(fs, fakeUUIDGenerator, logger, "/fake/path")
		stemcellRepo = biconfig.NewStemcellRepo(deploymentStateService, fakeUUIDGenerator)
		fakeCloud = fakebicloud.NewFakeCloud()
예제 #5
0
	fakesys "github.com/cloudfoundry/bosh-utils/system/fakes"
	fakeuuid "github.com/cloudfoundry/bosh-utils/uuid/fakes"

	fakebicloud "github.com/cloudfoundry/bosh-init/cloud/fakes"
	fakebistemcell "github.com/cloudfoundry/bosh-init/stemcell/fakes"
	fakebiui "github.com/cloudfoundry/bosh-init/ui/fakes"
)

var _ = Describe("Manager", func() {
	var (
		stemcellRepo        biconfig.StemcellRepo
		fakeUUIDGenerator   *fakeuuid.FakeGenerator
		manager             Manager
		fs                  *fakesys.FakeFileSystem
		reader              *fakebistemcell.FakeStemcellReader
		fakeCloud           *fakebicloud.FakeCloud
		fakeStage           *fakebiui.FakeStage
		stemcellTarballPath string
		tempExtractionDir   string

		expectedExtractedStemcell ExtractedStemcell
	)

	BeforeEach(func() {
		fs = fakesys.NewFakeFileSystem()
		reader = fakebistemcell.NewFakeReader()
		logger := boshlog.NewLogger(boshlog.LevelNone)
		fakeUUIDGenerator = &fakeuuid.FakeGenerator{}
		deploymentStateService := biconfig.NewFileSystemDeploymentStateService(fs, fakeUUIDGenerator, logger, "/fake/path")
		fakeUUIDGenerator.GeneratedUUID = "fake-stemcell-id-1"
		stemcellRepo = biconfig.NewStemcellRepo(deploymentStateService, fakeUUIDGenerator)
예제 #6
0
	biconfig "github.com/cloudfoundry/bosh-init/config"
	boshlog "github.com/cloudfoundry/bosh-utils/logger"
	biproperty "github.com/cloudfoundry/bosh-utils/property"
	fakesys "github.com/cloudfoundry/bosh-utils/system/fakes"
	fakeuuid "github.com/cloudfoundry/bosh-utils/uuid/fakes"

	fakebicloud "github.com/cloudfoundry/bosh-init/cloud/fakes"

	. "github.com/cloudfoundry/bosh-init/deployment/disk"
)

var _ = Describe("Disk", func() {
	var (
		disk                Disk
		diskCloudProperties biproperty.Map
		fakeCloud           *fakebicloud.FakeCloud
		diskRepo            biconfig.DiskRepo
		fakeUUIDGenerator   *fakeuuid.FakeGenerator
	)

	BeforeEach(func() {
		diskCloudProperties = biproperty.Map{
			"fake-cloud-property-key": "fake-cloud-property-value",
		}
		fakeCloud = fakebicloud.NewFakeCloud()

		diskRecord := biconfig.DiskRecord{
			CID:             "fake-disk-cid",
			Size:            1024,
			CloudProperties: diskCloudProperties,
		}