Example #1
0
func initializeCellPresence(address string, locketClient locket.Client, executorClient executor.Client, logger lager.Logger, rootFSProviders, preloadedRootFSes []string) ifrit.Runner {
	config := maintain.Config{
		CellID:            *cellID,
		RepAddress:        address,
		Zone:              *zone,
		RetryInterval:     *lockRetryInterval,
		RootFSProviders:   rootFSProviders,
		PreloadedRootFSes: preloadedRootFSes,
	}
	return maintain.New(config, executorClient, locketClient, logger, clock.NewClock())
}
Example #2
0
					}
				}
			},
		}

		serviceClient = &fake_bbs.FakeServiceClient{}
		serviceClient.NewCellPresenceRunnerReturns(fakeHeartbeater)

		config = maintain.Config{
			CellID:          "cell-id",
			RepAddress:      "1.2.3.4",
			Zone:            "az1",
			RetryInterval:   1 * time.Second,
			RootFSProviders: []string{"provider-1", "provider-2"},
		}
		maintainer = maintain.New(config, fakeClient, serviceClient, logger, clock)
	})

	AfterEach(func() {
		logger.Info("test-complete-signaling-maintainer-to-stop")
		close(pingErrors)
		ginkgomon.Interrupt(maintainProcess)
	})

	It("pings the executor", func() {
		pingErrors <- nil
		maintainProcess = ginkgomon.Invoke(maintainer)
		Expect(fakeClient.PingCallCount()).To(Equal(1))
	})

	Context("when pinging the executor fails", func() {
Example #3
0
					}
				}
			},
		}

		locketClient = &locketfakes.FakeClient{}
		locketClient.NewCellPresenceReturns(fakeHeartbeater)

		config = maintain.Config{
			CellID:          "cell-id",
			RepAddress:      "1.2.3.4",
			Zone:            "az1",
			RetryInterval:   1 * time.Second,
			RootFSProviders: []string{"provider-1", "provider-2"},
		}
		maintainer = maintain.New(config, fakeClient, locketClient, logger, clock)
	})

	AfterEach(func() {
		logger.Info("test-complete-signaling-maintainer-to-stop")
		close(pingErrors)
		ginkgomon.Interrupt(maintainProcess)
	})

	It("pings the executor", func() {
		pingErrors <- nil
		maintainProcess = ginkgomon.Invoke(maintainer)
		Expect(fakeClient.PingCallCount()).To(Equal(1))
	})

	Context("when pinging the executor fails", func() {