예제 #1
0
func init() {
	Describe("Testing with Ginkgo", func() {
		It("get returns an aws infrastructure", func() {
			logger, platform, provider := getNewProvider()
			inf, err := provider.Get("aws")

			devicePathResolver := boshdevicepathresolver.NewAwsDevicePathResolver(500*time.Millisecond, platform.GetFs())

			Expect(err).ToNot(HaveOccurred())
			assert.IsType(GinkgoT(), NewAwsInfrastructure("http://169.254.169.254", NewDigDnsResolver(logger), platform, devicePathResolver), inf)
		})
		It("get returns vsphere infrastructure", func() {

			logger, platform, provider := getNewProvider()
			inf, err := provider.Get("vsphere")

			devicePathResolver := boshdevicepathresolver.NewAwsDevicePathResolver(500*time.Millisecond, platform.GetFs())

			Expect(err).ToNot(HaveOccurred())
			assert.IsType(GinkgoT(), NewVsphereInfrastructure(platform, devicePathResolver, logger), inf)
		})
		It("get returns an error on unknown infrastructure", func() {

			_, _, provider := getNewProvider()
			_, err := provider.Get("some unknown infrastructure name")

			Expect(err).To(HaveOccurred())
		})
	})
}
예제 #2
0
func (p Provider) createAwsInfrastructure(metadataHost string, resolver dnsResolver,
	platform boshplatform.Platform) (inf Infrastructure) {

	devicePathResolver := boshdevicepathresolver.NewAwsDevicePathResolver(500*time.Millisecond, platform.GetFs())
	inf = NewAwsInfrastructure(metadataHost, resolver, platform, devicePathResolver)
	return
}
예제 #3
0
		platform = NewLinuxPlatform(
			fs,
			cmdRunner,
			collector,
			compressor,
			copier,
			dirProvider,
			vitalsService,
			cdutil,
			diskManager,
			netManager,
			sleepInterval,
			logger,
		)
		devicePathResolver := boshdevicepathresolver.NewAwsDevicePathResolver(diskWaitTimeout, fs)
		platform.SetDevicePathResolver(devicePathResolver)
	})

	Describe("SetupRuntimeConfiguration", func() {
		It("setups runtime configuration", func() {
			err := platform.SetupRuntimeConfiguration()
			Expect(err).NotTo(HaveOccurred())

			Expect(len(cmdRunner.RunCommands)).To(Equal(1))
			Expect(cmdRunner.RunCommands[0]).To(Equal([]string{"bosh-agent-rc"}))
		})
	})

	Describe("CreateUser", func() {
		It("creates user", func() {