本文整理汇总了Golang中github.com/cloudfoundry/bosh-agent/platform/fakes.FakePlatform.SetupEphemeralDiskWithPathErr方法的典型用法代码示例。如果您正苦于以下问题:Golang FakePlatform.SetupEphemeralDiskWithPathErr方法的具体用法?Golang FakePlatform.SetupEphemeralDiskWithPathErr怎么用?Golang FakePlatform.SetupEphemeralDiskWithPathErr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/cloudfoundry/bosh-agent/platform/fakes.FakePlatform
的用法示例。
在下文中一共展示了FakePlatform.SetupEphemeralDiskWithPathErr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: init
//.........这里部分代码省略.........
err := bootstrap()
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("fake-load-error"))
})
It("sets up networking", func() {
networks := boshsettings.Networks{
"bosh": boshsettings.Network{},
}
settingsService.Settings.Networks = networks
err := bootstrap()
Expect(err).NotTo(HaveOccurred())
Expect(platform.SetupNetworkingNetworks).To(Equal(networks))
})
It("sets up ephemeral disk", func() {
settingsService.Settings.Disks = boshsettings.Disks{
Ephemeral: "fake-ephemeral-disk-setting",
}
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())
})