当前位置: 首页>>代码示例>>Golang>>正文


Golang FakeV1Service.Get方法代码示例

本文整理汇总了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))
		})

	})

}
开发者ID:nimbus-cloud,项目名称:bosh-agent,代码行数:92,代码来源:drbd_test.go


注:本文中的github.com/cloudfoundry/bosh-agent/agent/applier/applyspec/fakes.FakeV1Service.Get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。