本文整理匯總了Golang中github.com/cloudfoundry/bosh-agent/platform/fakes.FakePlatform.SetupRawEphemeralDisksErr方法的典型用法代碼示例。如果您正苦於以下問題:Golang FakePlatform.SetupRawEphemeralDisksErr方法的具體用法?Golang FakePlatform.SetupRawEphemeralDisksErr怎麽用?Golang FakePlatform.SetupRawEphemeralDisksErr使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/cloudfoundry/bosh-agent/platform/fakes.FakePlatform
的用法示例。
在下文中一共展示了FakePlatform.SetupRawEphemeralDisksErr方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: init
//.........這裏部分代碼省略.........
platform.GetEphemeralDiskPathRealPath = "/dev/sda"
err := bootstrap()
Expect(err).NotTo(HaveOccurred())
Expect(platform.SetupEphemeralDiskWithPathDevicePath).To(Equal("/dev/sda"))
Expect(platform.GetEphemeralDiskPathSettings).To(Equal(boshsettings.DiskSettings{
VolumeID: "fake-ephemeral-disk-setting",
Path: "fake-ephemeral-disk-setting",
}))
})
It("returns error if setting ephemeral disk fails", func() {
platform.SetupEphemeralDiskWithPathErr = errors.New("fake-setup-ephemeral-disk-err")
err := bootstrap()
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("fake-setup-ephemeral-disk-err"))
})
It("sets up raw ephemeral disks if paths exist", func() {
settingsService.Settings.Disks = boshsettings.Disks{
RawEphemeral: []boshsettings.DiskSettings{{Path: "/dev/xvdb"}, {Path: "/dev/xvdc"}},
}
err := bootstrap()
Expect(err).NotTo(HaveOccurred())
Expect(platform.SetupRawEphemeralDisksCallCount).To(Equal(1))
Expect(len(platform.SetupRawEphemeralDisksDevices)).To(Equal(2))
Expect(platform.SetupRawEphemeralDisksDevices[0].Path).To(Equal("/dev/xvdb"))
Expect(platform.SetupRawEphemeralDisksDevices[1].Path).To(Equal("/dev/xvdc"))
})
It("returns error if setting raw ephemeral disks fails", func() {
platform.SetupRawEphemeralDisksErr = errors.New("fake-setup-raw-ephemeral-disks-err")
err := bootstrap()
Expect(platform.SetupRawEphemeralDisksCallCount).To(Equal(1))
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("fake-setup-raw-ephemeral-disks-err"))
})
It("sets up data dir", func() {
err := bootstrap()
Expect(err).NotTo(HaveOccurred())
Expect(platform.SetupDataDirCalled).To(BeTrue())
})
It("returns error if set up of data dir fails", func() {
platform.SetupDataDirErr = errors.New("fake-setup-data-dir-err")
err := bootstrap()
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("fake-setup-data-dir-err"))
})
It("sets up tmp dir", func() {
err := bootstrap()
Expect(err).NotTo(HaveOccurred())
Expect(platform.SetupTmpDirCalled).To(BeTrue())
})
It("returns error if set up of tmp dir fails", func() {
platform.SetupTmpDirErr = errors.New("fake-setup-tmp-dir-err")
err := bootstrap()
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("fake-setup-tmp-dir-err"))
})