Exemple #1
0
func (f *factory) loadInstallationParser() biinstallmanifest.Parser {
	if f.installationParser != nil {
		return f.installationParser
	}

	uuidGenerator := boshuuid.NewGenerator()
	f.installationParser = biinstallmanifest.NewParser(f.fs, uuidGenerator, f.logger, f.loadInstallationValidator())
	return f.installationParser
}
			target := biinstall.NewTarget(filepath.Join("fake-install-dir", "fake-installation-id"))
			mockInstallerFactory.EXPECT().NewInstaller(target).Return(mockCpiInstaller).AnyTimes()

			expectCPIInstall = mockCpiInstaller.EXPECT().Install(installationManifest, gomock.Any()).Do(func(_ biinstallmanifest.Manifest, stage biui.Stage) {
				Expect(fakeStage.SubStages).To(ContainElement(stage))
			}).Return(fakeInstallation, nil).AnyTimes()
			mockCpiInstaller.EXPECT().Cleanup(fakeInstallation).AnyTimes()

			expectNewCloud = mockCloudFactory.EXPECT().NewCloud(fakeInstallation, directorID).Return(mockCloud, nil).AnyTimes()
		}

		var newDeploymentDeleter = func() bicmd.DeploymentDeleter {
			releaseSetValidator := birelsetmanifest.NewValidator(logger)
			releaseSetParser := birelsetmanifest.NewParser(fs, logger, releaseSetValidator)
			installationValidator := biinstallmanifest.NewValidator(logger)
			installationParser := biinstallmanifest.NewParser(fs, fakeUUIDGenerator, logger, installationValidator)
			fakeHTTPClient := fakebihttpclient.NewFakeHTTPClient()
			tarballCache := bitarball.NewCache("fake-base-path", fs, logger)
			fakeSHA1Calculator := fakebicrypto.NewFakeSha1Calculator()
			tarballProvider := bitarball.NewProvider(tarballCache, fs, fakeHTTPClient, fakeSHA1Calculator, 1, 0, logger)
			deploymentStateService := biconfig.NewFileSystemDeploymentStateService(fs, fakeUUIDGenerator, logger, biconfig.DeploymentStatePath(deploymentManifestPath))

			cpiInstaller := bicpirel.CpiInstaller{
				ReleaseManager:   releaseManager,
				InstallerFactory: mockInstallerFactory,
				Validator:        bicpirel.NewValidator(),
			}
			releaseFetcher := birel.NewFetcher(tarballProvider, mockReleaseExtractor, releaseManager)
			releaseSetAndInstallationManifestParser := bicmd.ReleaseSetAndInstallationManifestParser{
				ReleaseSetParser:   releaseSetParser,
				InstallationParser: installationParser,
Exemple #3
0
		fakeFs            *fakesys.FakeFileSystem
		fakeUUIDGenerator *fakeuuid.FakeGenerator
		parser            manifest.Parser
		logger            boshlog.Logger
		fakeValidator     *fakes.FakeValidator
		fixtures          manifestFixtures
	)
	BeforeEach(func() {
		fakeValidator = fakes.NewFakeValidator()
		fakeValidator.SetValidateBehavior([]fakes.ValidateOutput{
			{Err: nil},
		})
		fakeFs = fakesys.NewFakeFileSystem()
		logger = boshlog.NewLogger(boshlog.LevelNone)
		fakeUUIDGenerator = fakeuuid.NewFakeGenerator()
		parser = manifest.NewParser(fakeFs, fakeUUIDGenerator, logger, fakeValidator)
		fixtures = manifestFixtures{
			validManifest: `
---
name: fake-deployment-name
cloud_provider:
  template:
    name: fake-cpi-job-name
    release: fake-cpi-release-name
  mbus: http://fake-mbus-user:[email protected]:6868
  properties:
    fake-property-name:
      nested-property: fake-property-value
`,
			missingPrivateKeyManifest: `
---