本文整理匯總了Golang中github.com/cloudfoundry/bosh-agent/agent/applier/applyspec/fakes.FakeV1Service.Get方法的典型用法代碼示例。如果您正苦於以下問題:Golang FakeV1Service.Get方法的具體用法?Golang FakeV1Service.Get怎麽用?Golang FakeV1Service.Get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/cloudfoundry/bosh-agent/agent/applier/applyspec/fakes.FakeV1Service
的用法示例。
在下文中一共展示了FakeV1Service.Get方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: describeDrbd
func describeDrbd() {
var (
dualDCSupport *DualDCSupport
cmdRunner *fakesys.FakeCmdRunner
fs *fakesys.FakeFileSystem
dirProvider boshdir.Provider
specService *fakeas.FakeV1Service
settingsService *fakesettings.FakeSettingsService
logger boshlog.Logger
spec boshas.V1ApplySpec
)
BeforeEach(func() {
fs = fakesys.NewFakeFileSystem()
cmdRunner = fakesys.NewFakeCmdRunner()
specService = fakeas.NewFakeV1Service()
settingsService = &fakesettings.FakeSettingsService{}
dirProvider = boshdir.NewProvider("/var/vcap")
logger = boshlog.NewLogger(boshlog.LevelNone)
dualDCSupport = NewDualDCSupport(
cmdRunner,
fs,
dirProvider,
specService,
settingsService,
logger,
)
spec = boshas.V1ApplySpec{}
spec.DrbdEnabled = true
spec.Passive = "enabled"
specService.Spec = spec
})
Context("DNS updates", func() {
It("", func() {
s, e := specService.Get()
fmt.Printf("spec: %#v, err: %v", s, e)
})
})
Describe("Drbd", func() {
It("renders config file", func() {
expectedOutput := `
resource r0 {
net {
protocol A;
shared-secret OIUncfjJsbhInuic1243d;
verify-alg sha1;
}
disk {
resync-rate 24M;
}
handlers {
before-resync-target "/lib/drbd/snapshot-resync-target-lvm.sh";
after-resync-target "/lib/drbd/unsnapshot-resync-target-lvm.sh";
}
startup {
wfc-timeout 3;
degr-wfc-timeout 3;
outdated-wfc-timeout 2;
}
on dff85535-580a-4bfb-bf49-5efbc017b5bb {
device drbd1;
disk /dev/mapper/vgStoreData-StoreData;
address 10.76.245.71:7789;
meta-disk internal;
}
on host2 {
device drbd1;
disk /dev/mapper/vgStoreData-StoreData;
address 10.92.245.71:7789;
meta-disk internal;
}
}
`
// TODO: fix the test - sort out the fakes
// out := drbdConfig("A", "OIUncfjJsbhInuic1243d", "dff85535-580a-4bfb-bf49-5efbc017b5bb", "10.76.245.71", "10.92.245.71")
Expect("").NotTo(Equal(expectedOutput))
})
})
}