예제 #1
0
					Expect(password).To(Equal("some-password"))

					if callCount == 3 {
						w.Write([]byte(`{"state": "done"}`))
					} else {
						w.Write([]byte(`{"state": "processing"}`))
					}
					callCount++
				default:
					Fail("unexpected route")
				}
			}))

			client := bosh.NewClient(bosh.Config{
				URL:                 server.URL,
				Username:            "******",
				Password:            "******",
				TaskPollingInterval: time.Nanosecond,
			})

			yaml := `---
name: some-deployment-name
jobs:
  - name: consul_z1
    instances: 2
  - name: consul_z2
    instances: 0
  - name: consul_z3
    instances: 1
`

			err := client.ScanAndFix([]byte(yaml))
예제 #2
0
	client bosh.Client

	turbulenceManifest destiny.Manifest
	turbulenceClient   turbulence.Client
)

var _ = BeforeSuite(func() {
	configPath, err := helpers.ConfigPath()
	Expect(err).NotTo(HaveOccurred())

	config, err = helpers.LoadConfig(configPath)
	Expect(err).NotTo(HaveOccurred())

	client = bosh.NewClient(bosh.Config{
		URL:              fmt.Sprintf("https://%s:25555", config.BOSH.Target),
		Username:         config.BOSH.Username,
		Password:         config.BOSH.Password,
		AllowInsecureSSL: true,
	})

	By("deploying turbulence", func() {
		info, err := client.Info()
		Expect(err).NotTo(HaveOccurred())

		guid, err := helpers.NewGUID()
		Expect(err).NotTo(HaveOccurred())

		manifestConfig := destiny.Config{
			DirectorUUID: info.UUID,
			Name:         "turbulence-consul-" + guid,
			BOSH: destiny.ConfigBOSH{
				Target:         config.BOSH.Target,